You need to sign in to do that
Don't have an account?
Need some Experts advice
Hi All,
I am writing some complex code for an existing application and that code will be merged into a managed package. Due to the complexity of the project , I have to Query and use DMLs inside a loop. I tried a lot to avoid it but it seems to be the only way. I just want to know if it will pass the security review? It is being used by a Batch Class and the Batch size is fixed from code so error will never come up, but will salesforce allow this ?? Please give me your suggestions.
I am writing some complex code for an existing application and that code will be merged into a managed package. Due to the complexity of the project , I have to Query and use DMLs inside a loop. I tried a lot to avoid it but it seems to be the only way. I just want to know if it will pass the security review? It is being used by a Batch Class and the Batch size is fixed from code so error will never come up, but will salesforce allow this ?? Please give me your suggestions.
As per the Salesforce best practices, the DML operations should be carried out of the loop to avoid the Governor limits. To make dml operations out of loop is to avoid hitting the governor limits and bulkify the code. If your dml operations are inside loop and if you can test your code for bulk operations without any failure then you are good to go.
Thanks,
Pratik
All Answers
As per the Salesforce best practices, the DML operations should be carried out of the loop to avoid the Governor limits. To make dml operations out of loop is to avoid hitting the governor limits and bulkify the code. If your dml operations are inside loop and if you can test your code for bulk operations without any failure then you are good to go.
Thanks,
Pratik
Thanks,
Pratik