How to know about Portal ID or URL when Record Producer is submitted

CA5
Tera Contributor

Is there any method by which can identify from which Service Portal [IT or HR], record producer is submitted? 

 

 

5 REPLIES 5

Riya Verma
Kilo Sage

Hi @CA5 ,

 

Hope you are doing great.

 

To achieve this, you can follow these steps:

  1. Let's assume you create a new field called "Submitted from Portal" of type "Choice" on the record producer form.
  2. 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