background script to update user information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 08:59 AM
Table : sys_user
I am trying to run a piece of code , its not working , i would like to get people inputs ,
We need a background script to update the Employee Number for all people with a User Brand = "Beta""
to add "Beta:" as a prefix to the existing Employee Number.
So it should display as " Beta: 25467".
Code :
function addPrefix(){
var gr = new GlideRecord("sys_user");
gr.addQuery('sys_id',"bac617ddd56c8104583a92146e8f872a");
gr.addQuery('u_user_brand', 'Beta');
gr.query();
while(gr.next())
{
gr.user_brand = gr.employee_number.replace('Beta:');
gr.update();
}
}
addPrefix();
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 10:09 AM
Hi Sree,
Can you please see if you see the "correct answer" button now?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 10:17 AM
I logged out and logged in , still i dont see it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 10:18 AM
Can you try with different browser and open the thread in new tab.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 10:45 AM
Opened in a different browser , I GOT THE "Correct answer" button , in the new post ,where I just did . But its not working in this one . Its weird

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 10:45 AM
Thanks Sree for the update. Dan will be helping you out with this request.