Below is the code for Web API to Retrieve Record by entity ID along with helper function. The signature of the function is same as you might have seen in SDK.REST.js library. However, I have added two additional parameters:
- isAsync- Boolean. If isAsync is set to true, the request would be executed Asynchronously. In SDK.REST.js, it was hard-coded and sent as true.
- impersonatedUserId- Guid of the User. If you would like to execute the JS, in context of other user, you can pass the user id. To run in the logged-in user's context, pass the parameter as NULL.
- _getFormattedValue - When you want to retrieve the OptionSet Label/Lookup text, you can use the _getFormattedValue function specified in the library.
- _getLookupEntityLogicalName -For...