You need to sign in to do that
Don't have an account?
![HendrataSFDC HendrataSFDC](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Using trigger on A Junction Object to automatically create records coming from two custom objects (as master detailed)
Hello... I need help on how I can accomplish the solution.
Also, Only Deposit records that have Fee records will be created (as both fields are required fields), but I need the solution to be smart enough to only search for Deposit records first, and look for the associated fee records.
(See below for illustration)
Trigger is what I think the correct way of solving my problem. If anyone can give a help or hint on how to get the list records or come up with full solution... very much appreciated...
![User-added image](/forums/servlet/rtaImage?eid=9060G0000005N9W&feoid=Body&refid=0EM0G00000035Lc)
![Deposit and Fee list view](/forums/servlet/rtaImage?eid=9060G0000005N9W&feoid=Body&refid=0EM0G00000035Lh)
- Custom Object 1 = Deposit__c
- Custom Object 2 = Fee__c
- Both Deposit__c and Fee__c are not directly related and each object is related to another custom object called "Permit__c" (kinda like a parent object so called), so I have created a junction object called "Deposit_And_Fee__c"
Also, Only Deposit records that have Fee records will be created (as both fields are required fields), but I need the solution to be smart enough to only search for Deposit records first, and look for the associated fee records.
(See below for illustration)
Trigger is what I think the correct way of solving my problem. If anyone can give a help or hint on how to get the list records or come up with full solution... very much appreciated...