Hi All,
I have used the below code in online crm 9.1 to load the specific from based on lookup field value & called the method onload of case but its not working in online but this code worked in onprem 9.0 version.What could be the issue ?
Hi All,
I have used the below code in online crm 9.1 to load the specific from based on lookup field value & called the method onload of case but its not working in online but this code worked in onprem 9.0 version.What could be the issue ?
Hi,
Thank you for your query.
I believe following line in your code should be replaced:
var items = formContext.ui.formSelector.items.get();
// No need of .get() after Items (it will return the collection, .get(arg) expects an argument)
var items = formContext.ui.formSelector.items;
Also, did you check if the value is being returned by GetLookupName() function? Apparently code looks just fine, log this value using console.log or add debugger; in start of the function so you can debug it in the dev tools.
Hi Mehdi,
Thanks for the response. There is no specific error its loading wrong form based on field value which is interaction type lookup field here.
GetLookupName is using in common library :
function GetLookupName(formContext, fieldName) {
var value = formContext.getAttribute(fieldName).getValue();
if (value != null) {
return value[0].name;
}
}
The above code woked fine in 9.0 CRM Onpremise version.
Thanks,
Jharana
Hi,
what is the generated error? Can you give more details about the error please? Also, could you share the code of the GetLookupName function ?
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
91
Vahid Ghafarpour
78
Super User 2025 Season 1