After conducting a considerable amount of research on this issue, I have found that none of the examples provided are helpful or applicable. My goal is to have the Details Picker display a specific name when the Add screen loads, instead of requiring the user to select it every time. I believe this can be accomplished, but my JavaScript skills are not up to par.
Any assistance would be greatly appreciated. Below is an example:
In this scenario, the name is stored in a table and can be searched for in the modal picker/details picker. However, manually adding it each time is both time-consuming and tedious if it's needed 50% of the time.
A text box can usually be manipulated using contentItem.value
or element.innerText
after pressing post render
on each item. Unfortunately, this approach does not work with this type of control, resulting in an error message.
Here is some useful information that might assist:
- ProjectData (datasource)
- Main screen references OrderRequest
- The foreign key link references ShippingContact, and CustomerName is searchable in the DetailsPicker
Do I need to substitute anything in the top function based on the answer provided below? Additionally, regarding the second part of the code where you mentioned
defaultLookup(screen.Customer, "Contact", "Contacts",
what should be included here?
This is an example of what I'm attempting to change, although unfortunately, it isn't working as intended:
var defaultValue = "Test User";
var filter = "(ContactName eq " + msls._toODataString(defaultValue, ":String") + ")";
defaultLookup(screen.OrderRequest, "ContactName", "ShippingContacts", { filter: filter });