Loading
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Create the TestReserializeApex Class

          Create the TestReserializeApex Class

          Before you can create the Integration Procedure example, you must create the TestReserializeApex Apex class that it calls.

          1. From Setup, in the Quick Find box, type apex.
          2. Click Apex Classes.
          3. Click New.
            On the Apex Class Edit page, the Apex Class tab is selected and the cursor is at line 1. This is where you paste the code.
          4. Enter the following Apex code in the Apex Class tab:
            @JsonAccess(serializable='always')
            global with sharing class TestReserializeApex implements Callable { 
                public Object call(String action, Map<String, Object> args) {
                    Map<String, Object> input = (Map<String, Object>)args.get('input');
                    Map<String, Object> output = (Map<String, Object>)args.get('output');
                    Map<String, Object> options = (Map<String, Object>)args.get('options');
                    return invokeMethod(action, input, output, options);
                }
                private Object invokeMethod(String methodName, Map<String,Object> input, 
                  Map<String,Object> output, Map<String,Object> options) {        
                    return output.put('result', new TestReserialize());    
                }    
                @JsonAccess(serializable='always')
                global class TestReserialize { 
                    global String name = 'Dave Smith';    
                }
            }

            Also note the use of the JsonAccess annotation on the class and method.

          5. Click Save.
           
          Loading
          Salesforce Help | Article