- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2022 09:00 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 02:08 AM
You need to add some query if you want to update existing record.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('u_table_1');
gr.addQuery(); // eg. gr.addQuery('fieldName', 'value');
//gr.addQuery('active', true); // eg
gr.query();
//gr.insert(); // use this line if you want to create new record
while(gr.next()){
gs.log(gr.u_table_2); // here use gr.fieldName
gr.fieldName = 'value';
gr.update(); // to update the record matching your query.
}
})(current, previous);
Note: replace fieldName as per your column/field names in your tables.
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2022 10:46 PM
Glad it worked for you.
Can you please mark my answer as correct and close this thread for others.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 09:26 PM
hlw sir i need your help for this:-
Create a button called Populate on Incident form clicking on which, the Short Description of that Incident gets prepend with the word “AUTO-TEXT: ”. The button should only be visible once the Incident record is submitted.
Create an action called get sysID in List Context Menu of Incident Table. Clicking this should show an alert with the list of sysIDs of the selected records.
I have made both the buttons but they are not working
script is:
for get sysID:
function contextMenu() {
var get_sysID = current.getUniqueValue();
alert("sysID of the selected records is = " + get_sysID);
}
for populate :
function getShortDescription(){
g_form.setValue('short_description' + 'AUTO TEXT');
}
is this script write or not?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2022 03:56 AM
I am a bit confused here. I have given an end to end steps on what you need to do to achieve your requirement and once you confirmed that it is working for you , I asked you to mark my answer as correct which you did and now I see it's been changed.
Did you accidentally marked the other answer as correct?
I also do not see a follow up question related to the one mentioned in the subject of this thread except this as below:
For this will suggest you to open a new thread in community and please review if you have marked the appropriate response as correct or not in this thread for other.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2022 04:16 AM
in this the answer to the question i have asked earlier is correct: but i am asking you about one more problem, how will i script it?
Create a button called Populate on Incident form clicking on which, the Short Description of that Incident gets prepend with the word “AUTO-TEXT: ”. The button should only be visible once the Incident record is submitted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2022 02:53 PM
What if there are multiple child tables? For example, if you select a value from a dropdown, say value 1, a ticket in child table 1 is created. If you select dropdown value 2, a ticket in child table 2 is created, etc.?