Skip to content

Instantly share code, notes, and snippets.

@alexed1
Created March 10, 2019 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexed1/0bf3a4a199baaa23025b5e338fbf5535 to your computer and use it in GitHub Desktop.
Save alexed1/0bf3a4a199baaa23025b5e338fbf5535 to your computer and use it in GitHub Desktop.
global with sharing class GetVehicle {
@InvocableMethod
public static List<Results> getVehicle(List<Requests> requests)
{
Vehicle curVehicle = new Vehicle();
curVehicle.model = 'Tesla';
Vehicle.Wheel curWheel = new Vehicle.Wheel();
curWheel.tireSize = '240/R15';
curWheel.tireBrand = 'Goodyear';
curVehicle.Wheels.add(curWheel);
Results curResult = new Results();
curResult.vehicle = curVehicle;
List<Results> resultsList = new List<results>();
resultsList.add(curResult);
return resultsList;
}
global class Requests {
@InvocableVariable
global String price;
@InvocableVariable
global String modelName;
@InvocableVariable
global String transactionDate;
@InvocableVariable
global String orderTaker;
}
global class Results {
@InvocableVariable
global Vehicle vehicle;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment