New answers tagged

0

Disclaimer: I was bored so I wrote out what I hope is a pretty detailed code sample. This is as far as I'm willing to go however. If you're using Visualforce for your email template per your comments, you want to do something like this: public List<String> appComments {get; set;} Then in the constructor: this.appComments = new List<String>(); ...


0

+Dan's response.. You can use null check before appending it to your string.. String apComment = ''; for(Processinstancehistory p:lispros) { if (string.isNotBlank(p.Comments)) { apComment +=p.Comments; } } or you can create a list of comments and use string.join as suggested.. String apComment = ''; List<String> comments = new List&...


0

I'd recommend using String.join() instead of trying to handle the concatenation yourself. This really goes for anything where Salesforce provides us with standard logic they've built themselves. It saves us time, is probably better-written, and is almost certainly better-optimized.


0

Your best bet is to create an apex method that's invocable from LWC that will start the approval process, then you can call that method to kick-off the approval.


0

Did you try using priorvalue to check what it was before and what it is now? Something like this should work for the entry criteria where you check if it used to be 4 and if it is now 3,2,1. PRIORVALUE(ISPICKVAL(Forecast_Category__c, "4") && ( ISPICKVAL(Forecast_Category__c, "3") || ISPICKVAL(Forecast_Category__c, "2") || ISPICKVAL(...


Top 50 recent answers are included