Auto-populating the Contact and Account fields on case from record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2023 04:49 AM
Hi All.
We are currently implementing CSM I am looking to get the Contact and Account fields on the case form to be automatically populated with the person who has submitted the case from the record producer. Any idea what the script code would be for these two fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2023 05:06 AM - edited 08-14-2023 05:10 AM
Hi,
You can achieve this using catalog client script. But for that in users profile (sys_user table) contact & accounts fields should be available.
Use g_user.userID() to get the logged in users sys_id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 11:25 AM
Or you can create two variables, one for account and one for contact and in the default value field use
javascript:gs.getUser().getCompanyID() for the account
javascript:gs.getUserID() for the contact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 12:16 AM - edited 03-04-2024 12:17 AM
Hi @cstangoe , @Roman27 and @Akshaymhaske , I have the same requirement with the questions but tried both of your script, they didn't work, any other idea on how to set up?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 02:23 AM
Hi samala830
Just had a look at the record producer script section and we have the following which pulls through the contact and account values on the case table
current.contact=gs.getUserID();
current.account=gs.getUser().getCompanyID()