2

Why would a simple method like

@RemoteAction
global static Custom__c upsertCustom(Custom__c custom){
    upsert custom;
    return [SELECT Id, Name, CalculatedField__c FROM Custom__c WHERE Id = :custom.Id];
}

cause a

Apex Methods Using Collections In Methods Bulkify

warning in the Checkmarx Scanner?

Note: Not sure if it matters, but from the javascript the method upsertCustom is not being called within a loop.

4

Seems like a false positive. In most cases a method that accepts a single record and performs a DML Operation on it might be called in a loop, and hence be considered non-bulk-safe. However, considering this method is a RemoteAction, that concern seems misplaced.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.