How to know about Portal ID or URL when Record Producer is submitted
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 01:33 AM
Is there any method by which can identify from which Service Portal [IT or HR], record producer is submitted?
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 03:13 AM
Hi @CA5 ,
Hope you are doing great.
To achieve this, you can follow these steps:
- Let's assume you create a new field called "Submitted from Portal" of type "Choice" on the record producer form.
In the record producer's client script, you can add the following code to determine the Service Portal:
function onSubmit() {
var currentUrl = window.location.href;
// Check if the URL contains the IT Service Portal identifier
if (currentUrl.includes("/sp?id=it_service_portal")) {
g_form.setValue('submitted_from_portal', 'IT');
} else if (currentUrl.includes("/sp?id=hr_service_portal")) {
g_form.setValue('submitted_from_portal', 'HR');
}
// Continue with the submission
return true;
}
5.After adding the client script, go to the record producer form and configure the "Submitted from Portal" field to be visible and editable.
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma
Regards,
Riya Verma