When user create a new record in table(incident) then how to create same record in anothe table ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 03:18 AM - edited 06-04-2024 05:35 AM
----Create a custom table named cust_incident with two fields (incident_num and state).
----Automatically copy the incident_num and state values from a newly created incident into this custom table?
Steps : --------
Step1 ----
--Navigate to System Definition > Business Rules in your ServiceNow instance.
-- Click on New to create a new business rule.
-- Fill in the necessary fields such as Name, Table (incident), and When to run (insert).
-- In the Advanced tab, paste the above JavaScript code into the Script field.
-- Click on Insert to save the business rule.
Script :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 05:08 AM
What is your question? And please elaborate on the usefulness of a table containing just a number and a state (which makes no sense, because what happens when the state changes?)
Your use case seems to have no valid foundation and I am missing your question. Doesn't it work? What's the issue?
And please: if you create a script, don't use 'gr' as variable. This has become bad practice a century ago.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 03:20 AM
Hi @Mark Manders Actually my question was When user create a new record in a table(any table) then how to copy same record in anothe table and if user changes or update any value in first table then its also updated in second table
how to solve this problem using single script?
N Thanks for guiding....😊
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 04:33 AM
You can take any 'create xxx' ui action from incident to see the code, but my question still stands: what use is it to copy the same info and keep that info synced? You do know that custom tables are licensed? You lack to explain your use case, so your query, at this moment, doesn't make sense.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark