- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 10:17 PM
I have a requirement that when an Account is added to a Case, the Primary Contact of that Account is populated in the Contact field of the Case.
I know I need a Business Rule -- but do not know where to start from there.
any help is appreciated.
thanks,
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2018 01:53 AM
Hello,
You can use a business rule with the following condition and script:
Keep in mind that the business rule will only fire when the record is saved.
Also depending on your requirements you may need to handle the cases where there is no primary contact, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2018 01:47 AM
Hi,
Please create the below script as BR with below details:
When : before Insert/Update
Script:
var acc = current.account;
var cc = new GlideRecord("customer_contact");
cc.addEncodedQuery("account=" + acc + "^contact_type=primary");//Replace the code with the field and value which mark the contact as prmiary
cc.query();
if(cc.next())
{
current.contact = cc.sys_id;
}
Regards,
Ram M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2018 01:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2018 09:34 AM
Thank you! This worked great, but yes i would like the Contact to show as soon as i pick an Account. Would I need to use a Client Script then. I read that because its a scoped app i would need to use GlideAjax?
thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2018 06:08 PM
I don't know if you must use an ajax call because you are in a scoped app but it is a best practice anyway to have a responsive interface.
For the cases, you may need to have Business Rule + client script.
The Client script to have the value set immediately when the account is set using the fulfiller interface and the Business Rule for the other cases (service portal/service catalog, list editing).