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
Anil YaduvanshiAnil Yaduvanshi 

Updating a specific value of a picklist from a different field via workflow.

We have 2 objects which are master detail DR and DS. DR is master and DS is child.
There are few fields of DR and DS are shown on a single page via a third party app.
Below are the few fields from DR
  1. Gross Fee
  2. Gross Fee Allocated
  3. Gross Fee Unallocated
  4. And few fields which capture values on the bases of formula.
Fields from DS
  1. S Type
  2. Calculate S By
  3. S Amount
  4. S Percent
“S type” is a picklist and contains 7 values as below
  1. CR
  2. OTT
  3. OTT2
  4. OB
  5. LB
  6. ATE
  7. AT
User get these field created by a trigger in form of a table as shown below. Then he put in some values in different fields “Calculate S By”. “Calculate S By” field is picklist and has 2 values Amount and Percent. If user choose amount from then in the next column he will put the amount and if he choose percent then will put the Percentage.
 
S TypeCalculate S ByS AmountS PercentGross Fee Unallocated
CRAmount10000  
OTTPercent 5 
OTT2    
OB    
LB    
ATE    
AT    
 
Once user save the record the fields in which he has field the information will get update by 2 workflows. Whatever amount is mentioned in the table gets deducted from Gross Fee and shown in a Gross Fee Allocated and remaining amount shows in Gross fee Unallocated. Now the requirement is to fill the value mentioned in Gross fee Unallocated in “AT” field and Gross Fee Unallocated should be 0. I tried workflow however things are not working. Any help or suggestion will be appreciable.
 
RD@SFRD@SF
Hi Anil,

Can you give more details about the work flow
a) Evaluation criteria
b) Rule criteria

I think the order of execution was the issue. The details would be appreciated.

Wishes
RD 
 
Anil YaduvanshiAnil Yaduvanshi
Hi Deepak,

Thanks for responding. Below are the details of the workflows updating the table or different fields.

There are 5 workflows as below, the last one is not working or getting data.
1. DS - S Amount Calc
Rule Criteria : (DS: S TypeEQUALS OB,LB) AND (DS: Calculate S ByEQUALSPercentage)
Evaluation Criteria : Evaluate the rule when a record is created, and every time it's edited
 
2. DS - S Percentage Calc
Rule Criteria : (DS: S TypeEQUALS OB,LB) AND (DS: Calculate S ByEQUALS Amount)
Evaluation Criteria : Evaluate the rule when a record is created, and every time it's edited
 
3. DS - Split Amount Calc
Rule Criteria :(DS: Calculate S ByEQUALSPercentage) AND (DS: S Type EQUALS CR, OTT,ATE)
Evaluation Criteria : Evaluate the rule when a record is created, and every time it's edited
 
4. DS - S Percentage Calc
Rule Criteria : (DS : Calculate S ByEQUALS Amount) AND (DS: S Type EQUALS CR,OTT,ATE)
Evaluation Criteria : Evaluate the rule when a record is created, and every time it's edited
 
Above 4 are working correctly. However the below one is not working correctly.
 
5. DS - Account Team Amount
Rule Criteria : DS : S Type EQUALS AT
Evaluation Criteria : Evaluate the rule when a record is created, and every time it's edited
 
RD@SFRD@SF
Hi Anil,

Correct me if I am wrong, in the first four updates you are trying to update the parent record when the values are set in chid record.

In the fifth one you are trying to update the child record or the parent record. 
This requirement is kind of confusing here:

"Now the requirement is to fill the value mentioned in Gross fee Unallocated in “AT” field"

My question here is from Gross fee Unallocated to AT field or AT field to Gross fee Unallocated?

Note: I understand that you are trying to keep a summarized values of the child records in the parent record. Being a master detail record why dont you try using roll up summary fields.