top of page
Search

Accessing custom form parameters after getQueryStringParameters is deprecated

  • admin
  • Oct 3, 2021
  • 1 min read

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.




Recent Posts

See All
React.Js - Resource unavailable error

Happy days when everything is working in your development environment until you deploy your React project to Azure Web App. When browsing to any page other than the default page (or index.html), sudde

 
 
 

Comments


bottom of page