NSArrayController selection - core-data

I want to achieve the following:
There is a list of persons (name, birthday, photo)
I want to select a person name in the NSPopUpButton and show
other details below.
How can I do it using bindings only?
I use NSArrayController to populate NSPopUpButton.
I use NSArrayController.selection. to populate birthday and photo fields.
But when I select a name in NSPopUpButton selection property of the NSArrayController
not changed.
In other words how can I get an object (NSManagedObject) selected in NSPopUpButton of change selection property of the NSArrayController using bindings only.
Thanks,
Vlad

I have found the solution. To make it we have to bind selected index of the NSPopUpButton to the selectionIndex of a NSArrayController.

Related

PowerApps LookUp of a Person or Group type from Sharepoint List

I have a field that is a combobox filled with names that is auto-populated(defaultselectedItems) with the name of the user of the PowerApp using Office365User.MyProfileV2().displayName. This name can be found in a sharepoint list I can access through a lookup function, my goal is to lookup the name of the value(which is a type person or group) and find the corresponding title value and set it to the defaultSelectedItems of another combobox, if found, and if not it should just be a blank value. My most likely problem is with the syntax, but I have tried other sources to look for a correction with no success. Any help would be appreciated!
I was able to reference a combobox people picker and grab their Title with the below setup:
Combobox is a People Picker. If you have this already set up it can be skipped:
Item = Office365Users.SearchUser({searchTerm:ComboBox.SearchText,top:10})
The next one can be a text input or label to reference:
Text = ComboBox.Selected.JobTitle

How to add a foreign key reference to the primary key selector control

In the stock item screen, a custom grid is added. The DAC for the custom grid contains InventoryItem.inventoryID. That particular grid has a custom field in which the user wishes to search for, inside the inventory item selector control. I refer to the primary Inventory Item selector control for the stock item screen.
In normal circumstances, the customization manager allows you to select a particular field, and add that to the grid which appears inside the selector control. That is simple, since the field is a member of the same DAC. But in my case, I wish to add a column from the related data view. Since the primary data view has no knowledge of grid, the needed column is not available for selection. Also there is a high probability that records will be repeated inside the selector control, since the relation is one to many. This is acceptable.
I try the following suggestions.
1) use Cache_attached event handler, for InventoryItem.InventoryCD.
I add my own custom PXSelect statement which joins InventoryItem & CustomTable. But an error occurs: A foreign key reference cannot be created from the type 'PX.Data.PXSelectJoin`3[PX.Objects.IN.InventoryItem (ect)
2) Declare data view delegate for Items which yields type InventoryItem & CustomDAC. This approach returns no errors. However I am unable to select the user field, in the field selection panel.
3) Create a Project on InventoryItem DAC and write a PXSelect to join the two tables. I am unsure if this is the correct approach.
I wish to know if anyone has suggestions
You should follow the approach suggested here to concatenate field values from a related data view into a custom text column inside the InventoryItem table.

Set multiple fields after selecting a document on the dialog list in lotus notes

I use a dialog list field with a view for choices. I need not only to set the current field with a value of the selected document but multiple fields on the current form.
When I select a document I want to read some fields from the selected document and set values on the current mask. I try to set the document id in the current dialog list field and get it and read in some refresh action? Is this a good approach?
Thank you! Best regards, Robert.
Solved it with a button and #PickList. So I have full controll over the action.

XPages - populating multiple fields on typeahead selection

This might be a straightforward question but I can't see wood for trees at the moment
Problem: I have a typeahead attached to an edit box that looks up values from a view (based on Tim Tripcony's code). When a value is selected, I want other edit boxes on the XPage to be populated with values pulled from the corresponding document.
As an example: A username edit box has a typeahead looking up from the NAB. I select "Joe Bloggs" name from the typeahead list and want the email, phone and location edit boxes to be immediately populated with the values from his NAB entry.
I'm banging my head on the wall over this because I'm sure there's an easy and obvious solution. Thanks.
Selecting a value from the typeahead should trigger any onChange event defined for the edit box. You can set the other fields by updating the data source directly from within that event:
var selectedName = currentDocument.getValue("contactName");
currentDocument.setValue("emailAddress", getEmail(selectedName));
currentDocument.setValue("phoneNumber", getPhone(selectedName));
currentDocument.setValue("location", getLocation(selectedName));
Naturally, the above example assumes those are your field names, and that you have the named functions defined elsewhere.

Sharepoint calculated field's formula for created by

i have a sharepoint list
with 2 users for examole (user A and user B)
i need a calculated field in the list items such that if user "A" created the item the field vaule will be "X" and if user "B" created the item fields value would be "Y"
but i couldnt use [created by] in the furmiula of the calculated field !! why is that ?!! and is there another way to do what i need to do ?!
If using Sharepoint Designer is an option you can create a workflow for that list. Set it to start when a new item is created -or- edited, use a condition of "If Created_By equals ..." and an action of "Set yourfield to yourvalue", then add an Else If branch and repeat. This will always override anything a user enters in "yourfield". Takes about 2 minutes to do all of this.
I believe you can create a text field that has the default value set to [Me] which should then be usable in a calculated field.
For more complicated formulae (i.e. anything with conditional logic), try creating an event handler for the content type (or doc library). This will allow you full control to set the fields to what you desire.
The field can be hidden from the user inside the edit screens.
Make sure use the STSDev from codeplex to setup the solution for deployment.

Resources