Can't find apex class with invocable method in Process Builder on production org. On develop org it works fine.
global class SearchObjectWhenCreate {
global class Request {
@InvocableVariable
public String objectId;
@InvocableVariable
public String searchType;
}
@InvocableMethod
public static void searchObject(List<Request> requests) {
SearchButtonsController searchButtonsCtrl = new SearchButtonsController();
List<verf__VF_Search__c> listOfSearches = new List<verf__VF_Search__c>();
if (Schema.sObjectType.VF_Search__c.fields.Id.isAccessible()){
listOfSearches = [SELECT Id
FROM verf__VF_Search__c
WHERE Name =: requests[0].searchType
LIMIT 1];
}
if(!listOfSearches.isEmpty()){
searchButtonsCtrl.vf_searchId = listOfSearches[0].Id;
searchButtonsCtrl.strObjectId = requests[0].objectId;
searchButtonsCtrl.getObjectInfo();
searchButtonsCtrl.isCalledFromProcessBuilder = true;
searchButtonsCtrl.searchRequest();
request(searchButtonsCtrl.xmlStringxmlRes, searchButtonsCtrl.vf_searchName);
}
}
@future(callout=true)
public static void request(String xmlStringxmlRes, String searchName) {
Http httpProtocol = new Http();
HttpRequest request = new HttpRequest();
HttpResponse response = new HttpResponse();
String body = 'request=' + xmlStringxmlRes;
String endpoint = 'https://viqzrh5hp3.execute-api.us-east-1.amazonaws.com/verified_first';
request.setEndPoint(endpoint);
request.setBody(body);
request.setMethod('POST');
try {
if(!Test.IsRunningTest()){
response = httpProtocol.send(request);
parseXMLResponce(response.getBody(), searchName);
}
} catch(System.CalloutException e) {
}
}
Best Answer
From documentation:
So with global invocable methods and global invocable variables all works on production. Solution was found. Thanks to all!