The CreatorCon Call for Content is officially open! Get started here.

Get the Parameters from URL

Kusuma2
Kilo Guru

Hi Gurus,

I have a requirement to populate the field on the record producer when a record producer is created from incident.

UI page Client redirecting to Record Producer on selection:

 

Its working fine.

Now I want to get the sys_id present in the url to Record Producer Reference Field.

I have written the business Rule(before/after insert)  to get the parameter value from the url  and update the field but it showing me undefined.

(function executeRule(current, previous /*null when async*/) {

// Add your code here
var cat = gs.action.getGlideURI().getMap().get('u_catalog_item');
gs.addInfoMessage(cat);

//var cat1 =gs.action.getGlideURI().indexOf('sysparm_u_catalog_item');
var cat2=RP.getParameterValue('sysparm_u_catalog_item');
//gs.addInfoMessage(cat1);
gs.addInfoMessage(cat2);
if(current.isNewRecord()){
gs.addInfoMessage("its is new record");
//current.u_incident=cat;
current.u_incident=cat1;
// current.u_incident=cat.getDisplayValue;
// current.u_incident=cat1.getDisplayValue;
//current.short_description= cat;
current.short_description= cat1;
current.update();
// g_form.setValue('u_incident', cat.toString());

}

})(current, previous);

 

 

 

11 REPLIES 11

That is not my Requirement..let me explain you 

Create a 'New' UI Action on the Catalog Registry form. It should only appear when there are no catalog items related to it.
When pressed it opens a modal with two options - one section with a list/dropdown of active catalog items where the registry field on the item is blank and a 'Relate' button next to it, and a section with a button that says 'Create new item' and a dropdown with 'Catalog Item', 'Record Producer' and 'Order Guide' under it.
If an item is selected and the relate button is pressed, the catalog item has its registry field updated with the sys_id of the registry item we're on, and the registry item we're on has its 'current version' field updated with that catalog item
If 'Create new' is selected, a new item form is opened based on which of the drop downs was selected, with the registry item populated in the registry field.-- Ia m pending with populating the registry field.

Aj,

Ok so why are you setting the u_incident field?