A trigger is an apex code, that can be executed before or after DML operations

learn more… | top users | synonyms

0
votes
1answer
14 views

Assigning a Predefined Case Team to Case in a Trigger [on hold]

How can I assign a predefined Case team to a Case if certain conditions are true in an Apex Trigger?
1
vote
3answers
18 views

Populate contact lookup field when Email field is matching with another object

I am going to write a trigger on the Associated Market object. This trigger will use the email address on the Associated Market record and look for a matching email address on the contact record. If a ...
2
votes
2answers
26 views

How do I scalably run Apex after a small delay so that all related objects exist?

I'm trying to run Apex code that runs a little while after custom objects are created. The problem is that I have a few systems inserting and updating data when a customer places an order in an ...
0
votes
1answer
12 views

Collecting attendees onto Event Object

I want to collect the Attendees of events on to a custom text field on the Event object. I am running into issues collecting the names via the Event Relation. trigger EventAttendeeCollector2 on Event ...
0
votes
0answers
10 views

Update Asset field from associated/related Cases fields

I want to update an asset field based on the same field in its related case(s). The field is multi-select and it tracks specific repairs done to the Asset. Example situation: When an Asset is ...
1
vote
1answer
24 views

Why does trigger create two projects in production but not in sandbox?

I've created this trigger to create a project upon an opportunity being closed won. In our sandbox the trigger is performing properly. However, in production it is creating two projects for one ...
3
votes
1answer
15 views

Queueable Execution Time Limitation

I've got a trigger on opportunities (after update) that enqueues a job using a Queueable apex class. What are the limitations I'm going to hit if opportunities are update very frequently? Will ...
0
votes
1answer
26 views

Auto increment number using Trigger

We have a custom object A__c whose Name field is an auto number field. Now we have a custom field of Number type, say B__c. The requirement is B__c should be populated with Name-number format for ...
0
votes
0answers
22 views

Trigger is not working

I am new in salesforce and i am trying to get regions to Auth Object From Contact's county.County object has county and region and Contact object has a lookup to County object. Auth object has a ...
1
vote
2answers
26 views

Old and New Values of Parent fields with Re-parenting on Child Trigger

I know we have to query the parent fields to access them on the child object trigger. How can I get the old and new values of the parent fields when its parent record has been changed. I have two ...
1
vote
1answer
25 views

without Time Based Workflow

i try to write a trigger for object. thats work send email base of day like 3,5,7 days for further user. have any idea how can we do this process . not allow the time base trigger using workflow ...
-1
votes
1answer
33 views

Bulkify the apex trigger [on hold]

trigger SyncContactWithAccount on Contact (before insert, before update) { try{ Map<contact, id> contact = new Map<Contact, id>(); List<Contact> conList = ...
0
votes
1answer
31 views

Apex Trigger to update a lookup field works good when Lead is created manually but fails when created from a Web Form

So I am working on two objects: -Leads -Partner object(Custom) So I have a before insert Trigger on Leads, so when a new Lead is created and Partner Number Field is not blank it has to lookup for ...
3
votes
1answer
23 views

Trigger fired by future function does not support callout

I'm developing an integration that makes an HTTP call to an external system from SFDC. The entry point for this code is an opportunity trigger. After a user updates the opportunity, my trigger fires, ...
0
votes
1answer
16 views

Export contact detail to URL after Save

Im all looking for the following functionality: 1) User clicks Save on Contact Page 2) If a Picklist value equals, for example, 'Left Company' or 'No Interest', then.... 3) A Trigger fires ...
0
votes
0answers
14 views

Getting the email message in the form it was written(in english,not binary or any other encoding tech) in apex

I am writing a trigger on attachment where I need to check whether the value of a field of the parent custom object is contained in the email subject line of the email added as an attachment ...
0
votes
3answers
27 views

Task Trigger with two conditions

Please help, I am trying to write a task trigger for an Opportunity. I could not create a workflow because one of the fields is a look up. I would like to create a task to advise the user they ...
-1
votes
0answers
25 views

