Monday, September 23, 2024

Day 6: Showing and Hiding Fields with JavaScript in MSCRM

 Introduction :


In this blog we will see how to Showing and Hiding Fields with JavaScript in MSCRM


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);
    }
}













Thursday, September 19, 2024

Day 5 - Show and Hide fields Based on Condition using JavaScript in MSCRM/Datave

 Introduction:


In this blog we will see how to Show and Hide Fields based on Condition using JavaScript in MSCRM/ Dataverse


Script:

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);
    }
}

Trigger above code on ONCHANGE.


Attaching my video here for Detail





Wednesday, September 18, 2024

Day 4 - Validating Form Fields using JavaScript

Introduction:


In this blog we will see how to Validating Form Fields using JavaScript


function validateDateField(executionContext) {
    var formContext = executionContext.getFormContext();

    if (formContext.getAttribute("bosch_destinationdate").getValue() != null &&
        formContext.getAttribute("bosch_sourcedate").getValue() != null) {

        if (formContext.getAttribute("bosch_destinationdate").getValue() < formContext.getAttribute("bosch_sourcedate").getValue()) {
            var alertStrings = { confirmButtonLabel: "Yes", text: "Destination Date Should be Greater", title: "Date Alert" };
            var alertOptions = { height: 120, width: 260 };
            Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
                function (success) {
                    console.log("Alert dialog closed");
                },
                function (error) {
                    console.log(error.message);
                }
            );
        }
    }
}



Monday, September 16, 2024

Basic event handling - Onload, Onchange in MSCRM / Dataverse

 Introduction:


Day 3 : Basic event handling - Onload, Onchange in MSCRM / Dataverse


Script :


function onChange(executionContext) { debugger; var formContext = executionContext.getFormContext(); if (formContext.getAttribute("bosch_dayname").getValue() != null) { var alertStrings = { confirmButtonLabel: "Yes", text: formContext.getAttribute("bosch_dayname").getValue(), title: "Throw Alert" }; var alertOptions = { height: 120, width: 260 }; Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then( function (success) { console.log("Alert dialog closed"); }, function (error) { console.log(error.message); } ); } }




Friday, September 13, 2024

FormContext to retrieve and set field values in MSCRM/Dataverse

Introduction:


Day 2 : using FormContext to retrieve and set field values in MSCRM/Dataverse forms.


Sample JavaScript


function onLoad(executionContext) { debugger; var formContext = executionContext.getFormContext(); if (formContext.getAttribute("bosch_dayname").getValue() != null) { formContext.getAttribute("bosch_setvalue").setValue(formContext.getAttribute("bosch_dayname").getValue()) } }


Video for your Reference





Thursday, September 12, 2024

Day 1: Understanding Form Context in MSCRM/Dataverse JavaScript

 Day 1: Understanding Form Context in MSCRM/Dataverse JavaScript


Kickstarting my 50-day JavaScript challenge for MSCRM! Today’s focus is on understanding the form context in MSCRM/Dataverse JavaScript. Mastering form context is essential for accessing and manipulating form data effectively.

Check out my YouTube video for a detailed explanation:

https://lnkd.in/dwCT-sdp

Follow along and join me on this journey!

hashtagmicrosoft hashtagmscrm hashtagpowreapps hashtagpowerplatform hashtag50daychallenge




50-Day JavaScript Challenge for MSCRM / Dataverse

 ðŸš€ 50-Day JavaScript Challenge for MSCRM / Dataverse🚀


I’m starting a 50-day challenge to improve JavaScript skills in the context of Microsoft Dynamics CRM/ Dataverse. Each day will cover a different aspect, from basic field scripting to advanced web API integrations!

I'll be sharing daily videos on my YouTube channel, so feel free to join the challenge, follow along, and share your experience!

Subscribe my New Channel : https://lnkd.in/gbWpvgUw













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_op...