How to debug the following code to determine why Leads are not being created. Lead l = new Lead(Name = ‘A’); Database.insert(l, false); How should the code be altered to help debug the issue?
Try using Try Catch so that any exception will fall into the catch block and you could check why the insertion failed . For e.g. in your code the below exception is coming:
Therefore please also add the required field Company .
Try using Try Catch so that any exception will fall into the catch block and you could check why the insertion failed .
For e.g. in your code the below exception is coming:
Therefore please also add the required field Company .
Hope this is helpful.
Thank you.