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
sssssssssssssssssssssss ssssssssssssssssssssssss s 

Count of group of picklist values possible on another object?

Hi Team,

I am designing my system. The object 1(could be a standard or custom object, not decided yet) is as below,

Object 1

Field 1 --> Picklist
Field 2 --> Picklist
Field 3 --> Picklist
Status  --> Text ( Status is not important while determining count in Object 2)


Object 2
Field 1 --> Picklist
Field 2 --> Picklist
Field 3 --> Picklist
Max count--> Number
TotalCountFrom1--> ??


1) How do I determine the value for TotalCountFrom1 in Object2 from Object 1? Can it be done using out-of-box features of sfdc.com?

2) Whenever a record is added to Object 1 and it makes the TotalCountFrom1 > Max count in Object 2, the status of Object 1 should be set to 'Pending'. When the requestor send for approval process, if approved the Status should be 'Complete' and when rejected the status should be 'Rejected'.
I am planning to use Automation process available in salesforce(Flow Builder) to check Object 2 if TotalCountFrom1 > Max count.

Is the design idea sound? Since the entry in Object 1 is dependent on entry in Object 2 and from point 1 the entry in Object 2 is decided by entry in Object 1, would it lead to a deadlock situation?

Many Thanks in advance!




 
Jay GuruswamyJay Guruswamy
First create Object 2
Then create Object 1
Create a field in Object 1 with with data type Mater detail relationship and refer to Object 2 as parent.

With Master Detail relationship, you can use RollUp Summary fields. Hence Make the Total count From 1, field to be a Roll up summary field and refer to sum of records in Object 1.

Then you can use the workflow and automation for your second requirement.


 
sssssssssssssssssssssss ssssssssssssssssssssssss s
Will the below work?
Object 2
A A A 1 4
A A B 2 2
A A C 9 1

Object 1
A A A
A A A
A A A
A A A
A A B
A A B
A A C

If there is a new record in child table or a record on child table is deleted then would the TotalCountFrom1 on Object 2 get dynamically updated?