You need to sign in to do that
Don't have an account?
Walid
Calling an Apex method from a Flow fails!
Hi there,
I built a Visual Flow that finishes with calling an Apex method. The Flow is being launched from the Field Service Lightning mobile App, but when it tries to execute the Apex method, it fails with the error:
Here is how I am calling the method from within the flow:
And here is the code of the method:
Any suggestions?
Thanks!
I built a Visual Flow that finishes with calling an Apex method. The Flow is being launched from the Field Service Lightning mobile App, but when it tries to execute the Apex method, it fails with the error:
Error uploading: Irresolvable failure. Invalid Action Type: AP03c_sendToZuoraListThe Flow is a simple one that does some changes to the Work Order Line Item, and the last action is to call this method.
Here is how I am calling the method from within the flow:
And here is the code of the method:
public class AP03c_sendToZuoraList { @InvocableMethod public static void SendToZuora(List<id> opportunityidList) { Id opportunityid = opportunityidList[0]; List < zqu__Quote__c > zquotesList = [SELECT id, zqu__Opportunity__r.accountId, name, zqu__Customer_Acceptance_Date__c, zqu__Service_Activation_Date__c, zqu__SubscriptionName__c, zqu__BillCycleDay__c, zqu__ZuoraSubscriptionNumber__c FROM zqu__Quote__c WHERE zqu__Opportunity__r.id = : opportunityid]; List<zqu.zQuoteUtil.ZBillingQuoteCollection> quotes = new List<zqu.zQuoteUtil.ZBillingQuoteCollection>(); zqu.zQuoteUtil.ZBillingQuoteCollection quote = new zqu.zQuoteUtil.ZBillingQuoteCollection(); quote.sfdcAccountId = zquotesList[0].zqu__Opportunity__r.accountId; // SFDC CRM Account ID quote.quoteRequests = new List<zqu.zQuoteUtil.ZBillingQuoteRequest>(); for(zqu__Quote__c quoteToSend : zquotesList){ zqu.zQuoteUtil.ZBillingQuoteRequest req = new zqu.zQuoteUtil.ZBillingQuoteRequest(); req.sfdcQuoteId = quoteToSend.Id; // SFDC Quote ID quote.quoteRequests.add(req); } quote.zAccountId = 'new'; // Zuora Billing Account ID quotes.add(quote); List<zqu.zQuoteUtil.zBillingResult> results = zqu.zQuoteUtil.sendToZBilling(quotes); for ( zqu.zQuoteUtil.zBillingResult result : results ) { System.debug('Result: QuoteId = ' + result.sfdcQuoteId + ', Success = ' + result.success + ', message = ' + result.message ); } } }
Any suggestions?
Thanks!
Workaround would be to use Platform Events to kick off the method.
Regards,
Walid