Populate record producer based on URL from which user got redirected to it.

rambo2
Kilo Guru

Hi Team,

I have a requirement where when user clicks on a link he should get redirected to record producer with all empty values.

And there should be another link if user clicks on it he should get directed to same record producer but it should be filled with some values.

Is it possible? Thanks in advance.

1 REPLY 1

Brad Warman
Giga Sage

Hi @rambo2. You can add URL parameters and then populate the fields on the record producer using an on load client script.

If the URL parameter is something like first_name=John

Then you can use a function like this:

function getURLParam(name){
      var url = document.URL.parseQuery();
      if(url[name]){
              return decodeURI(url[name]);
      }
      else{
              return;
      }
}

 And get the value by:

var firstName = getURLParam('first_name');