Catalog Client script for mandatory fields

Gemma4
Mega Sage

Hi everyone,

If possible can I please get some expertise on what might be causing a conflict with my catalog client script. Attached and below are the details. The script is making the variables required after submit for users with the pm user role in the platform but not the portal. I need the variables required  in both the portal and platform. See attached and below is script 

 

thank you in advance for any feedback you can provide!

 

 

//Karen has the role PM and mandatory fields are not required for her
//PM role also displays visiblity to modules 
//Users with PMSubmitter role will be required to complete Mandatory fields
 
function onLoad() {
 
 
 
 
 
//  if (g_user.hasRole('pmsubmitter')){
//  if (g_user.hasRoleExactly('pmsubmitter')){
if (g_user.hasRoleExactly('pm_user')){
//  g_form.setDisplay('effort_estimate', false);
 
 
//  g_form.setMandatory('business_need', false);
  g_form.setMandatory('business_need', true);
  g_form.setMandatory('effort_estimate', true);
  g_form.setMandatory('objectives', true);
  g_form.setMandatory('key_deliverables', true);
  g_form.setMandatory('key_dependencies', true);
  g_form.setMandatory('assumptions', true);
  g_form.setMandatory('constraints', true);
  g_form.setMandatory('risks', true);
  g_form.setMandatory('out_of_scope', true);
  g_form.setMandatory('workaround_identified', true);
  g_form.setMandatory('resource_requirements', true);
  g_form.setMandatory('estimated_costs', true);
  g_form.setMandatory('project_manager_assignment', true);
 
 
  }
 
 
  else{
 
 
 // g_form.setDisplay('effort_estimate', true);
 
 
//  g_form.setMandatory('business_need', true);
  g_form.setMandatory('business_need', false);
g_form.setMandatory('effort_estimate', false);  
g_form.setMandatory('objectives', false);  
g_form.setMandatory('key_deliverables', false);
    g_form.setMandatory('key_dependencies', false);
    g_form.setMandatory('assumptions', false);
    g_form.setMandatory('constraints', false);
    g_form.setMandatory('risks', false);
    g_form.setMandatory('out_of_scope', false);
    g_form.setMandatory('workaround_identified', false);
    g_form.setMandatory('resource_requirements', false);
    g_form.setMandatory('estimated_costs', false);
    g_form.setMandatory('project_manager_assignment', false);
 
 
 
  }
 
 
 
 
}
5 REPLIES 5

Sunny3008
Tera Guru

Hello @Gemma4 ,

 

Kindly update the UI type to all in the client script.

If we select desktop it will only work on the backend, If we select mobile/service portal it will only work for the portal side or on mobile, and if we select all it will work for both the portal and fulfiller side.

 

Sunny3008_1-1693508793118.png

 

Please mark this as the correct answer and helpful if it is resolved, or mark this helpful if this helps you to reach towards solution.