New answers tagged

2

I'd recommend defensively checking your rowcount before attempting to pull values from the results. Also, I try to use the emailaddr system string if I need the email address. It's safer to use in an email send context. %%[ var @email, @lookup, @CaseRow, @Name, @EmailID Set @email = AttributeValue("emailaddr") Set @lookup = ...


0

This question is really old, but still doesn't have an accepted answer, so I'll throw out a solution. I see two possible approaches here: You create some custom checkbox (example below has a checkbox called Assigned_by_Trigger__c) or hijack some other field that indicates that the Lead was assigned via your trigger and have a rule in your Lead Assignment ...


4

Depending on where you get/see/view the error, Salesforce can have a hard time displaying the entire message (because < and > are what xml/html use, and rendering html based on user input all willy-nilly is not a good idea). I suspect the more complete error message is Illegal assignment from List<AggregateResult> to List<Lead> When you ...


0

So, while I don't think there is a way to query for the default Lead Owner (you would expect it to be in the LeadConfigSettings) you could do the following: Take the parent Lead and rerun the Assignment rules on that Lead. This will assign the lead to an active user Query the lead post-assignment rules execution to get the Lead.OwnerId and use for the Task ...


0

The Database.LeadConvert object doesn't magically get all the values from the database. You need to actually query the record. Lead leadRecord = [SELECT OwnerId FROM Lead WHERE Id = :leadId]; if(leadRecord.OwnerId.getSObjectType() == Group.sObjectType) { lc.setOwnerId('XXXXXXXXXXXXXXXX'); }


1

Scheduled flows execute a separate flow interview for every record that meets your entrance criteria so a loop is wholly unnecessary as you will only work with a single record in any flow interview. What I would suggest instead is adding a formula checkbox to your Lead Record that is set to true when Lead.To_be_Deleted__c = TODAY() and then use THAT checkbox ...


Top 50 recent answers are included