- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 05:19 AM
I have one use case wherein in a order guide "New Hire" we want to populate the Hiring Managers email id to the "Preferred Email address" in the New Email Account section.
function onLoad() {
// Get the reference to the 'hiring_manager' field
g_form.getReference('hiring_manager', function(reference) {
// Callback function to execute after the reference is fetched
if (reference) {
// Reference is fetched successfully
var hiringManager = reference.email;
alert('Hiring Manager: ' + hiringManager);
// Get the table name of the current form
var currentTable = g_form.getTableName();
alert('Current Table: ' + currentTable);
// Check if the form's category is a specific one and 'new_email' is empty
if (currentTable == 'ni' && g_form.getValue('new_email') === '') {
alert('Inside if condition');
alert('Current Table: ' + currentTable);
alert('new_email: ' + g_form.getValue('new_email'));
// Set the value of the 'new_email' field to the 'hiring_manager' value
g_form.setValue('new_email', hiringManager);
alert('new_email after setting: ' + g_form.getValue('new_email'));
}
} else {
// Unable to fetch the reference
alert('Unable to fetch reference for hiring_manager');
}
});
}
have written this code but still not working
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 06:59 AM
You can use the Cascade variable present in the Order Guide. The following are the steps:
- Check the Cascade Variables checkbox to True.
- Create "Hiring Managers" variable on both Order Guide or Catalog item level (Assuming catalog item already added in the rule base).
- NOTE: The backend name of the variable should be the same on both the Order Guide and Catalog item.
- ALTERNATE: You can create a variable set if you would like to use multiple variables on both the Order Guide and catalog item level. Add the variable set on OG and Item both.
Now whatever you fill on the variable on the Order Guide form, the same will get copied to the variable on the catalog item form. (Because we already marked Cascade Variables as TRUE in step 1)
Thanks!
Please mark this response as correct and helpful if it helps you ✔️👍
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 07:41 AM
@Prithvi Ramesh1 , hope this help to achieve the desire result, please mark as accept solution to close this thread for others.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 06:23 AM - edited 11-14-2023 06:24 AM
Hi @Prithvi Ramesh1 ,
You can configure the "Hiring Managers" field ( or common fields ) at order guide level and set the cascade checkbox, then matching variable will pass the value from "Describe Needs" to "Choose Options".
-Thanks
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 06:45 AM
Can you explain it in more detail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 06:52 AM
The order guide has this cascade option to pass variable value to selected catalog item if variable names are same. let's say, you are the hiring manager and giving your email on order guide level which is the first form under "Describe Needs" then you choose some other selection for catalog item(s) which are already defined under the "Rule Base" , based on selection the catalog item(s) will display and you can complete the form. Here, if the variable name are same in order guide and catalog item then it will show the email ( pre-filled ).
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 07:41 AM
@Prithvi Ramesh1 , hope this help to achieve the desire result, please mark as accept solution to close this thread for others.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution