Please let me know what all things we need to take care while writing a Trigger,
- How to decide before or after trigger to use
- What all configurations we need to go through
- Batch size
- How to bulkify a Trigger
- How to avoid hitting Governor Limits
- Loops, and any other best practices to implement
Apart from above points, please include other points if I missed out any.
Can you please clarify the following doubts:
- When can before update and after update need to be used on an object.
- Please give some business scenarios for using before update and scenarios for using after update on an object.
Similarly, how can we decide on when to go for before insert and after insert. Also before delete and after delete.
I am new to Apex and have following doubts, can you please answer?
- Can we invoke a Trigger from a class, if so an example please.
- Can we invoke a Class from a Trigger, if so an example please.
I am new to Apex. Say we have an Apex class as below. Please let me know on how to go with debuging the below code if any problem occurs.
public class SimpleProg
accs= new Account[NUM];
for(Integer i=0; i<NUM; i++)
accs[i]= new Account(name='test ' + i);
Also pls let me know how to write a Test class for the above.
As part of a Project, we are in the process of identifying the
1. Number of ways to connect to an External System from Salesforce(As we need to connect to the external system, get required data from the external system and use that data in the Salesforce application) and
2. Finalizing the feasible/suitable approach of the above.
Can anyone please provide the different approaches of connecting Salesforce to External Systems and their feasibility in usage.
If you can give me a sample code for each of the approaches that would be of really great help for me.
Thanks in advance,
I am new to Apex and started learning it recently. While going through Apex Developer's Guide I found following:
If you update or delete a record in its before trigger, or delete a record in its after trigger, you will receive a runtime error. This includes both direct and indirect operations. For example, if you update account
A, and the before update trigger of account A inserts contact B, and the after insert trigger of contact B queries for account A and updates it using the DML update statement or database method, then you are indirectly updating account A in its before trigger, and you will receive a runtime error.
Can anyone please explain the above functionality with an example?
Also, please provide with a link which has Apex practice classes and triggers for beginners.
Thanks in advance,