- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 12:56 PM
Hi Community,
Good Day!
There is a catalog item have a list collector type and links with Hardware [alm_hardware] and I want to update it's state. if I select one record, it updates the record of the table. But if I select multiple records, these are not updating on Hardware. I want to update multiple records at one time.
this is the list collector:
this is BR on table:
var gr=new GlideRecord('alm_hardware');
gr.addQuery('sys_id',current.variables.show_asset_tag);
gr.query();
if(gr.next()){
gr.install_status=current.variables.state;
gr.update();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 07:49 AM
Oh sorry got it !! we are doing (if(gr.next)) we need to do like this(while(gr.next()))
Please try this :-
var gr=new GlideRecord('alm_hardware');
gr.addQuery('sys_id', 'IN', current.variables.show_asset_tag);
gr.query();
while(gr.next()){
gr.install_status=current.variables.state;
gr.update();
}
if not work then try by replacing 'sys_id' with 'display_name'.
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
Regards,
Ranjit Nimbalkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 07:49 AM
Oh sorry got it !! we are doing (if(gr.next)) we need to do like this(while(gr.next()))
Please try this :-
var gr=new GlideRecord('alm_hardware');
gr.addQuery('sys_id', 'IN', current.variables.show_asset_tag);
gr.query();
while(gr.next()){
gr.install_status=current.variables.state;
gr.update();
}
if not work then try by replacing 'sys_id' with 'display_name'.
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
Regards,
Ranjit Nimbalkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 09:22 AM
thanks, @Ranjit Nimbalka, it works!!!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 08:26 AM
Hi Dear - Can you please share all the steps you followed to set up Service Catalog for multiple asset update using list collector to set retired status.
I would like to replicate same for CI update? I would really appreciate you help!