How to write an apex trigger to fire when adding an user into the call-center

I am very new to this salesforce platform. I want to fire a trigger when an user has been added to the call-center. How do we achieve this in apex?
0
votes
1answer
25 views

Standard Owner field update

We have a custom object which is having a field called A__C and it is a lookup to the user. So, if anyone chooses this lookup field value i.e. user. the standard owner field should automatically be ...
1
vote
1answer
14 views

Can you merge a lead via apex trigger?

Is it possible to use a trigger to automatically merge records? Or is the best way to accomplish this is to update the values of the intended master record from the losing record, delete the losing ...
1
vote
1answer
27 views

How to update a lookup field with the value from a formula or text field?

I am not a developer and I do not yet write Apex code very well. I need an Apex Trigger to do the following: If field "A" is null, update this field with the value from another field "B" Field "A" ...
0
votes
3answers
29 views

Apex : CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY & SELF_REFERENCE_FROM_TRIGGER

I added a new field on Opportunity table to keep a count of records, as well as track the updates made on that record. This is needed for an external system we use. Opportinity table already has ...
0
votes
1answer
14 views

To Create Additional record when related to field in task is added with multiple contacts

When I log a call in activity from a contact record,in the related to field if multiple contacts are added, then records has to be created multiple times. Eg: If I add 3 contacts in Related to Field, ...
1
vote
1answer
31 views

Fuel Java SDK - Asynchronous Triggered Sends

Are asynchronous triggered send calls possible using Fuel Java SDK v1.0.3?
1
vote
2answers
27 views

Verifying the Trigger code

