Skip to main content

Questions tagged [trigger]

A trigger is a feature of the Salesforce platform consisting of Apex code that executes before or after DML operations.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
12 views

Trigger automation when row added to Data Extension (without external API)

I want to trigger an automation when a new row is added to a Data Extension. I can trigger it via the API, but building this trigger inside the Marketing Cloud would be much better because otherwise, ...
Disasterkid's user avatar
-1 votes
1 answer
46 views

How to remove child lookup which is populated on parent when the associated child is deleted

On the account object we have a contact lookup field We have multiple contacts as a related list on accounts right When we delete the contact record/ update the account on contact record, if it's ...
training sfdc's user avatar
-1 votes
0 answers
19 views

How to update when Lead is updated, insert related Individual(lookup standard), then update Lead with related Lookup individual on lead

I have a after update trigger on lead, so when the triggering fields like Name,Birthday are updated, the trigger fires and inserts related individual record where there is a lookup from Individual to ...
Janardhan Kumar's user avatar
0 votes
2 answers
34 views

Trigger to update mailing address of contact record when billing street of account record is updated no compilation error but contact not updating

public static void UpdateBillingAddress(Map<id, account> MapOFBillingAddresses) { list<contact> ContactBillingAdressUpdated = new list<contact>(); set<id> ...
tanishq vyas's user avatar
0 votes
0 answers
44 views

Before Trigger on User also firing as an After Update Event

I have a before trigger on user which checks if a checkbox is selected and assign a manager if user's team matches another user's. The issue is that the trigger should only run on before insert or ...
soumya khandelwal's user avatar
1 vote
1 answer
84 views

Does Salesforce Pro Suite allows you to do apex?

I have been looking for this answer, but can't find it. Do you guys know if you can create apex classes or triggers in salesforce Pro-Suite?.
RProgrammer's user avatar
0 votes
1 answer
57 views

Test Class for the Apex Class? In above I am calculating time spent by record in each stage? I tried writing test class but unable do test coverage? [closed]

In the below, I am calculating time spent by the record in each stage. I tried writing test classes but was unable to do test coverage. trigger Approval_Agreement on Approval_Agreement__c (before ...
sfdcram's user avatar
1 vote
2 answers
92 views

Bypass flow and apex triggers when executing DML on batch apex

I am thinking of a way to bypass triggers from both Flow and Apex when I execute the DML statements on my batch class. Framework setup: I have a Hierarchy Custom Setting that has checkbox fields per ...
Dave's user avatar
  • 11
-1 votes
0 answers
35 views

Update Lead Status from "New" to "Contacted Prospect" Based on Email Activity Using Apex Trigger [closed]

I'm looking to update the status of a Lead from "New" to "Contacted Prospect" when an email is sent or received. Detect when an email is sent or received related to a Lead. Check ...
Marc's user avatar
  • 1
1 vote
1 answer
26 views

Creating a trigger that throws error if any contain email is used in lead record. Getting iisues in code [closed]

public class LeadTriggerHandler { public static void CheckEmailExistinLead(list<Lead>ListofLead) { map<string,contact>ListOfMapRecords=new map<string,contact>(); ...
tanishq vyas's user avatar
0 votes
1 answer
27 views

Duplicate Job (or Apex or Flow) - before Merging records, Archive original records as Historical Data

We have a Screen Flow that can allow User to enter a duplicate PersonAccount record. Our User is non-technical and we do not want to prevent the User from creating a duplicate record by mistake. Can I ...
Ryan McNeely's user avatar
0 votes
1 answer
37 views

I am trying to write a trigger on opportunity that will create order and order item on opportunity update event but facing issue

here is the senerio" when an Opportunity is closed as "Won", the trigger should automatically create a new Order and populate it with Order Line items based on the products and ...
Gaurav Joshi's user avatar
0 votes
0 answers
25 views

How to grant permission to Deactivate and Active ApexTrigger via API

How do I use the REST API to update an Apex Trigger? vctqs1@Thus-MacBook-Pro erp-salesforce % curl -s -X PATCH -H 'Authorization: Bearer <Token>' -H 'Content-Type: application/json' --location ...
vctqs1's user avatar
  • 95
0 votes
1 answer
76 views

Why Rich-Text Image URL not getting updated in record?

Why before Insert or Update doesn't update the RichText Image URL? To Replicate New Field: Created a new RichText field in case object 'Comments__c' Take a screenshot and paste the image field. ...
Ragul's user avatar
  • 541
-1 votes
0 answers
23 views

How to get value of chat started from body to field value by using trigger

public with sharing class LiveChatTranscriptTriggerHandler { public static void onBeforeUpdate(List<LiveChatTranscript> newTranscripts) { for (LiveChatTranscript transcript : ...
Siriporn Mendi's user avatar
0 votes
3 answers
76 views

How to find the max amount of an opportunity without using aggregate result in apex trigger?

Trigger Handler: public class oppHandler { public static void updateoppName(List<Opportunity> oppList,Map<Id,Opportunity> mapoldOpp) { Set<Id> accIds=new Set<...
Sridhar's user avatar
  • 61
0 votes
0 answers
21 views

Platform Events and NetSuite [duplicate]

I want two way sync with NetSuite with realtime data updates. I feel that Platform Events will be the best solution for this but I am curious how authentication works when publishing to them. Also ...
Olivia's user avatar
  • 3,471
0 votes
0 answers
32 views

Can one roll-up summary field update a records before the other updates?

I have two roll-up summary fields that calculate the number of keywords on a project. The first field is calculating the total number of keywords and the second calculates the number of specific ...
Dan Kowalski's user avatar
-2 votes
1 answer
46 views

I have written a apex trigger on task and want a test class code [duplicate]

if (Trigger.isInsert || Trigger.isUpdate) { for (Task t : Trigger.new) { if (t.WhatId != null && t.WhatId.getSObjectType() == Opportunity.SObjectType) { oppIds.add(t....
Apple Ipad's user avatar
1 vote
1 answer
70 views

Variable does not exist compile error

I am running into the good ol' variable does not exist error while creating a simple trigger on the case object. As other posts here have suggested, I've checked for a class with the same name as Case ...
John Gilani's user avatar
0 votes
1 answer
36 views

Custom Error Message on ContentDistribution Object in Apex Trigger

I am trying to create a apex trigger on contentdistribution object by following this documentation and added a logic to throw a custom error message as 'This file is not allowed to be delivered.' but ...
Loki_72's user avatar
2 votes
2 answers
71 views

Apex Trigger Not Firing - Debug Logs Empty

I'm trying to troubleshoot a trigger on the Account object but the debug logs are not showing any entries. Here's what I've done: Created a new trigger named "BeforeInsertTrigger" on the ...
Teacher Lemon's user avatar
0 votes
1 answer
50 views

Is there a way to make production creation required/mandatory when user is creating opportunity?

When user is creating a new opportunity can we make it mandatory to add a new product. I know about "Opportunity Settings" on setup that we can use to prompt "add products to ...
Ajit's user avatar
  • 19
0 votes
0 answers
30 views

Is there a way to trigger a Product Rule evaluation when a Quote Line record is deleted?

tl;dr - Can apex triggers or another automatic process be set up to fire CPQ Product Rules when a Quote Line record is deleted? Background Our org has Product Rules set up that add certain products to ...
Jwok's user avatar
  • 789
1 vote
1 answer
105 views

Where to see triggers in Visual Studio Code

I have a few triggers that I can see in the Developer's Console. I cannot find them in Visual Studio Code. I am looking for guidance as to where I should see them. I am in the Org Browser feature ...
Michele Kleinhomer's user avatar
0 votes
0 answers
24 views

Code Coverage on Platform and Change Events on External Object

I am getting 0% code coverage on a test class for a platform event/change event apex trigger to trigger from an external object. In the sandbox, the code coverage is 100% but when I try to push it to ...
Donna Taylor's user avatar
-1 votes
1 answer
26 views

How to create an Apex Class or Triggers in professional edition + API, already integrate with JIRA

I Want to achieve this automation - When any opportunity goes to Need Analysis stage, then it will automatically create a JIRA ticket on Jira Projects. For that i need a trigger in professional ...
Chirag Taneja's user avatar
2 votes
0 answers
51 views

Content Version before trigger data inconsistency issue

I have a before update trigger on content version to update the data of notes object in apex . It is working sometimes but sometimes in the before update the new updated value is not showing . For now ...
NewBaySales's user avatar
0 votes
1 answer
37 views

create the location records when the Account is created and the “Number of Locations” field has some value in it

Prerequisite Create a Custom Object and Name it Location. Relate this location object with Account using Lookup relationship. Create a field on Account “Number of Locations” of type Number Develop a ...
anonymous_falcon's user avatar
1 vote
0 answers
53 views

Populate "next review date" knowledge article field

How does everyone utilize the "next review date" field to automatically send an email/alert etc. to article owners? I have been trying to use record triggered flow to populate next review ...
PDitta's user avatar
  • 11
0 votes
0 answers
26 views

NPSP - Error while clearing batch reference in data import

When trying to clear the batch reference in a data import, I am getting this error Error saving record: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: npsp.TDTM_DataImport: execution of AfterUpdate caused by: ...
Ali Marzouk's user avatar
0 votes
0 answers
60 views

Assigning OwnerID to Task in Test

When creating tasks in test I am unable to assign an Owner ID (user) - insert task fails with cross reference error. // Create a Task record System.runAs(systemAdmin){ Task task = new Task(); ...
Jack F's user avatar
  • 1
-1 votes
1 answer
88 views

DML operation Insert not allowed on Survey in the test class

I'm creating a test class for the Survey objects like: Survey, surveyResponse, surveyQuestion, and SurveyQuestionResponse. getting an error: DML operation Insert not allowed on Survey and for all the ...
Mohammad Arbaz's user avatar
0 votes
1 answer
57 views

Salesforce Trigger Not Calling Marketing Cloud API on Contact Delete

I'm trying to set up a trigger in Salesforce to automatically delete a contact in Marketing Cloud (MC) whenever a contact is deleted in Salesforce (SF). What I've Done: Followed the instructions on ...
Teacher Lemon's user avatar
0 votes
1 answer
30 views

Error while updating Lookup field on Case recprd after insert from Web-to-Case form

I'm trying to update the lookup field (Account ID) using the trigger after inserting the Case record by using the Web-to-Case form. But it is throwing the error "FATAL_ERROR|System.FinalException:...
RKCY's user avatar
  • 323
0 votes
0 answers
39 views

Feasibility and what tools should be put in place for this functionality?

Good morning, I have been asked for a new feature but I am not sure of its feasibility We have a call center that uses Aircall (In Lightning Experience) I was asked that when a colleague picks up a ...
arnaud's user avatar
  • 106
1 vote
2 answers
78 views

Create Trigger to conditionally before inserting new records, criteria below

I am trying create a Trigger in my Salesforce Org, where I want to create a new record in an object only if no records already exists, and if records already exist then the end date should be null. If ...
Madan Nanoopillai's user avatar
2 votes
0 answers
56 views

I'm not able to catch null pointer exception using error log object

I have created one custom object called ErrorLog__c and I have created some custom fields like: Error_RecordIds__c Error_Message__c Error_Stack_Trace__c JobId__c My trigger code: trigger ...
Sridhar's user avatar
  • 61
1 vote
1 answer
138 views

No way to notify a user when they are added as a case team member?

I am blown away that this seemingly simple functionality is missing - There is no simple way in setup to send an email to a member after you add them to a case team. I was resigned to doing a more ...
Chris's user avatar
  • 61
0 votes
2 answers
41 views

How to exclude a related object type from validation rule

I have an Object called 'Program' which is creating/inserting a Task record. On the Task I have a validation rule for a specific profile which is blocking the creation of Program indirectly through a ...
Niklaus's user avatar
0 votes
0 answers
48 views

Donorbox and Salesforce Integration

I am writing to request guidance on exporting data from DonorBox to Salesforce Sandbox. I found the source of the errors are "With a lot of triggers and classes within NPSP, you can 'turn off' or ...
Smita Ugale's user avatar
0 votes
1 answer
42 views

My Opportunity Test Class is not calling the Opportunity Trigger that executes Opportunity Trigger Handler Class with Helper Class

I implemented the Trigger Framework. This is my Opportunity Trigger trigger OpportunityTrigger on Opportunity (before update, after update, before delete{ new OpportunityTriggerHandler().run(); } ...
raghavendra yadavalli's user avatar
0 votes
1 answer
69 views

FIELD_INTEGRITY_EXCEPTION - Price book entry is inactive

I have a custom lightning component button with trigger on the Opportunity object, which clones the existing Opportunity and associated Quote record. At the moment, we cannot clone Opportunities where ...
Sophia's user avatar
  • 35
1 vote
1 answer
57 views

Getting error while implementing the trigger dispatcher architecture

when I am writing implementing class, I am getting the error Error: Compile Error: Class signingFormHandler must implement the method: void ITriggerHandler.initialize(String) at line 1 column 14 ...
Kumar's user avatar
  • 23
2 votes
1 answer
40 views

How does `EventBus.TriggerContextsetResumeCheckpoint()` work?

I'm currently looking at the "Apply Best Practices for Writing Platform Event Triggers" Trailhead where EventBus.TriggerContext.setResumeCheckpoint() is apparently used to set "...
Brian Kessler's user avatar
0 votes
1 answer
31 views

Advice on approach to powering journeys in SFMC

Full disclosure, I am a Marketer who has mainly been working with SFMC but now have our data in Salesforce and are looking at creating a number of journeys in SFMC based on the SF data. I have written ...
Matt Black's user avatar
0 votes
1 answer
35 views

Update EndDate by calculating through start date +duration(picklist field)

I wanted to updated the End date whenever the start date is update and it should always calculated the end date as below End Date = start Date + warranty duration field. the issue here is warranty ...
Puja's user avatar
  • 13
-2 votes
1 answer
57 views

Get Distance between 2 records [closed]

Get Distance between 2 records while creating the record in lead object lead assign automatically near owner base upon zipcode anyone have Apex logic how to create the logic? for(Lead ld:[Select Id, ...
sfdcCoder's user avatar
-2 votes
1 answer
56 views

I've tried writing a trigger for this, but I'm having trouble. Please help me out [closed]

Trigger RatingPopulate on Opportunity(after insert, after update) { OpportunityHandler.RatingPop(trigger.new); } Apex Handler public class OpportunityHandler { public static void ...
Arati's user avatar
  • 1
-1 votes
1 answer
46 views

Display total in headline bar, is a trigger my only option despite being read only?

The goal is to add a total to the headline bar in the Accounts layout. I will be using the Account object and from there it will need to pull "Total" from a custom object. The custom child ...
Unknown_Person's user avatar

1
2 3 4 5
160