sn record picker default value to current session user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 10:51 AM - edited 04-30-2024 11:03 AM
Hello,
How do I set the sn record picker default value to current loggedin user in a model on service portal?
I have another sn record picker field which shows location entries. How do I pass the value of the default user and location over to client controller to call a script include?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 11:28 AM
Hi @maryc
for 1st requirement:-
The sn-record picker is bound to an object in the data model. eg. field = "c.caller".
In the client script you define this object
c.caller = {
displayValue: c.data.caller_dv,
value: c.caller,
name: 'caller'
};
Then in your server script, you simply specify the default values - you could get them from the widget options or hardcode them or whatever.
data.caller_dv = [user sys_id];
data.caller = [user display name];
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Ranjit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 11:33 AM
How will the sn record picker in html look?