How to use setValue into a Table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2015 05:39 AM
Hello everyone!
I have a problem trying to load into an attribute of a table.
I have one table, that has some attributes, and in the "New" form, I want to use a business rule to put a value into a field, so I tried a lot of ways to write the Script that do that, and fill something into that field but I don't know how to do it.
Someone knows how I can make to introduce a value into the field?
Thank you for your time!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2015 06:09 AM
Trust me you don't want to change the "Number" field and its incremental behavior.
However, I understood with the example provided by you.
You got number of fields on incident form.
You want to fill those automatically(with some planned values) while creating the incident.
This can be fairly achieved by writing glide script and set return value to respective field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2015 05:57 AM
Hi Daniel,
You can glide the table, and based on your requirment, which field want to update u can, Please find the below example.Here m updating the workflow activity field.
//Update the workflow Activity
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval',current.sys_id);
gr.query();
while (gr.next()) {
var activity = gr.getValue('u_workflow_activity');
if(activity== null){
gr.setValue('u_workflow_activity','CAB Approval');
gr.update();
}
}
Regards,
Prakash Ranjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2015 06:13 AM