Hi,
While trying to create a record in the custom entity we are getting the below error:
Hi james,
Have you resolved this issue?
According to the error message, the "context" was not defined in "GetuserInfo" function.
First you need to get the "context" object by code like this.
var context=Xrm.Page.context. or var context=GetGlobalContext();
Then you could use this "context.getServerUrl()" to do something.
Note that the error is caused in your "GetUserInfo" function.
Hope it helps.
Best Regards,
Leo
Hi James,
You need to swap out the use of getServerUrl for getClientUrl in the GetUserInfo function. You can confirm that this is the cause of your issue by debugging your JavaScript.
function GetUserInfo(fields)
Hi James,
On this line of JavaScript code you are calling the GetUserInfo function:
var userInfo = GetUserInfo(fields);
We need the code for this function.
Code
Hi James,
I can if you provide the code in your GetUserInfo function along with a screenshot of the error message and any associated log files.
Hi,
Can you please let me know what the modified code on this should look like
Hi James,
Are you sure? Please examine the GetUserInfo function.
Hi, In my code getServerUrl method is nowhere used
Hi James,
Use getClientUrl to return the base URL that was used to access the application, instead of the removed getServerUrl method.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156