You need to sign in to do that
Don't have an account?
Ashish Khairkar
Creating primary records for Master-Detail relation
Suppose i have to build follwoing scenario
Two objects A & B have a master detail relationship, A being the master and B can contain many number of records
But only one record in B can be primary to A, say a Primary Flag field exist on B
When i check the Primary Flag of any new record in B, then the primary flag on old record should disappear
Two objects A & B have a master detail relationship, A being the master and B can contain many number of records
But only one record in B can be primary to A, say a Primary Flag field exist on B
When i check the Primary Flag of any new record in B, then the primary flag on old record should disappear
The Nayana's solution is excellent and I would have done the same at work.
There is an alternative "zero code" that programmers never use with an autolaunched flow and a process.
The Flow Designer is a powerful tool of Salesforce but it is little used (zero code but also not easy to "read" and verify without clicking everywhere, I will have to extract all the logic from the metadata for an automatic documentation).
https://help.salesforce.com/articleView?id=process_action_flow.htm&language=en_US&type=0
You can pass the owner ID (reference of A) from the process to the flow.
Salesforce have almost succeeded in "zero code" applications with powerful tools like the flow designer and the process builder but it is little used by the administrators.
Regards
All Answers
The Nayana's solution is excellent and I would have done the same at work.
There is an alternative "zero code" that programmers never use with an autolaunched flow and a process.
The Flow Designer is a powerful tool of Salesforce but it is little used (zero code but also not easy to "read" and verify without clicking everywhere, I will have to extract all the logic from the metadata for an automatic documentation).
https://help.salesforce.com/articleView?id=process_action_flow.htm&language=en_US&type=0
You can pass the owner ID (reference of A) from the process to the flow.
Salesforce have almost succeeded in "zero code" applications with powerful tools like the flow designer and the process builder but it is little used by the administrators.
Regards
... moreover, these tools can rule all the problems of the governor limits automatically (should be verified).
The target audience of the flow designer and is the administrators so they have to rule all the underlying problems of the governor at the same time.
Regards
@Nayana
I tried your code above and its giving me a complie error.
Error: Compile Error: Missing '<EOF>' at 'public' at line 15 column 1
Cant figure out whyhttps://developer.salesforce.com/forums/ForumsMain?id=9060G0000005YwjQAE
Its a straight trigger without any class. It's a primary contact apex code switch over to be used on 2 different objects. If you can help that will be great or send some guidlines over.
thanks