Thursday, May 12, 2016

Salesforce Interview Questions-Validation Rules

1. What are validation rules?
Validation rule contains an error condition and error message. If evaluation of error condition results in true value, record is not saved, and the error message is generated. Validation rules can be attached to fields. They are executed when a record is created or updated.

2. Can we avoid deletion of records through validation rules?
No. Validation rules fire in insert and update operation.

3. Can we bypass validation Rules?
Validation rules can never be bypassed. If we have upload records and need to bypass validation, then deactivate validation rule and upload records. After upload, again activate validation rule.

4. Is it possible to fire validation only for records which is being getting updated not to newly inserted records?
Yes, We can use ISNEW() function which will return true whenever new record is getting created in validation rule. We can use this function and check our criteria only if ISNEW() function is returning false(means record is being updated).

5. Is there is any way through which validation rule is bypassed while doing upload through data loader  but not when user is creating record from user interface?
Yes. Create a checkbox field as API upload and make this field hidden in page layout. Create a validation rule and in evaluation criteria first check if checkbox is false and then check other validation criteria.
Whenever user upload record through data loader, specify value for this checkbox as true in .csv file and then upload it to salesforce. While upload, validation rule will fire and will find checkbox value as true so it will not check other criteria and system will allow to upload records.

6. What is the difference between ISBLANK() AND ISNULL()?
ISNULL() works only for number data type fieds, if we don't populate with value for number fields it will return true.
ISNULL() won't support TEXT data type fields because text fields never become null.
ISBLANK() supports both number as well as text data types.

7. What are cross object formula fields?
Cross-object formulae span two or more objects by referencing merge fields. By using this you can refer parent fields from child record.

8. What are different ways to make field required in salesforce?
  1. While field creation, specify required field as true.
  2. Through page layouts
  3. Validation rule
  4. Apex trigger
9. Admin wants to avoid the deletion of child records in master detail relationship. Is it possible to achieve this using point and click functionality?
Yes. First create a roll up summary field on parent which calculates the total count of child records. Now write a validation rule on parent object which checks if previous value of total count is less than new value. If yes, then display error message.
Suppose field name is total_count__c in parent object then validation rule criteria will be:
Priorvalue(total_count__c) <total_count__c
When we delete the child record then roll up summary field value will get reduced by 1. System will update the parent record roll up summary field which will fire the validation rule and avoid user from deleting child record.


34 comments:

  1. Tks very much for your post.

    Avoid surprises — interviews need preparation. Some questions come up time and time again — usually about you, your experience and the job itself. We've gathered together the most common questions so you can get your preparation off to a flying start.

    You also find all interview questions at link at the end of this post.

    Source: Download Ebook: Ultimate Guide To Job Interview Questions Answers:

    Best rgs

    ReplyDelete
    Replies
    1. IEEE Project Domain management in software engineering is distinct from traditional project deveopment in that software projects have a unique lifecycle process that requires multiple rounds of testing, updating, and faculty feedback. A IEEE Domain project Final Year Projects for CSE system development life cycle is essentially a phased project model that defines the organizational constraints of a large-scale systems project. The methods used in a IEEE DOmain Project systems development life cycle strategy Project Centers in India provide clearly defined phases of work to plan, design, test, deploy, and maintain information systems.


      This is enough for me. I want to write software that anyone can use, and virtually everyone who has an internet connected device with a screen can use apps written in JavaScript. JavaScript Training in Chennai JavaScript was used for little more than mouse hover animations and little calculations to make static websites feel more interactive. Let’s assume 90% of all websites using JavaScript use it in a trivial way. That still leaves 150 million substantial JavaScript Training in Chennai JavaScript applications.

      Delete
  2. This content creates a new hope and inspiration with in me. Thanks for sharing article like this. The way you have stated everything above is quite awesome. Keep blogging like this. Thanks.

    Salesforce Training in Chennai

    ReplyDelete
  3. Sorry to be frank and straignt forward, I have been attending interviews from 3 months, None of them asked like this STRAIGHT forward questions, these are very good for those TRAINERS but Not at all for Real time interviews.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. For Ques#9 conditions should be Priorvalue(total_count__c) >total_count__c

    ReplyDelete
    Replies
    1. I think NO...
      and Author made no Mistake...

      Delete
    2. This comment has been removed by the author.

      Delete
  6. Validation rule can be bypassed by selecting "ignore validation" in user detail page.The provided answer is not correct.

    ReplyDelete
    Replies
    1. Please explain how this is possible. Thanks.

      Delete
  7. This is an awesome post. Really very informative and creative contents.
    ios app Devlopment company in chennai

    ReplyDelete
  8. This is brilliant. Kudos!

    ReplyDelete
  9. In 9th question this is the correct logic:
    "PRIORVALUE( counting__c ) > counting__c"
    I mean use > symbol.if you have used < , then you'll not be able to retrive the deleted child back from the recycle bin.

    ReplyDelete
  10. Can we bypass validation Rules?
    Yes -using Permission Set we can bypass validation Rules

    ReplyDelete
  11. Really helpful content. These are all repetitive and very important questions which interviewers asks all the time. Thank you!!

    ReplyDelete
  12. Thanks, this is generally helpful.
    salesforce cpq training
    Visit us: salesforce cpq course

    ReplyDelete
  13. This article will outline all the different strategies you should be aware of when it comes to soccer.

    best ias coaching in india

    ReplyDelete
  14. Hot And Sexy Independent Model Escort Service In Delhi Unlimited Enjoy Genuine 100% Profiles And Trusted Door Step Call Girls Feel Free To Call Us 24/7Hours Opens Thanks..
    Call girls in Noida
    Noida Call Girls
    Escorts in Noida
    Noida Escorts

    ReplyDelete
  15. Do you Need Instant Loan from $2,000 to $50,000,000.00 with no collateral required and receive a no obligation loan approval.We welcome the opportunity to show you how effective we are at helping our clients obtain the money they need to succeed. Our professional staff is available for a Free Consultation.At Patiala legitimate company Pvt , contact us now 2% interest rate, both long and short term cash reply to us (Whats App) number: +919394133968 patialalegitimate515@gmail.com 
    Mr Jeffery

    ReplyDelete
  16. Data Validation Security System
    Data Validation Security System - Pharmacies: Monitoring and recording of the environmental conditions of medical supplies storage Captemp.com.

    ReplyDelete
  17. Admin please remove the unwanted comments

    ReplyDelete
  18. İnstagram takipçi satın al! İnstagram takipçi sitesi ile takipçi satın al sende sosyal medyada fenomen olmaya bir adım at. Sende hemen instagram takipçi satın almak istiyorsan tıkla:

    1- takipçi satın al

    2- takipçi satın al

    3- takipçi satın al

    ReplyDelete
  19. thank you sir i liked your post very much can you give me any tip so that i can start my new blog i try very hard to make a good block but i can not make so sir please help me


    Gurgaon Sector 74 Service Girls
    Gurgaon Sector 76 Service Girls
    Gurgaon Sector 80 Service Girls
    Gurgaon Sector 81 Service Girls
    Gurgaon Sector 82 Service Girls
    Gurgaon Sector 83 Hot Service Girls

    ReplyDelete
  20. kya aap bhi chhote penis se pareshan hain toh aap fr aap market se penis size badhane ki dava oil use karke bada aur mota kare skte hain aise karne se aap ka ling bhi bada hoga aur uska size mota hoga aur sath hi sath aapki sex karni ki timing bhi badegi

    ReplyDelete
  21. The principal region is in choosing the lawyer and the subsequent region is botches made in the wake of choosing the lawyer.
    Brain Injury Attorneys

    ReplyDelete
  22. A few lawyers have expounded broadly on the law. https://frouharlaw.com/

    ReplyDelete
  23. Hi! this is often a nice article you shared with great information.

    ReplyDelete