Salesforce Interview Questions – Part 7

61. How to round the double to two decimal places in Apex?
Ans:

Decimal d = 100/3;
Double ans = d.setScale(2) ;

62.In Profile settings, what is difference between “Modify All Data” and “Modify All” ?
Ans:

Modify All Data : Create, edit, and delete all organization data, regardless of sharing settings.
Modify All : Give Read, Add, Delete permission to selected Object, Create permission is not included in Modify All  permission.


63. If i want record level access then what should i use from Salesforce security model?
Ans:
Manual Sharing


63. If i want Object level access then what should i use from Salesforce security model?
Ans:
Profile


64. In OWD (Organization wide sharing), can i change the setting “Grant Access Using Hierarchies” for Standard Objects ?
Ans:
You cannot change it for Standard Objects However for Custom Objects its possible.


65. What is Mandatory while creating User, Role or Profile?
Ans :
Its Profile.


66. In case of Master-Detail relationship, on Update of master record can we update the field of child record using workflow rule?
Ans:
No


67. In case of Master-Detail relationship, on Update of child record can we update the field of Parent record using workflow rule?
Ans:
Yes, the Master fields are also available for “Criteria evaluation”.

68. While setting OWD (Organization wide sharing), can we change/modify the setting of child record in case of Master-Detail relationship?
Ans:
No, Child record is controlled by the Parents setting.


69. What is the need of “Custom Controller” in Visualforce as everything can be done by the combination of Standard Controller + Extension class.
Ans :

  • Sharing setting is applied on standard object/extension by default; In case we don’t want to apply sharing setting in our code then Custom controller is only option.
  • It is possible that the functionality of page does not required any Standard object or may require more than one standard object, then in that case Custom controller is required.

70. In class declaration if we don’t write keyword “with sharing” then it runs in system mode then why keyword “without sharing” is introduced in apex?
Ans:

Lets take example, there is classA declared using “with sharing” and it calls classB method. classB is not declared with any keyword then by default “with sharing” will be applied to that class because originating call is done through classA. To avoid this we have to explicitly define classB with keyword “without sharing”.

Posted

in

, ,

by

Tags:


Related Posts

Comments

7 responses to “Salesforce Interview Questions – Part 7”

  1. Arun Singh Avatar
    Arun Singh

    This is quite helpful, thanks for sharing.

  2. […] Part – 1 | Part – 2 | Part – 3 | Part – 4 – Dynamic Apex | Part – 5 | Part – 6 | Part – 7 […]

  3. Taygi Akhil Avatar
    Taygi Akhil

    Very good resource. thank you.

  4. Anand Avatar
    Anand

    gud

  5. SRIKANTH Avatar
    SRIKANTH

    Hi Admin,

    I found mistake in 62nd question.

    MODIFYALL : READ,EDIT,DELETE RECORDS FOR PERTICULAR OBJECT.(WE CANT CREATE RECORDS)

    MODIFYALL DATA : READ, CREATE, EDIT, DELETE RECORDS FOR ALL CUSTOM AND STANDARD OBJECTS.

    1. JitendraZaa Avatar
      JitendraZaa

      Thanks Srikanth,
      I have updated answer.

  6. snsnw001 Avatar
    snsnw001

    please can you tell me? what is the difference between view all and modify all..thnx in advance…

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading