Thursday, April 18, 2013
Field update using Trigger based on RollUp Summary field of an object in Salesforce
Last week I faced a situation. I had to update a field in an Object from Trigger based on a Roll up Summary field latest value in that Object.
Let Object name is Inventory. Roll Up Summary field name is rollUpInventory__c.
And in Trigger, I had to update another field testInventory__c based on previous field.
Now while trigger is fired, I experienced that every time its never getting latest Roll Up summary field value. Then I searched and found that Salesforce had steps in its Save logic. When trigger is fired, then Roll Up summary field is at all updated. Here is steps of Database Save logic in Salesforce.
1- Old record loaded from database (or initialized for new inserts)
2- New record values overwrite old values
3- System Validation Rules
4- All Apex “before” triggers
5- Custom Validation Rules
6- Record saved to database (but not committed)
7- Record reloaded from database
8- All Apex “after” triggers
9- Assignment rules
10- Auto-response rules
11- Workflow rules
12- Escalation rules
13- Parent Rollup Summary Formula value updated (if present)
14- Database commit
15- Post-commit logic (sending email)
Wednesday, April 17, 2013
Make Picklist Read Only if it has a value, else allow to input value in Salesforce
If a pick list field has already a value, then can it be read-only?
If field has no value, then it will allow people to change its value. But if any value is present, then will not allow to change it.
Make a Validation rule:
If field has no value, then it will allow people to change its value. But if any value is present, then will not allow to change it.
Make a Validation rule:
AND(
ISCHANGED(pick_list__c), TEXT(PRIORVALUE(pick_list__c)) <> "") |
Tuesday, April 16, 2013
Change Standard field Label Name in Salesforce
I was thinking that standard field label is not editable!!
I discover how to change a standard field label. Here are the steps:
Setup\Customize\Tab Names and Labels\Rename Tabs and Labels\Edit … Opportunity … Next … {Field Labels} … Save
I discover how to change a standard field label. Here are the steps:
Setup\Customize\Tab Names and Labels\Rename Tabs and Labels\Edit … Opportunity … Next … {Field Labels} … Save
Friday, April 12, 2013
Display All Dashboard in one Visualforce Page
Here is the code which works for me
<apex:page>
<apex:iframe src="/DashboardId?isdtp=nv" scrolling="true"
height="1588px" width="100%"/>
</apex:page>
Subscribe to:
Posts (Atom)