function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Riz234Riz234 

Opportunity viewing by other departments

I have a picklist "Department" in Opportunity; If user select one department (eg: Networking) and put amount then save the opportunity, then that opportunity should be viewed only by Networking dept. If the user select GIS dept, then only GIS dept employyes should view this opportunity. How I can do this please ? I have created roles and profiles, fyi.

Please call me +966502486073 or give me your number so that i can call and find the solution. Need urgent help on this please. my email shaik.rizwan@mis.com.sa; I am new to salesforce.

Appreciate early response

Best Answer chosen by Admin (Salesforce Developers) 
Hargobind_SinghHargobind_Singh

Hi,

 

Since you have already created roles, you should go to sharing rules and define sharing rules. Salesforce has recently updated the sharing rules so that you can create sharing rules based on formulae on fields. 

 

1. Make Opportunity as private

2. Create one sharing rule each for your conditions.

 

 

All Answers

Afzal MohammadAfzal Mohammad

I suggest you to use record types and page layouts for each department.

 

More info on record types go to

http://www.salesforce.com/community/crm-best-practices/administrators/customization/advanced-customization/tips-record-types.jsp

 

Hope that helps.

 

Afzal

Hargobind_SinghHargobind_Singh

Hi,

 

Since you have already created roles, you should go to sharing rules and define sharing rules. Salesforce has recently updated the sharing rules so that you can create sharing rules based on formulae on fields. 

 

1. Make Opportunity as private

2. Create one sharing rule each for your conditions.

 

 

This was selected as the best answer
Riz234Riz234

Hi hs1,

 

Thanks for the solution, i tried its working but it is working only for picklist, I want to use multipick list, when iam creating a sharing rule, the multi picklist obeject is not showing to select. Is there any other way.

 

User will select multiple departments for the same opportunity from the multi picklist (or let me know if any work around) and the selected departments should view the opportunity. please help me on this.

Hargobind_SinghHargobind_Singh

hi,

 

Yes, the sharing rules won't work in your case due to multi-select fields. I think Apex Sharing can resolve your problem : 

 

http://wiki.developerforce.com/index.php/Using_Apex_Managed_Sharing_to_Create_Custom_Record_Sharing_Logic

 

But this would require you to write a trigger to parse the multi-select value and create sharing. 

 

 

Riz234Riz234

Hi,

 

I am new to the salesforce, i don't know where to write trigger and how to write (have little idea). could you help on this.