Tuesday, January 7, 2025

Day 22: Fetching Records with Xrm.WebApi.retrieveRecord in Dataverse / MSCRM

 In this Blog we will see how to Use Xrm.WebApi.retrieveRecord in Dataverse / MSCRM



function retreiveRecord(executionContext) {
    var formContext = executionContext.getFormContext();
    var getCurrentRecordid = formContext.data.entity.getId();
    getCurrentRecordid = getCurrentRecordid.replace("{", "").replace("}", "");
    Xrm.WebApi.retrieveRecord("TABLENAME", getCurrentRecordid , "?$select=fieldname1,fieldname2").then(
        function success(result) {
            console.log(result);
            // Columns
            var bosch_dayid = result["fieldname1"]; 
            var bosch_dayname = result["fieldname2"]; 
        },
        function (error) {
            console.log(error.message);
        }
    );
}

No comments:

Post a Comment

Day 22: Fetching Records with Xrm.WebApi.retrieveRecord in Dataverse / MSCRM

  In this Blog we will see how to Use Xrm.WebApi.retrieveRecord in Dataverse / MSCRM Video for your Reference:  https://youtu.be/9QHxNtClV-4...