Hot answers tagged

5

StepsAndWorkitems is not a type, it is a child relationship name for ProcessInstanceHistory, so type should be ProcessInstanceHistory and not StepsAndWorkitems. Excerpt from the salesforce documentation The nested query references StepsAndWorkitems, which is the child relationshipName for ProcessInstanceHistory in the ProcessInstance object. You ...


3

You can use queueable apex. If the callout fails then chain the same job by using system.enqueueJob method. Below is the way how you can do a callout from queuable apex, you have to implement Database.AllowCallouts interface. public class myClass implements Queueable, Database.AllowsCallouts { public void execute(QueueableContext context) { //your ...


3

Lets say String str = 'item1, item2, item3'; Then you can convert above into list by doing: List<String> mylist = str.split(', '); mylist will have ['item1','item2','item3'] --added-- Another solution to deal with extra spaces: List<String> mylist = str.split(','); for(String st : mylist) st.trim();


2

opp.get(metaData.get(0).Opportunity_Field_Name__c) = opp.Account.get(metaData.get(0).Account_Field_Name__c); The result of opp.get() is not an lvalue; it does not represent a location to which you can assign a value on the left-hand side of an assignment statement. Put another way, it returns a value, but not a reference to the value's location. The ...


2

You're iterating over all Contacts inside our outer for loop for all Tasks. You should be affecting only the related Contact for this Task, which is found via contactMap.get(t.WhoId). (Assuming that the WhoId is a Contact). for(Task t :tks) { If((!t.Subject.contains('DFP sent'))) { for(Contact l : ContactMap.Values()) { ...


2

You can create triggers on external change data capture events from OData 4.0 connections Apex Considerations for Salesforce Connect External Objects Use External Change Data Capture to Track Data Changes on External Objects


2

You're using empty list 'stagelist' for the iteration at line no.10 for( Staging_Event_Attendee__c c : Stagelist){ //your logic to assign } Just replace the StageList with Trigger.New in the for loop, which will iterate the current records for( Staging_Event_Attendee__c c : Trigger.New){ //your logic to assign } Make sure the name one of a ...


2

Your triggers are recursing into one another. Each trigger inserts the other trigger's object, which then runs the other trigger, which inserts the first trigger's object, which runs the first trigger again, and so on until you hit the stack limit. There are two possible solutions here. Code your triggers to check whether they need to take action or not ...


1

The idea is to move logic in the trigger to the trigger handler. To use Trigger.NEW, Trigger.newMap and so on, just pass them as arguments into methods like: public static void processInsert(Map<Id, Contact> newMap) { } Therefore the equivalent of Trigger.newMap will be just newMap, for Trigger.NEW - newMap.values().


1

This is not good code to deploy to your org, and I would strongly recommend you not attempt to do so. It will not work and will likely begin causing problems immediately that will block you from creating Contacts. List<Contact> conCheckList = [SELECT Id,Name,Email FROM Contact LIMIT 10000]; for(Contact con: conList) { if(con.Email != null) { ...


1

As the error says, you're trying to update the opportunity recursively by creating new line items. This happens automatically, as the Amount field has to be updated when adding new line items. No "recursion blocker" will fix your problem, because the update happens automatically by the system. In order to fix the problem, make sure you're only recursively ...


Only top voted, non community-wiki answers of a minimum length are eligible