- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 02:33 AM
Hi,
I am having one business rule to check the serial number entered, if the serial number already exists for another asset in the list then the insert action for the new record will abort and should display the error msg with the asset name whose serial number matches with the newly entered serial number. But I am unable to get the asset name value here in error msg. Script is mentioned below:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 02:46 AM - edited 09-27-2023 02:49 AM
Hi I can see the comma (,) after single code ('). remove that and need to use gr.display_name to retrieve existing asset name
gs.addErrorMessage('Duplicate serial number found. Please enter the unique value', +current.display_name.getDisplayValue());
to
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 02:44 AM
Your script looks okay, what table is this BR on?
Just make sure there is a field on that table called 'display_name'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 02:46 AM - edited 09-27-2023 02:48 AM
Hi @PriyaRaj
Change the line to because the , should be before the '
gs.addErrorMessage('Duplicate serial number found. Please enter the unique value' + current.getDisplayValue('display_name'));
Please mark my answer helpful and accept as solution if it helped you 👍✔️
Anvesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 02:46 AM - edited 09-27-2023 02:49 AM
Hi I can see the comma (,) after single code ('). remove that and need to use gr.display_name to retrieve existing asset name
gs.addErrorMessage('Duplicate serial number found. Please enter the unique value', +current.display_name.getDisplayValue());
to
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 03:37 AM - edited 09-27-2023 03:51 AM
Hi Harish,
It is working with your suggestion.
Thank You