I have a trigger code on account which prevents user to create or update any account that contains \ character in the name. trigger Restrictbackslashname on Account (before Insert,before Update){ ...
0
votes
0answers
21 views

New XML parsing trigger rejects any code coverage from its test class!

I just wrote this simple XML parser trigger to temporarily help me update a diagnostic object with additional integration data, without having to request the integration to run for all records. I ...
0
votes
2answers
43 views

Populating Field From Other Object

Hi i am new in salesforce and i want to ask a question about populating field from other object. There are 2 objects AreaFee and Account. AreaFee contains pdfCode(text),area(text),fee(currency) as a ...
-3
votes
0answers
18 views

Trigger to synchronize Activities with Cases and send an email

Create an Activity when a case is registered and send a notification mail to the activity owner. The following Activity fields are to be populated from the Case Record. Subject: Case having “Case ...
2
votes
2answers
26 views

Changing Oppoturnity Owner to a Lookup User Id field on the Opp Object

I want to create a trigger on the opportunity object to change the opportunity owner (if their profile is a Service Engineer) to the field called "Sales Rep Owner" which is a lookup user field on the ...
1
vote
1answer
36 views

Trigger Null pointer exception

I have this trigger that errors out at line 13 NullPointerException attempt to de-reference a null object in Apex Trigger Code trigger Event_Attendee_vod on Event_Attendee_vod__c (before update, ...
1
vote
1answer
26 views

Stop the Trigger after executing first batch

Is there a way to stop the trigger execution after processing the first 200 records? I was thinking of using the addError method at the end of the code as Trigger processes data in batches of 200. Is ...
-1
votes
0answers
19 views

FATAL_ERROR|System.LimitException: Apex CPU time limit exceeded

I have below a Trigger which throws the error as below:- ` Trigger.TotalResponses: line 37, column 1 12:27:17.588 (28588705513)|FATAL_ERROR|System.LimitException: Apex CPU time limit exceeded ...
-1
votes
0answers
25 views

trigger for update one field based on other object fields [closed]

how to write trigger for update one field in object based on two fields in another object
-1
votes
1answer
20 views

Trigger to synchronize Activities with Cases

Create an Activity when a case is registered and send a notification mail to the activity owner. The following Activity fields are to be populated from the Case Record. Subject Case having “Case ...
1
vote
1answer
32 views

List has No Rows for Assignment to SObject: Error

I have below trigger code where I get "List has No Rows for Assignment to SObject" Apex trigger: trigger CallVisibility on Compliance_Incident_Transaction_abv__c(before insert, before update) { ...
-1
votes
1answer
22 views

Why can't I install this app/package in sandbox?

I am trying to install the trigger framework mentioned here When I am installing this app in my sandbox (https://login.salesforce.com/packaging/installPackage.apexp?p0=04tU00000005VdB) , It is ...
2
votes
1answer
16 views

Problem with trigger execution on Opportunity batch insert

I've been dealing with this for a while now, and still haven't found a solution on the problem I am currently facing. So.. here is the situation. I have programmed a Trigger for the Opportunity ...
1
vote
1answer
17 views

Trigger to create a Contact after User is created (w/ error)

Getting an error with trigger/class. We have an automated process the creates a user record (from our AD/SSO process). When a User is created, a trigger sends an email to our support group to ...
0
votes
0answers
30 views

Need to Bulkify Trigger Not Supporting Mass update

I have the below Trigger which updates a Guest(Object) Email ID when the Contact(Object) Email ID is updated. The Error now is Im getting an Apex Time Limit Exceeded Error,As the Number of Guests is ...
0
votes
1answer
34 views

Apex check for blank picklist value

I am writing a trigger that has an IF clause based off of a field. However, I cannot get it to recognize if that picklist is blank. I have tried: field.isblank() string.isblank(field) field == '' ...
1
vote
1answer
15 views

Lead Convesrion option

How to create a multiple contacts if the last name of lead object field contain two or more names in salesforce for eg if i put last name as a "Bosnon, Bonny mankotia" in a last name field of lead ...
2
votes
2answers
49 views

Best approach to update multiple records before a single update

I'm exploring Apex and I'd like to know the best approach to accomplish the following scenario: Given a list of records, each having name and position (increment), I want once I update the position ...
1
vote
2answers
32 views

Need help on trigger [closed]

We have two object say A and B. A has a lookup on B. A has two text field Type and year. B has one text field Type and year I want to populate the lookup field of A by matching Type and Year field ...
0
votes
2answers
37 views

Validation Rule in Apex Trigger not working as expected

I have created an Apex trigger to replace the many validation rules on one of our custom objects, all work as expected except one (I have left out all other validations to make the below code more ...
0
votes
1answer
67 views

Apex Trigger: Insert record in custom object [closed]

A bit lost on how to finish this trigger. Scenario: - After creating a new opportunity - Object Implementation should populate a list of 12 Records - Each record then has it’s own set of task - ...
2
votes
2answers
40 views

Why is this Trigger not working

I've a question with this trigger. I checked the register and it launch the trigger but is not doing anything. It doesnt show me the debug messages, even the first one. The idea is that when we are ...
1
vote
0answers
13 views

Create, Customize and Synchronize Customer Options Object [closed]

Description: Create a custom object “NEWOPTION” with the following custom fields: Name, Field type Options Opt-options Picklist (yes/no) Country Picklist (India/Japan/UK/Singapore) ...
4
votes
1answer
45 views

Account Owner changes Opportunity Owner?

Q1: When I change the owner of an Account record to UserA, the associated Opportunity record's owner is set to UserA automatically. Is it a native behavior? (I checked all the workflows and account ...
-4
votes
2answers
51 views

Trigger Not Wokring: Error: Compile Error: Expression cannot be assigned at line -1 column -1 [closed]

Can Someone help me with this trigger : It is not working trigger ControlOpportunityStage on Line_Item__c (after update) { List<Opportunity> parentlist = new List<Opportunity>(); ...
1
vote
1answer
29 views

Update Lookup(Campaign) Lead value via trigger

I have a Lookup(Campaign) field Consumer_Newsletter__c set up on the Lead object. The Lookup(Campaign) field populates the Campaign Name on the Lead record. I'm trying to put together Apex code ...