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

autoFill catalog item field values from values passed in the URL.

Kingstan M
Kilo Sage

Greetings.

 

I am trying to redirect users who hits an link for an existing catalogItem.

I am tryin go give a default assignmentGroup for this action.

This catalogItem used by many categories thus i can not set defaultValue in the form. Thus trying to update via URL.

 

But I face challenges in updating.

Pl., correct me where am doing it wrong.

 

function onLoad() {
	var idGIA = 'catalogItem_sysID'; // fooSysID
	var nGTA = 'calogItem_name'; // fooName
	var aGrp = 'foo_assignmentGroup_sys_id'; // fooGroupID

 top.window.location = "foosp?id=sc_cat_item&sys_id=" + idGIA + "&Assignment_group=" + encodeURIComponent(aGrp); // Redirect here
    alert("Redirected To: General Support - " + nGTA); // Confirm alert

}

 

Many thanks,

Kingstan.

1 REPLY 1

Sonam_Tiwari
Kilo Sage

This is exactly what you need : https://snprotips.com/setting-catalog-item-variables-from-url from one of the gem of a blog https://snprotips.com/

 

I had a similar requirement recently and opted for this very method which works great and is well articulated. Check it out

 

Consider indicating the response as helpful and marking it as correct if it meets your needs.