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
Ankit Garg 117Ankit Garg 117 

Formula / Trigger to calculate products

Formula to calculate Products
Okay, so not sure how to frame this but I will try my best.

So we have a custom object called ''Banners''. (Imagine this as an advertising banner on the websites) see image. In the below image, ''Speciality'' is Cardiologist and ''Location'' is Bondi.

Second image will show you how does ''Banner'' object look like as a related list in my Salesforce instance. 

User-added image
User-added image





Now the condition is - Any opportunity can have Maximum of 3 Banners in combination on specilaity and region. For example - we can only allocate/sell Cardiologist in Bondi Juntion only 3 times. Now this can be allocated/sell to any one Opportunity or 3 different opportunities. 

Currently we maintain a spreadsheet to see what regions are empmty for what speciality. Ideally I want to achieve this from SF that if a user is allocating Cardiologist in Bondi junction (where it has already been allocated in this combination 3 times) user will be alerted. SO he/she will not sell any other Banner. 

Reason - the screenshot is from our website and we can only list 3 banners. 

Any help would be greatly appriciated. 

Cheers