Monday 3 July 2017

System and User Mode in Sales force

System mode -


Its running apex code by ignoring user's permissions. So if logged in user does not have create permission but they will able to create a record.
Apex code has access to all objects and fields, sharing rules aren't applied for the current user. 
All apex code run in system mode. It ignores user's permissions. Only exception is anonymous blocks like developer console and standard controllers.

User mode - 


Its running apex code by respecting user's permissions and sharing of records. So, logged in user does not have create permission they are not able to create a record.
Only standard controllers and anonymous blocks like developer console run in user mode.


Special Note:

  Please Visit the  below Links.
                                                http://www.tgerm.com/2011/03/trigger-insufficient-access-cross.html

 


Does option “Re-evaluate Workflow Rules after Field Change” exist in process builder?"


Yes its possible in Process Builder.

How to do that?

You can do this while adding the object. If you check the Yes checkbox under Allow process to evaluate a record multiple times in a single transaction. the record will be re-evaluated maximum of 5 times in same transaction.

Hope it helps.

Purpose of 'Re-evaluate Workflow Rules after Field Change'


There is no connection between workflows, and there is no way to control the order of multiple workflows on the same object.  So, if you need 1 workflow to impact another one, make sure the criteria of each workflow takes that into consideration and make sure a Field Update is marked as 're-evaluate workflows'
For Example:
wf1-->type=customer  sets customerdate
wf2-->closedopp>0 and set type=customer
Since you can't control which of these WFRs runs first, you might consider setting 're-evaluate' on the 2nd Field Update to give the first WFR another chance.
NOTE:  This is a simple example to demonstrate the feature -- you would never design Workflow Rules as I have outlined them in this example.

Create records with Java script custom buttons in salesforce.


step1:
Navigate to Setup | Customize | Account | Buttons, Links and Actions
step2:
Press the New Button or Link button
step3:
Give your button a name
step4:
Choose the appropriate Display Type option but in most cases you’ll likely choose a Detail Page Button
step5:
Choose Execute JavaScript as the Behavior
step6:
In the field box you’ll add the JavaScript which I’ll explain below
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
var acct = new sforce.SObject("Account");
acct.name = 'Test Account';
acct.phone = '8147285030';
var result = sforce.connection.create([acct]);
if (result[0].getBoolean("success")) {
window.location = "/" + result[0].id + "/e";
} else {
alert('Could not create record ' + result);
}

Special Note: Dont write require script Like this
               {
              !REQUIRESCRIPT("/soap/ajax/29.0/connection.js")
               }

I hope you enjoyed this post......