You need to sign in to do that
Don't have an account?
Bola Ola 24
is it possible to enter a parent and child information at the same time before saving the parent and then saving the children records
Good Day SFDC Developers, I am a salesforce admin so a novice when it comes to development.
I have 2 objects A and B, A is the parent of B (master detail relationship). My users want a way of forcing the user to always create at least one child record B, whenever a parent record A is created. Meaning do not allow creation of A without a creation of at one record of B.
How can this be implemented? Suggestions Please.
Is it possible to use LWC and/or visualforce to do this? Can we have a page for the parent record, users enter the fields for the parent record and then by clicking a "Next" button direct users to enter children record(s) for B object and on clicking save from the children B page, it saves parent A first and then saves the children by adding the id from the parent to the children records?
I have 2 objects A and B, A is the parent of B (master detail relationship). My users want a way of forcing the user to always create at least one child record B, whenever a parent record A is created. Meaning do not allow creation of A without a creation of at one record of B.
How can this be implemented? Suggestions Please.
Is it possible to use LWC and/or visualforce to do this? Can we have a page for the parent record, users enter the fields for the parent record and then by clicking a "Next" button direct users to enter children record(s) for B object and on clicking save from the children B page, it saves parent A first and then saves the children by adding the id from the parent to the children records?
You need to write a trigger to accomplish your requirement
Please see with https://salesforce.stackexchange.com/questions/75810/apex-trigger-create-a-child-record-when-a-new-parent-record-is-created for the code You need to customize this according to your requirement.
Related: https://developer.salesforce.com/forums/?id=9060G000000Xca8QAC
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you