A trigger is an apex code, that can be executed before or after DML operations
0
votes
1answer
12 views
Apex Trigger Test Class Coverage
I am trying to create a test class for my apex trigger but I am not able to reach the code coverage. does anyone how I can reach the code coverage?
Here is trigger
trigger AccountInformation on ...
0
votes
1answer
12 views
Using children in WHERE criteria of Parent-to-Child SOQL query
Can't seem to find an example of this.
trigger Opportunity_Triggers on Opportunity (after insert, after update, after delete) {
List<Account> accList = [SELECT Id, (SELECT Id, AccountId ...
2
votes
2answers
32 views
Need Help With Test Class
This has already been asked and answered and is working except for the errorCase.SuppliedName returns Null after my error message. How do I write a Test Class for this. I'm a newbie and this has ...
5
votes
2answers
42 views
Populating a formula field with a trigger
I have an object which is sometimes created by a user manually, or under some circumstances is created by a trigger. It has a formula field which gets populated by a related object's field when a user ...
1
vote
2answers
37 views
inserting a contact in a before insert trigger for leads
I want to insert a record in the database. If it meets certain criteria, it should be inserted in lead, if not, it should be added in contacts. I'm not able to achieve this. Its a before insert ...
6
votes
1answer
38 views
Trigger appears to be generating multiple tasks
I wrote the following trigger to generate a task when an application is set to a certain status. It is creating the task I expect, but it appears to be generating an additional task. Any help will ...
4
votes
2answers
64 views
Before Insert Trigger - Query Only Related Records To Incoming Record
Ideally this trigger would look to see if a record of a certain record type has a yes flag and set it to no before inserting a new record (all under the same related Contact_c). More specifically, I ...
7
votes
1answer
49 views
Trigger to avoid file upload to chatter comment
We want to avoid, that a user is able to upload files to chatter comments. We realized this by creating triggers on FeedComment and ContentVersion. This prevents to save the comment successfully.
If ...
4
votes
3answers
58 views
Bulkified Contact Trigger That Creates An Account?
I'm trying to create a trigger on Contacts that automatically creates and associates an Account if one has not been previously created. This was functionality that we had in a managed package that we ...
9
votes
1answer
72 views
Check that criteria are met in a before insert trigger
I want to check whether a certain criteria is met or not using a trigger before inserting a record. if it meets the criteria, i insert the record, but if it does not i want to display an error message ...
3
votes
1answer
39 views
Best approach for monitoring events dynamically?
I want to monitor for inserts and updates on objects over a specified period of time. I don't know in advance which objects I need to monitor. My constraints are the govenor limits and accuracy. I ...
7
votes
1answer
113 views
Count total child records on Parent object in Lookup relationship
Hello I am Having two object One is Region(Name, totalCustomer) and another is Customer(Name,Region). Region is parent object and customer is child object means Cusotmer Object is having lookup ...
7
votes
1answer
94 views
Why is this trigger creating only 200 records?
This trigger creates an entitlement for every account that meets certain criteria.
I have read the triggers process records in chunks of 200 but I am not understanding why the trigger below only ...
3
votes
1answer
37 views
Help with question on trigger logic
I am working on a trigger to create a task, but only if there is not an active task already assigned. The following is the logic that I think should work, but Apex does not like the select statement. ...
5
votes
1answer
111 views
Test Coverage fail on simple before insert & update apex trigger
Apex n00b here. This has been gnawing me up over past few weeks. I have this very simple before insert / update trigger on Opportunity that auto-selects the Price Book based on a dropdown value ...