You need to sign in to do that
Don't have an account?
Akis Athanasiadis
Auto delete records
Hello.
I have a question.I need to create an auto delete process throuch process builder.
I have a custom object "revenues" and a custom object "purchases".Every time i add,create or delete a revenue a record from purchases must be created/updated/deleted.As for now I have accomplished the creation and update process but I cannot find a way to auto delete a purchase record when the relative revenue record is deleted.Can you give me some help with this?
All Answers
You will need to write a delete trigger to accomplish this. How are revenues and purchases related? Which one is the parent and which is the child?
Where did you save your trigger code? It looks like it's not expecting apex code content for some reason. Make sure you go to Setup->Develop->Apex Triggers and you can see your trigger in that list.
As for your update issue, I'd probably need to see your process builder to tell what's going on. Do you mean every child record in the org gets updated? It definitely shouldn't be doing that, it should be updating all the purchase records that belong to the revenue that fired the process builder only (which can be more than one!)
As you can see I am already there but I receive this message.As for the problem with the update of the child record from a specific parent record,I found the solution
It looks like your filename is a .vfp, meaning you're saving it as a visual force page. Go to the dev console, File-> New -> Apex Trigger. Select your Revenue as the object and write that code in there. The file extension should be .apxt.
Hope this helps!