In this Blog we will see how to Use Xrm.WebApi.retrieveRecord in Dataverse / MSCRM
Video for your Reference: https://youtu.be/9QHxNtClV-4?si=1vM2lViCY9XngIXW
Power Platform, Microsoft Dynamics CRM 4.0, 2011, 2013, 2015, 2016, D365 CE, C#, ASP.net and MVC, Azure
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);
}
);
}
In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript
label1 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870000);
label2 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870001);
label3 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870002);
label4 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870003);
label5 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870004);
label6 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870005);
formContext.getControl("bosch_optionsetvalues").removeOption(377870000);
formContext.getControl("bosch_optionsetvalues").removeOption(377870001);
formContext.getControl("bosch_optionsetvalues").removeOption(377870002);
formContext.getControl("bosch_optionsetvalues").removeOption(377870003);
formContext.getControl("bosch_optionsetvalues").removeOption(377870004);
formContext.getControl("bosch_optionsetvalues").removeOption(377870005);
formContext.getControl("bosch_optionsetvalues").addOption(label1);
formContext.getControl("bosch_optionsetvalues").addOption(label2);
formContext.getControl("bosch_optionsetvalues").addOption(label3);
In this Blog, we will see how to Set Field Requirements Dynamically - JavaScript in MSCRM/Dataverse
if (formContext.getAttribute("bosch_booleanfield").getValue() == true) {
formContext.getAttribute("bosch_enabledisablefield").setRequiredLevel("none");
}
else if (formContext.getAttribute("bosch_booleanfield").getValue() == false) {
formContext.getAttribute("bosch_enabledisablefield").setRequiredLevel("required");
}
In this Video we will see how to Working with Lookup Fields in Javascript (MSCRM or Dataverse Environemnt)
if (formContext.getAttribute("bosch_destinationdate").getValue() != null){
var getFullYear = formContext.getAttribute("bosch_destinationdate").getValue().getFullYear();
var getDate = formContext.getAttribute("bosch_destinationdate").getValue().getDate();
var getMonth = formContext.getAttribute("bosch_destinationdate").getValue().getMonth() + 1;
formContext.getAttribute("bosch_getnumbersfromdestinationdate").setValue(getFullYear + "-" + getDate + "-" + getMonth);
}
Introduction :
function enableDisableFieldsBasedonCondition(executionContext) {
debugger;
var formContext = executionContext.getFormContext();
if (formContext.getAttribute("bosch_booleanfield").getValue() == true) {
formContext.getControl("bosch_enabledisablefield").setDisabled(true);
}
else if (formContext.getAttribute("bosch_booleanfield").getValue() == false) {
formContext.getControl("bosch_enabledisablefield").setDisabled(false);
}
}
Introduction:
function showHideFieldsBasedonCondition(executionContext) {
var formContext = executionContext.getFormContext();
if (formContext.getAttribute("bosch_booleanfield").getValue() == true) {
formContext.getControl("bosch_showorhidefield").setVisible(true);
}
else if (formContext.getAttribute("bosch_booleanfield").getValue() == false) {
formContext.getControl("bosch_showorhidefield").setVisible(false);
}
}
In this Blog we will see how to Use Xrm.WebApi.retrieveRecord in Dataverse / MSCRM Video for your Reference: https://youtu.be/9QHxNtClV-4...