- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 05:20 AM
Hello, I want to know how to copy value from one field to another. It should be automatic for every other entry.
"customer_contact" table, it should copy value from field “email” to “user_name”.
I tried to create BR, but it did not work.
Any suggestions?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 05:24 AM
In business, rules use actions to set the value. (If both are of the same type) as email and user id fields are the different types we need set from the script :
When to run: before (insert,update)
current.user_id = current.email.toString();
Mark correct and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 07:04 AM
Sorry I did misspell field. Now it works like a charm!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 11:05 AM
Is it correct
var val=g_form.getValue('u_short_description');
var array_val=val.split('\n');
g_form.setValue('u_description',array_val[0]);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 11:50 AM
If the user ID is an email address, you could have also done:
current.user_id.getDisplayValue() = current.email;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2023 06:48 AM
Thanks for replying and
for this code am not getting count ,could you please help where have to modified ,am getting number , in count undefined
var ga = new GlideAggregate('incident'); // COUNT ,SUM MIN MAX AVG
ga.addQuery('category','software');
//ga.setGroup(false);
//ga.setCategory(); //set the value of category query
//ga.addAggregate('COUNT','sys_mod_count');
ga.query();
while(ga.next())
{
gs.info(ga.number);
gs.info('COUNT :' + ga.addAggregate('COUNT','sys_mod_count') );
}
