You need to sign in to do that
Don't have an account?
![joseph keuler 1 joseph keuler 1](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Record locked when updating value via Apex when triggered from Process Builder
So I have an Apex method running off the process builder but when I try to update a record via the invoked method it says the record is locked. Perhaps the reason it won’t update is because the process hasn’t completed yet? How can I update a record via Apex triggered from the process builder?
@invocablemethod public static void updateBenefit(list<ea_app__c> app){ app[0].Benefit_Amount__c = calcBenefit(app[0].name); // ----> this is the issue here <---- update app; } public static decimal calcBenefit(string appID){ decimal benefit = 0.0; integer coeff = getCoefficient('2015'); decimal max = getMax(getfamilySize(appID)); benefit = (1-(getIncome(appID)/max))*(getFuelCost(appID)/coeff); return benefit; }
All Answers