Auto populate the current users laptop in a catalog item

Moedeb
Tera Guru

I have a reference field on alm_asset and I just want to show in that field (on load) the current users assigned laptop.

So for us laptops all have a model category of 'Computer', so I'd tried to set the default value of the field as follows:

Variable name: vs_laptop_asset_number

Table: alm_asset

Asset model category 'Computer' sys_id: 81feb9c137101000deeabfc8bcbe5dc4

Asset assigned user field name: owned_by

 

Default value:

javascript:model_category=81feb9c137101000deeabfc8bcbe5dc4^owned_by=gs.getUserID();

 

This obviously has not worked as I'm asking all of you for some help please

1 ACCEPTED SOLUTION

@Moedeb 

 

In that case, you can may be populate the asset owned as per the asset table in one variable which could be read only and have a confirmation checkbox stating "Does the above listed asset does not belongs to you ?". If the user response is yes, you can have a variable for them to select the asset.

 

Let me know your thoughts on this and we can further work it towards closure.


Please mark this response as correct and helpful if it assisted you with your question.

View solution in original post

24 REPLIES 24

@Juhi Poddar ok thank you, I have deleted the other script include and am creating a new one, with client callable = true at the time of creation. It is now prompting for "Select a user role" - Select a user role for Access Control on this Client Callable Script include.

 

Which should I select?

You can for now put snc_internal

@Omkar Mone for whatever reason the snc_internal role is not available to select.

Ohh that means you dont have CSM related plugin. It's okay, no need to give any role to start, just see if it works. There is a property called 'glide.script.ccsi.enable_acl_create_ux' which you can set to false so that it will not show the pop up. Later you turn it on and select the right role in. But make sure we turn it on as its related to Instance hardening.

@Omkar Mone also don't have the system property for 'glide.script.ccsi.enable_acl_create_ux' or anything even close to that name