top of page
Search
  • admin

Accessing custom form parameters after getQueryStringParameters is deprecated

Xrm.Page.context.getQueryStringParameters is now deprecated. The custom parameter values are now accessible via formContext.getAttribute('param_mycustomparam').getValue().


For example:

You have a custom parameter named param_custom1 as per below:



In your script file, you would then retrieve the value by calling

var myParamValue = formContext.getAttribute('param_custom1').getValue();

For a more complete code accessing the value from Form OnLoad event, see below.


var namespace = namespace || {};
namespace.Account = namespace.Account || {};

namespace.Account.Form = (function (){

    var onFormLoad = function (exContext) {
        var formType = exContext.getFormContext();        
        var myParamValue = formContext.getAttribute('param_custom1').getValue();

        //just a quick way to display the value, for proper alert dialog please use Xrm.Navigation.openAlertDialog
        alert('my param value: ' + myParamValue);
    };

    return {
        onFormLoad: onFormLoad,
    }
})();

That's all about this post.




0 comments

Comments


bottom of page