I want to add Info message in Portal view.

JVINAY
Tera Contributor

Hi Team.

I want to add Info message in Poral view.

Currently this message showing in platform view 

JVINAY_0-1744789241870.png

But I want to add this message in Portal view also

Condition : This message should remain display until "CAN PROVISION PROD (u_approved_for_production_provisioning) "box  is checked.

 

Can please help me how to achieve this.

Thank you. 

 

 
28 REPLIES 28

You mentioned that it's configured on the record producer, but I see that you're trying the scripts in the UI policy/client scripts, not catalog UI policy/catalog client script. Please provide complete information; otherwise, it will be difficult to debug.

JVINAY
Tera Contributor

@J Siva ,

my apologies,

I have written below code in Client script , but not working

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    //Type appropriate comment here, and begin script below
    if (newValue.toString() == 'false') {
        g_form.showFieldMsgge('This request is for production only.  In order to proceed with this production-only request, a Cloud Intake admin will need to check the CAN PROVISION PROD box and click save.''info'true);
 
For My requirement 
Can Provision PROD -- False ( Unchecked ) This Info message should appear in the Portal same as Platform view.
In the platform view  Onload client script working well.
kindly help me above code modification.
Thank you.

 

@Ankur Bawiskar 

CAN PROVISION PROD (u_approved_for_production_provisioning) " This field is available in Platform only , not available in Portal view . 

I want achieve by Using Display Business rule and client script. 

if it is possible or not. Please let me know.

If Yes please share example script.

Thank you.

Service_RNow
Mega Sage

@JVINAY 

 

Step 1: Create a New Widget

  1. Go to:
    Service Portal > Widgets

  2. Click New

  3. Give it a name like:
    📝Provisioning Status Message

  4. In the HTML template, use something like:

 

html
CopyEdit
<div ng-if="!data.approved" class="alert alert-warning"> <strong>Note:</strong> This request is not yet approved for production provisioning. </div>
  1. In the Server Script, add:

 

javascript
CopyEdit
(function() { var rec = new GlideRecord('YOUR_TABLE'); // Replace with your actual table name if (rec.get(input.sys_id)) { data.approved = rec.u_approved_for_production_provisioning == true; } else { data.approved = true; // Hide if record doesn't exist } })();

 

  1. In the Client Script, pass the sys_id:

 

javascript
 
function($scope, spUtil) { $scope.data.sys_id = $scope.page.g_form.getUniqueValue(); }

Step 2: Add the Widget to the Form Page

  1. Go to:
    Service Portal > Pages

  2. Search for your record page (e.g., the one used for the custom table)

  3. Add your widget to the top or wherever you want the message to appear


Step 3: Test It

  • Open the form in Service Portal.

  • The message should appear if the checkbox is unchecked, and disappear once it’s checked.

  • Works real-time on load — for dynamic response (live update), you’d need event binding or a g_form script — but this covers most scenarios.
    Hope the answer has helped you, please mark the answer correct/helpful. Thank you.