How to bundle multiple actions as a transaction using Salesforce API?


How to bundle multiple actions as a transaction using Salesforce API?

At present, the only way to bundle multiple actions as a transaction in SFDC is to put all of them in an APEX method and make it a web service.  But, the problem one may encounter is with the arguments. The arguments tend to get misinterpreted or overlapped at Salesforce end. For example in the following definition webService static String upsertData(string s,Id v, Id[] str)if we pass v as null one of the str values is pushed into v variable. This situation is undesirable and results in unwanted results. So we should define a class defining all the argument we want to pass in a method. And use the class as an argument. This worked perfectly for me.

Solution:
global class xxxxxx{  
  global class yyyyyyy{
        webService Attachment qAttach;        
        webService ABCD[] dsLineItems;
        webService  string[]  deleteIds;
    }

    webService static String upsertData(yyyyyyy dInfo) {
 }

Comments

Popular posts from this blog

Updating SourceData/ Data Source of the Pivot Table

Salesforce.com migration tool - Deploying Weblink and migrating files with special characters

Information Architecture - Setup your term store to scale