1) What the are events of triggers?
- After insert,After Update & After Delete
.
Why Use Triggers?
Triggers are used to perform immediate actions based on previous action e.g. field update.
An apex language is used to write triggers
Eg: Account merges
2) Upsert trigger can call which all events?
-After Update & After Insert
3) What is merge operation?
4) Which events will be called during merger operation?
- Ans Delete n Update
5) In After Undelete, we cannot see trigger.old, only trigger.new can be seen.True or False?
-TRUE
6) Static variable declarion in trigger is possible,True or false?
-TRUE but it will not work.
7) In After update trigger event to Save a record do we need DML statement?
- Yes
8) In before insert trigger event can we have trigger.new and trigger.newmap?
- we can only have trigger.new, Trigger.newmap is not possible because still the record is not inserted and record Id is not generated.
9) Can we have batch/asynchronous method called from a Trigger?
- YES
10) Can we manually call triggers?
- No triggers cannot be called manually. It will automatically called for Insert/delete/update DML
operations only.
11) Can we write trigger for Profile object?
- No, generally there will be no scenarios to call trigger on Profile Object.
12) Will trigger fire after Workflow rule?
-Only Update triggers will fire once.
13) You have picklist field with 3 values :New, Latest,Old. Now you fire a trigger which will update the picklist field with 'Deleted' value for a record. Is this possible?
- YES
14) Can you update formula field through Trigger?
- NO
15) I need to update Trigger.Old records how can i do this?
- This is not possible because Trigger.Old is read only list.
16) Can we display Validation Error messages in After events of a Trigger?
- We Can display Error messages in After events, but there will be no purpose serverd. Because after inserting/Updating the record the error message will be dispalyed.
17)Consider a User logsin by a profile which does not have eidt access to Account object. But he/she tries insert a record to Account object, which in turns fires a trigger which updates record in the Account Object.
Will the Trigger Update the Record?
- Yes the Trigger can update the Record because Trigger always runs is System context.
12. There is a before trigger which will fire if amount = 100 and will display the error message. There is a workflow rule which will fire if amount > 100 and will update amount field to 100. One of user saved the record by giving value as 1000.
- After insert,After Update & After Delete
.
Why Use Triggers?
Triggers are used to perform immediate actions based on previous action e.g. field update.
An apex language is used to write triggers
Eg: Account merges
2) Upsert trigger can call which all events?
-After Update & After Insert
3) What is merge operation?
4) Which events will be called during merger operation?
- Ans Delete n Update
5) In After Undelete, we cannot see trigger.old, only trigger.new can be seen.True or False?
-TRUE
6) Static variable declarion in trigger is possible,True or false?
-TRUE but it will not work.
7) In After update trigger event to Save a record do we need DML statement?
- Yes
8) In before insert trigger event can we have trigger.new and trigger.newmap?
- we can only have trigger.new, Trigger.newmap is not possible because still the record is not inserted and record Id is not generated.
9) Can we have batch/asynchronous method called from a Trigger?
- YES
10) Can we manually call triggers?
- No triggers cannot be called manually. It will automatically called for Insert/delete/update DML
operations only.
11) Can we write trigger for Profile object?
- No, generally there will be no scenarios to call trigger on Profile Object.
12) Will trigger fire after Workflow rule?
-Only Update triggers will fire once.
13) You have picklist field with 3 values :New, Latest,Old. Now you fire a trigger which will update the picklist field with 'Deleted' value for a record. Is this possible?
- YES
14) Can you update formula field through Trigger?
- NO
15) I need to update Trigger.Old records how can i do this?
- This is not possible because Trigger.Old is read only list.
16) Can we display Validation Error messages in After events of a Trigger?
- We Can display Error messages in After events, but there will be no purpose serverd. Because after inserting/Updating the record the error message will be dispalyed.
17)Consider a User logsin by a profile which does not have eidt access to Account object. But he/she tries insert a record to Account object, which in turns fires a trigger which updates record in the Account Object.
Will the Trigger Update the Record?
- Yes the Trigger can update the Record because Trigger always runs is System context.
No comments:
Post a Comment