function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sasidharan Arumugam 15Sasidharan Arumugam 15 

Deletion of records using a flow/process builder/trigger

Hi,

Consider two objects A and B..
B is in the related list of A. 
Assume that there is a record in object B is created with Name (ABC).
So whenever another record is created on object B with Name other than (ABC), i want to delete the record named (ABC).

Could you assist me on setting up this configuration.

Many Thanks !
NagendraNagendra (Salesforce Developers) 
Hi Sasidharan,

The best way to achieve this sort of thing is to write a trigger on Object B. 

Can you please elaborate more, so that we can help you accurately. 
Like when should the record get's deleted? How will you Identify the name of the record that needs to be deleted?

Thanks
Ajeet
ashishashish
hi,
This can be acieved through Process builder. but Process Builder performs  following feature only:
Create a record
Update any related record
Quick action
Launch a flow
Send an email
Post to Chatter
Submit a record for approval 

So there are few cases for which PB dosent work:
Process Builder doesn’t support outbound messages
Process Builder doesn’t allow us to delete a record

for achieving this you need to add a customised fucntionality to your process by calling Apex method.To call an Apex method, add the Call Apex action to your process and select an Apex class with a @invocable method Annotation