- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-06-2024 06:52 AM
I have to pass the form value from one catalog form to another.
Scenario:
I have opened one catalog form and there is one reference field.
Based on ref field I have to redirect this to new catalog form
Now i have to populate previous form value to new form where on which we have redirected.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-09-2024 04:19 AM
Thanks guyz for your support but i have my solution.
We can use url+&sysparm_field1=" "+&sysparm_field2=" "; to pass the value form one form to another form without submitting 1st form
on second form use onload script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-06-2024 09:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-06-2024 10:24 AM
In your first catalog item (let's call it "Catalog Item A"), you need to capture the value from the reference field. You can use a Client Script for this
onSubmit Catalog Client Script
function onSubmit() {
var referenceValue = g_form.getValue('reference_field_name');
// Store it in a query parameter or use it to construct the URL for redirection
var redirectURL = '/catalog.do?sys_id=' + g_form.getSysId() + '&reference_value=' + referenceValue;
// Set the URL of the next catalog item form
g_form.setRedirectURL(redirectURL);
return true;
}
When redirecting to the new catalog item (let's call it "Catalog Item B"), you'll need to handle the query parameters to pre-populate the fields in Catalog Item B.
onLoad Catalog Client Script
function onLoad() {
var queryParams = new URLSearchParams(window.location.search);
var referenceValue = queryParams.get('reference_value');
if (referenceValue) {
g_form.setValue('field_in_catalog_item_b', referenceValue);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-09-2024 04:19 AM
Thanks guyz for your support but i have my solution.
We can use url+&sysparm_field1=" "+&sysparm_field2=" "; to pass the value form one form to another form without submitting 1st form
on second form use onload script