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

learn more… | top users | synonyms

0
votes
1answer
23 views

execution of AfterInsert caused by: System.FinalException: Record is read-only:

trigger GudMorning on Class__c (before insert,after insert) { if(trigger.isbefore){ for(Class__c c1 : Trigger.new){ c1.State__c = 'AP'; } } else { ...
2
votes
1answer
11 views

Trigger for passing picklist value from Campaing to campaign members custom field

Brand new to Apex with rudimentary programming skills. Here's what I'm trying to do: I'm trying to pass the campaign type (email, webinar, etc...) from the Campaign to it's Members. What I'd like to ...
3
votes
1answer
37 views

Trigger on Task/Activity - can you access Activity?

I need to have a trigger that updates a date on the contact based on whether a task was created with two specific dispositions (Call_Disposition__c is a custom field on the Activity). Since the field ...
3
votes
0answers
42 views

Implementing Trigger Framework(KevinOHaras)

I've been researching some best practices, and trigger frameworks and I found Kevin O'Haras TriggerHandler Framework. Now I don't fully understand it, I don't understand how to reference the Trigger ...
5
votes
2answers
50 views

System.QueryException: Aggregate query does not support queryMore()

I am trying to deploy around 80 Components which include Apex Class,Trigger and Visualforce Pages. But it is failing due to below exception, MyTrigger: execution of BeforeInsert caused by: ...
2
votes
1answer
22 views

What would cause a trigger to execute twice?

I have a before update trigger that essentially records upgrades or downgrades when an opportunity gets updated and then logs this change in a new custom object. The concept is pretty simple, for ...
3
votes
2answers
59 views

I am getting this error: System.LimitException: Too many SOQL queries: 101

I am getting this error System.LimitException: Too many SOQL queries: 101 when I run the class bellow. It seems like it is affecting all the triggers linked to NRProducts__c Object(This object has ...
-2
votes
1answer
34 views

To Update a field in user object of salesforce by using another custom object

I would like to know how to update fields in user object when i enter some values into the fields in a custom object. Here i tried using trigger. I have tried by writing a trigger when a value is ...
1
vote
1answer
12 views

Counting account totals within another account type

In our Salesforce deployment, we have two account types (partner and merchant). Merchants have a custom field that contains their parent "partner" account. I am trying to write a trigger (on ...
1
vote
1answer
18 views

Can we create report folders through Apex

I like to create a report folder via Apex trigger/class is it possible. Thanks in advance
0
votes
2answers
40 views

Trigger to update 2 picklist values

I have a requirement for updating two picklist value if a checkbox is ticked. Feedback__c is one object which has Status__c and Resolution__c picklists. Feedback_Comments__c is another that will ...
1
vote
1answer
33 views

Need a trigger that will return(rolls up) minimum value from child records to Parent Record

I have two standard objects Quote QuoteLineItem Each Quote may have one/more QuoteLineItems or maynot have any QuoteLineItems. Quote and QuoteLineItem are related with Master Detail Relationship. ...
0
votes
0answers
27 views

Dynamically upload attachments with trigger

I have an integration in place for Infor LN ERP to Salesforce (Inforce). Part of the integration covers the synchronisation of invoices for which there is a invoice object: InForceEW__invoice__c ...
3
votes
3answers
48 views

Quick way to clear all classes and triggers

Long story, but I want to clear all the code from an org. I don't need to clear Visualforce pages (there is only one, and I'm deleting that manually) - just all triggers and Apex classes. Does anyone ...
1
vote
1answer
39 views

List Exception caused by trigger

I have some code in a trigger that works when tested, and works in my sandbox, when I get it into production every time something happens where the trigger should go off, I get this error: Apex ...
0
votes
2answers
15 views

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY when subscribing role members to a record

I created a trigger that on a record creation (Custom sObject), subscribes all the createdBy role members to the record. This code seems to work just fine when executed by a sys admin, but it throws ...
0
votes
0answers
25 views

Can we update public group members when a username in user object or any custom object is updated?

I am having one custom object called clubmember and I wrote one trigger which insert and delete the member to public group object. I like to know how to write a code to update(i.e if the user change ...
2
votes
1answer
61 views

Restful webservice with XML in Salesforce

I am trying to write this below xml from Contact object.Problem is compostion of the xml with nested childs is really complex.Can you help understand to demistfy this problem. "<request ...
1
vote
1answer
44 views

Trigger on Account when an attachment is uploaded to that account

Can I detect when an attachment is related to an account from a Trigger on account ?? Also, I want the trigger to post to chatter that the attachment has been uploaded upon completion.
2
votes
2answers
33 views

Prevent Failure of complete Trigger

I have an issue, which might be familiar with most of you all. We are getting Cases from Oracle via Command Line Data Loader Programs. It is quite possible that one record has a data issue which ...
3
votes
1answer
28 views

Sending HTTP callout after a Lead record is updated

I have a requirement where I have to send Lead data from Salesforce to TIBCO server once Send_to_CRM__c check box goes from false to true on Lead update. Once updated 2 web-services are suppose to go ...
2
votes
1answer
30 views

Create an event after a record has been approved

I want to create a event after my record have been approved, I have a checkbox checked when my record is approved so I can create my event, but the record will be locked !!!! There were custom ...
-5
votes
3answers
40 views

Trigger Problem [closed]

I created a trigger on Campaign Member when ever the Status is added to campaign memberautomatically task have to created to sfdc account owner but But in SOQl how can i reterview the Sfdc Account ...
3
votes
2answers
57 views

How to create a master-detail object picklist to picklist trigger

I am new to creating triggers and would love some assistance in creating a trigger that can mirror a picklist values. I have two identical picklists called "Test_Status__c" on both the Account object ...
0
votes
0answers
32 views

Update Field on Opportunity from Activity Field

Activity Field API: Next_Step__c Opportunity Field API: Next_Step__c Scenario: When logging an activity (whether an event or task) - and Next Step field contains data - this should update the custom ...
0
votes
0answers
24 views

Issue with One to One Accounts and Converting Leads

I'm currently working on a system that has the Nonprofit Starter Pack with One-to-One Accounts enabled. I have made a trigger that changes the default account of a contact to some account that has ...
0
votes
0answers
20 views

Skip Lead Assignment Rule for Named Accounts

How can I get leads from specific companies, i.e., leads meeting specific filter criteria, to skip assignment rules and go directly to a designated rep? Currently my trigger assigns named account ...
1
vote
2answers
32 views

Is there a way to make an LDAP call through a Trigger?

I searched the APEX documentation and I didn't see anything relating to LDAP. We have the ID for a customers Active Directory [AD] profile stored within Salesforce. We are looking to call AD and ...
1
vote
1answer
26 views

Opportunity After Update trigger fires Account Triggers - any way to disable it?

In one of my Oppty after update triggers, I found that the account triggers fire as well. Why is the account updated ? (I am not updating values on the account object) Is there a way to control ...
3
votes
3answers
215 views

Triggers Best practices

We are experiencing performance issues on our org and over the years the size of the org (data + bus logic components like workflows, triggers, fields etc..) have grown rapidly and exponentially. We ...
1
vote
1answer
40 views

Test Apex trigger on Case before update

Im stuck, how can I test the Apex trigger frfing on case before update? Any help appreciated. Im quite new into this universe so I bear in mind :-) Apex trigger: trigger CaseEscalationTrigger on ...
2
votes
2answers
49 views

Need to fire trigger on child objects when parent object is updated

I have a 1-to-many relationship using a lookup. I have a trigger that does a rollup on the parent object. So, anytime a child record is inserted, updated or deleted, the trigger fires and updates ...
1
vote
3answers
71 views

Trigger to update a picklist field from another picklist field

I'm still pretty new when it comes to Apex, so I apologize in advance if this is an easy thing to fix. I'm trying to create a trigger that auto populates a picklist field in the Lead object, based on ...
1
vote
2answers
36 views

What is wrong with this apex trigger to cascade address updates?

I've only just started using apex so I'm having trouble pinpointing what is wrong with this code. It is a trigger on accounts which is intended to cycle through all contacts belonging to an account ...
2
votes
1answer
35 views

DmlException:SELF_REFERENCE_FROM_TRIGGER

I have Opportunity-lookup field on Opportunity (self), Scenario: Opportunity A if select Opportunity B using lookup then Opportunity B's same lookup field automatically populate with Opportunity A. ...
1
vote
2answers
46 views

Sending a SOAP web-service for each Lead insert

I have a requirement where I have to send out a web service to a third party system every time a Lead is inserted. I can do it by calling the web service via trigger. However I want to make sure that ...
1
vote
1answer
26 views

Auto Add Quote Contact as Primary Opportunity Contact

I am trying to create an apex trigger that automatically adds the Quote Contact as the Primary Opportunity Contact. I am using the code below trigger OpportunityContactRoleTrigger on Quote (after ...
4
votes
2answers
57 views

Trigger to update Account field when update is made to Custom object

Hi i could use a little help and i'm totally stuck. I'm trying to write a trigger to update a custom field on my Account object when a update is made on a field in my custom object. The object is ...
3
votes
1answer
38 views

Managing SObject uniqueness

I have Custom Field in Standard Object called Accounts Then i create custom Field called Priority (API Key_Priority__c) which is a PickList(1,2,3,4,5) Then I created Custom Object Customer (Structure ...
2
votes
2answers
29 views

Is there a way of cascade updating the status of related cases?

If I have a parent case and 50 child cases, is there a way of updating the status of the parent case that then cascades to all child cases?
1
vote
1answer
21 views

AMPSCRIPT Triggering Send API in a Landing Page?

Without using a posting form by a user, is there a way to automate a landing page to self execute on a daily basis using AMPSCRIPT and landing pages? I can actually use Automation studio to do this, ...
2
votes
1answer
36 views

Convert Custom Object records

I'm trying to use/modify the code in this free app to be able to convert/move a Custom Object associated with a Lead to the converted Account & Contact. ...
3
votes
1answer
70 views

Auto population of field in trigger

I'm trying to Auto populate Transportation_Zone__c depending on my Country__c. So if my Country__c (which is a text field) == "US", then the Transportation_Zone__c must be auto populated to "USA". ...
0
votes
0answers
15 views

Triggered Send - High Response Time [duplicate]

Our triggered sends have a history of taking a long time to get a response (30 secs or more) from ExactTarget for each call. In the past two weeks, the situation has gotten worse and the calls have ...
1
vote
0answers
31 views

Triggered Send - High response times [closed]

Our triggered sends have a history of taking a long time to get a response (30 secs or more) from ExactTarget for each call. In the past two weeks, the situation has gotten worse and the calls have ...
3
votes
2answers
179 views

Merging two triggers into one

I have created two triggers One for 'Short-Term Strategic Products' & one for 'Long-Term Strategic Products' I am wondering is there any possibility i can merge these two triggers into one ?or ...
0
votes
1answer
58 views

Trigger on Opportunity

I have a lookup to custom object from Opportunity called Team__c. Team__c has a child object called Team_Members__c (Master-Detail relationship between them). I need to create an new opportunity when ...
1
vote
1answer
17 views

Update Salesforce opportunity on landing page submission

For full disclosure, I am not a developer, but I can dabble. I want to set up a form on a landing page for clients to fill out. The form will contain custom fields that already exist on the ...
0
votes
1answer
36 views

Send an email template from trigger on Quote Item

I want to send an email template to a contact record, based upon QuoteItem field. On the QuoteItem object I have a field called update_del (checkbox). When the field is set true, I want to send an ...
2
votes
1answer
20 views

make Attachment is required when subject = “meeting” in opportunity

how to make Attachment is required when subject = "meeting" in opportunity ? please help me.