RE: is this code correct ? plugin code i have written to delete account entity record and create contact record automatically
Hi,
Thank you for your query.
Code is correct or not depends on the requirement. If you can give a little back-ground on the scenario, it would be great.
However, I can see following problems right-away:
- This plugin will only run on Delete (as per you code, if this is as per your requirement it is okay).
- You are creating Contact record without setting any attributes (Like Name, Email etc.). At least set the Name.
To se the name, you can set the attribute:
Contact.Attributes["firstname"] = "John";
Contact.Attributes["lastname"] = "Doe";