All Case from same account

Sandeep Bharate
Tera Contributor

HI all,

We have requirement where,

All cases created for same accounts are currently accessible by sn_customerservice.customer_admin (Customer Admin) role.

But customer want users with sn_customerservice.customer (Customer User) role also have access to all cases created for his account. (at least read level). 

How can i achieve this...

 

Thanks in advance.

 

1 ACCEPTED SOLUTION

ChanakyaMekala
Kilo Guru

On Case table we have a before query business rule called "Case query for Customer" which will be governing the cases that have to be accessed and presented to the CSM users. If you want the users with role sn_customerservice_customer should also able to access the cases of their account, then update this BRule as below

 

(function executeRule(current, previous /*null when async*/) {
if(gs.hasRole('sn_customerservice.customer')&&!gs.hasRole('sn_customerservice.customer_admin')&&!gs.hasRole('sn_customerservice.partner')&&!gs.hasRole('sn_customerservice.partner_admin'))

current.addQuery("account",gs.getUser().getCompanyID());

else

new global.CSQueryBRUtil().addCaseQueryBR(current);
})(current, previous);

 

This will definitely work.

 

Please mark 'Correct' or 'Helpful' if it is so

View solution in original post

13 REPLIES 13

Community Alums
Not applicable

Hi @Chanakya 

I have a similar issue.

On Portal, a contact can view only cases created by themselves but not created by others(agents/proxy contacts/customer admins) on behalf of contacts.

For ex: 'Test Contact' can able to see his cases which were created by him. where as 'Test Agent' has created couple of Cases on behalf of 'Test Contact', but 'Test Contact' unable to view these cases created by 'Test Agent' on behalf of him.

Could you please suggest me a solution?

blanca12
Mega Contributor

function executeRule(current, previous /*null when async*/) {
if(gs.hasRole('sn_customerservice.customer')&&!gs.hasRole('sn_customerservice.customer_admin')&&!gs.hasRole('sn_customerservice.partner')&&!gs.hasRole('sn_customerservice.partner_admin'))
current.addQuery("account",gs.getUser().getCompanyID());
Subway Surfers Psiphon Hill Climb Racing 

Misael1
Tera Contributor

Hi,

Reviewing the comments, I saw that there is a business rule (Case query for Customer) as Chanakya mentioned. But it's a little weird that we have to modify the BR to allow show the cases to some users. Reading a little more into the documentation, the needed role is sn_customerservice.customer_admin

The documentation inside the BR says:

/**

Update below query for user with customer role

1) User with "sn_customerservice.customer" role :-
- All cases where contact is me
I.e (contact=<login user id>)

2) User with "sn_customerservice.partner" role :-
- All cases where contact is me
- All cases where partner_contact is me
I.e (contact=<login user id>) OR( partner_contact=<login user id>)

3) User with "sn_customerservice.partner_admin" role :-
- All cases where contact is me
- All cases where partner is my company
- All cases on from my company hierarchy
- All cases for accounts from contact relationship
I.e
(contact=<login user id>) OR (partner=<my account>) OR ( account.account_path=<my account path>) OR ( account IN <all account from my contact contact relationship>)


4) User with "sn_customerservice.customer_admin" role :-
- All cases where contact is me
- All cases on from my company hierarchy
- All cases for accounts from contact relationship
I.e
(contact=<login user id>) OR ( account.account_path=<my account path>) OR ( account IN <all account from my contact contact relationship>)
*/

 

So, we just had to add the role and create a "Contact relation" and that's it.

 

We were using some auxiliary usersto allow them to see all the cases of his account cases.

find_real_file.png

sherrijc123
Kilo Explorer

Helpful Thread!