Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

existing record validation on String Field

_bhishek
Tera Guru

Hi All,

 

I have an catalog item to create business Application .Business application is inserted after approvals. There is field as application name in catalog item which maps to Name field field of Business application in service now.

I want when user enters any name in Application name field of catalog item which is operation and existing already in service now business application table then user should get an message like "This application already exist " and there should be a Click here Hyperlink which takes to the list view of business applications which should show the applications with  ' name contains what users has entered in Application name string field. '
I tried with Script include and catalog client script(using HTML message) but that message is coming for few seconds and automatically goes and if again enter same name in string field then no message comes .I want like if user enters same name again and again then that message/error should be there with respective Hyperlink and user should be able to close that message/error.

Any pointer would be helpful.

 

Thank you. 

7 REPLIES 7

Aditya_hublikar
Mega Sage

Hello @_bhishek ,

 

 Have you tried g_form.showFieldMessage() method ?

 

example :

 

var link = '/cmdb_ci_business_app_list.do?sysparm_query=nameLIKE' + newValue;

var msg = 'This application already exists. ' +
                            '<a href="' + link + '" target="_blank">Click here</a>';

g_form.showFieldMsg(fiedlName, msg,'error', true);

 

 

 

If this helps you then mark it as helpful and accept as solution.

Regards,

Aditya

I tried with Field message but its not possible for me to show hyperlink on field message .I am getting URL there .

Hello @_bhishek ,

 

Yes in fieldMessage it will give you string . My bad i didnt check that earlier.

I tried you requirnment on my pdi , its working error message remains as it is until we manually cancel it  on native ui . But due to this property glide.service-portal.notification_timeout.seconds

on portal ui errorMessage will get disappear. after 5 sec .

5sec.png

 

Please once check following screenshot :

 

cspt.pngcatItem.pngportal.png

Ankur Bawiskar
Tera Patron

@_bhishek 

unless you share your scripts and screenshots we can't help

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader