You can pass different parameter based in the "record" to create with field values
Power Platform/Dynamics CRM
Power Platform, Microsoft Dynamics CRM 4.0, 2011, 2013, 2015, 2016, D365 CE, C#, ASP.net and MVC, Azure
Thursday, January 16, 2025
Day 23: Creating New Records Programmatically with JavaScript in Dataverse / MSCRM
In this Blog, we will see how to Create New Records Programmatically with JavaScript in Dataverse / MSCRM
Wednesday, January 15, 2025
How to Retrieve Records using FETCHXML using JavaScript in MSCRM or Dataverse
In this blog we will see how to How to Retrieve Records using FETCHXML using JavaScript in MSCRM or Dataverse
1. Prepare FetchXML ( Login to CRM or Dataverse then Go to Advance Find and Frame your Query and Download the FetchXML)
2. Consider am retrieving All Accounts
function retriveRecordusingFetchXML() {
var fetchXml = `
<fetch>
<entity name="account">
<attribute name="accountid" />
<attribute name="name" />
</entity>
</fetch>`;
var encodedFetchXML = encodeURIComponent(fetchXml);
var fetchXmlRequest = "?fetchXml=" + encodedFetchXML;
Xrm.WebApi.retrieveMultipleRecords("account", fetchXmlRequest).then(
function success(result) {
for (const record of result.entities) {
var name = record.name;
}
},
function (error) {
var alertMessage = { text: error.message };
Xrm.Navigation.openAlertDialog(alertMessage, null);
}
);
}
Use the Above Code to retrieve Record
you can change the FetchXML based on your requirement.
you can change the FetchXML based on your requirement.
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
Video for your Reference: https://youtu.be/9QHxNtClV-4?si=1vM2lViCY9XngIXW
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);
}
);
}
Friday, October 18, 2024
Day 11 - Customizing Option Sets Dropdown Fields with JavaScript
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);
Monday, October 7, 2024
Day 10 - Using JavaScript to Set Field Requirements Dynamically - JavaScript in MSCRM/Dataverse
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");
}
Monday, September 30, 2024
Day 9 : Working with Lookup Fields - JavaScript in MSCRM/Dataverse
In this Video we will see how to Working with Lookup Fields in Javascript (MSCRM or Dataverse Environemnt)
Wednesday, September 25, 2024
Day 7: Formatting Data (Dates, Numbers) in MSCRM JavaScript
In this Blog we will see Formatting Data (Dates, Numbers) in MSCRM JavaScript
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);
}
Subscribe to:
Posts (Atom)
Day 23: Creating New Records Programmatically with JavaScript in Dataverse / MSCRM
In this Blog, we will see how to Create New Records Programmatically with JavaScript in Dataverse / MSCRM var record = {}; record.bosch_day...
-
Introduction: In this blog, we will see how to check length of List Rows in Microsoft flow. Implementation Steps: 1. Navigate to https://f...
-
Hi All, If any one facing the issue in Console application while connecting to MSCRM(onpremises) with IFD as Unable to Login to Dynamics ...
-
Dear All, Today we got requirement to filter N:N Subgrid in D365 --> Quote Entity - Country Field --> Accessorial Entity - Coun...