Thursday, July 17, 2025

What Is A Column In Dynamics 365 CRM?

 In This Post we are going to Explain

What Is A Form In Dynamics 365 CRM/CE?

 In This Post we are going to Explain.

What is a Form in Dynamics 365 CRM/CE?

  • A form in Dynamics 365 CRM/CE is a user interface that provides a structured layout to view, create, and edit entity records. It organizes and displays fields, sections, and controls, enabling users to interact with an entity's data efficiently. Forms are essential for ensuring a consistent user experience and are tailored to specific business needs.

Saturday, July 12, 2025

Read The Dynamics 365 CRM Form TAB Using Java Script

To use the Dynamics 365 CRM form tab, you have to use this ui.tabs.get("TabName") method.
Now hide and show the TAB


// To hide TAB: true=Hide

formContext.ui.tabs.get("TabName").setVisible(true);


// To hide TAB: false=show

formContext.ui.tabs.get("TabName").setVisible(false);




Read The Dynamics 365 CRM Form Section Using Java Script

To read the Dynamics 365 CRM Tab section name used the ui.tabs.get("TabName").sections.get("TabsSectionName") method.

Now perform the operation to hide this Tab Section.

// To hide tabs Sections: true=Hide

formContext.ui.tabs.get("TabName").sections.get("TabsSectionName").setVisible(true);


// To hide tabs Sections: false=show

formContext.ui.tabs.get("TabName").sections.get("TabsSectionName").setVisible(false);

Wednesday, July 9, 2025

Read/Get And Write/Update All Data Types Of Field Values Using Java Script Into Dynamics 365 CRM/CE

 // Read And Write The Dynamics 365 CRM All Data Types Of Field Using Java Script

function AllDataTypeReadAndWrite(executionContext) {

    debugger;
    var formContext = executionContext.getFormContext();

    // Read Single Line of Text Field
        var empName = formContext.getAttribute("min_name")?.getValue();

    // Read Multi Line of Text Field
        var empAddress = formContext.getAttribute("min_address")?.getValue();

    // Read Date and Time Field
        var empDOB = formContext.getAttribute("min_dob")?.getValue();

    // Read Two Option Field
        var areYouINterested = formContext.getAttribute("min_areyouintersted")?.getValue();

    // Read Optionset Field
        var empCountry = formContext.getAttribute("min_country")?.getValue();

    // Read Multiselect Optionset Field
        var empCourses = formContext.getAttribute("min_courses")?.getValue();

    // Read Whole Number Field
        var empPostalCode = formContext.getAttribute("min_postalcode")?.getValue();

    // Read Decimal Field
        var empPercentage = formContext.getAttribute("min_percentage")?.getValue();

    // Read Currency Field
       var empSalary = formContext.getAttribute("min_salary")?.getValue();

    // Read Lookup Field
        var org = formContext.getAttribute("min_organization")?.getValue();

        var orgid = org[0].id;
        var orgname = org[0].name;
        var orgentityname = org[0].entityType
;



// Set/Update Single Line of Text field

    if (empName !== null && empName !== undefined)
   {
       formContext.getAttribute("min_name1").setValue(empName);
   }

// Set/Update Multi  Line of Text field

    if (empAddress !== null && empAddress !== undefined)
   {
       formContext.getAttribute("min_address1").setValue(empAddress);
   }

// Set/Update Date and Time field

    if (empDOB !== null && empDOB !== undefined)
   {
       formContext.getAttribute("min_dob1").setValue(empDOB);
   }

// Set/Update Two Option field

    if (areYouINterested == true)
   {
       formContext.getAttribute("min_areyouinterested1").setValue(true);
   }

else {
       formContext.getAttribute("min_areyouinterested1").setValue(false);
   }

// Set/Update OptionSet field

    if (empCountry !== null && empCountry !== undefined)
    {
       formContext.getAttribute("min_country1").setValue(empCountry);
    }

// Set/Update Multi Select OptionSet field

    if (empCourses !== null && empCourses !== undefined)
   {
      formContext.getAttribute("min_courses1").setValue(empCourses);
   }

// Set/Update Whole Number field

    if (empPostalCode !== null && empPostalCode !== undefined)
    {
                             formContext.getAttribute("min_postalcode1").setValue(empPostalCode);
    }

// Set/Update Decimal field

    if (empPercentage !== null && empPercentage !== undefined)
    {
        formContext.getAttribute("min_percentage1").setValue(empPercentage);
     }

// Set/Update Currency field

    if (empSalary !== null && empSalary !== undefined)
    {
       formContext.getAttribute("min_salary1").setValue(empSalary);
    }

// Set/Update Lookup field

    if (org !== null && org !== undefined)
    {
       formContext.getAttribute("min_organization1").setValue([{ id: orgid, name: orgname, entityType: orgentityname }]);
    }

}

Hide And Show Dynamics 365 CRM Fields On Form Using Java Script

 To hide and show fields on Form you have to use the setVisible() method.


// To Show/Visible fields on Form

    formContext.getControl("fieldSchemaName").setVisible(true);


// To Hide/Un-Visible fields on Form

    formContext.getControl("fieldSchemaName").setVisible(false);

Make Dynamics 365 CRM Fields Mandatory, Recommended and Not Mandatory Using Java Script.

 To Make Dynamics 365 CRM Fields Mandatory, Recommended and Not Mandatory Using Java Script. you have to use the setRequiredLevel() method.


// To make field Mandatory
formContext.getAttribute("fieldSchemaName").setRequiredLevel("required");


// To make field Recommended
formContext.getAttribute("fieldSchemaName").setRequiredLevel("recommended");


// To make field Not Mandatory
formContext.getAttribute("fieldSchemaName").setRequiredLevel("none");

Lock And UnLock Dynamics 365 CRM Fields On Form Using Java Script

To Lock and Un-Lock fields on Form you have to use the setDisabled() method.


// To Lock fields on Form

    formContext.getControl("fieldSchemaName").setDisabled(true);


// To Un-Lock fields on Form

    formContext.getControl("fieldSchemaName").setDisabled(false);

Add Remove Dynamics 365 CRM OptionSet Field Values

To remove Dynamics 365 CRM/CE OptionSet field value using Java Script you have to use the removeOption() and addOption().


// To Remove OptionSet option

// Option : C# Language    Value: 913420003
formContext.getControl("fieldSchemaName").removeOption(913420003);



// To Add OptionSet option

var optionAdd = { value: 913420003, text: "C# Language" };
formContext.getControl("fieldSchemaName").addOption(optionAdd);

What Is A Column In Dynamics 365 CRM?

 In This Post we are going to Explain