Get lookup values in Model driven app using Xrm.WebApi
One of my project, i had a requirement to get the Lookup value by passing the lookup value from the form when page load. For that i have added a JavaScript function on page load methos by adding the javascript file in the web resources of the app. In the JavaScript method, i have added following code the get the Lookup value using the existing lookup value id function GetValuesFromLookup(executionContext) { var formContext = executionContext.getFormContext(); var transferId = formContext.data.entity.getId(); if (formContext.getAttribute("student").getValue() !== null) { var itemid = formContext.getAttribute("student").getValue(); var id = itemid[0].id; Xrm.WebApi.retrieveRecord("student", id, "?$select=_classid_value").then( function success(result) { var...