+ Start a Discussion
TilluTillu 

Need idea for this scinario?


User-added image


From the above  the page is "Policy" . we can see policy  (Amount). And from policy related lists we can see "Transaction" object  "Amount"  field and  from "Transfer "  object we see  "Expected Premium"  (All are Marked).

Now,

for a transfer record to update, the match must occur within the same policy record.  Attached is a screenshot of a policy .This would be considered a match. the associated transfer record has an Expected Premium value within 10% of the associated transaction record’s Amount.  A match can only occur if both records (transfer and transaction) are associated to the same Policy ID. If the match occures then I have a checkbox on Transfer record. so it enables to True.

Can we acheive this through formulae or Trigger? If any one pls provide trigger for this scinario.
Sonam_SFDCSonam_SFDC
Hi,

I think this can be acheived by using a trigger on Transfer object - when a new trasfer is created or updated -
1)what you can do is check get the policy ID of this Transfer .
2)From the Policy ID - you can do a query and get the transactions 
3)From these transaction - check to see if any of the amounts match 10% of the expected premium of Transfer - if yes - you can check the box on the transfer object.


TilluTillu
pleae can you give sample trigger?
Sonam_SFDCSonam_SFDC
Hi,

Try going through the following posts which have code snippets of triggers on child object updating parent data and vice versa:
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008yVgIAI
https://developer.salesforce.com/forums?id=906F00000008m96IAA