Wednesday, January 9, 2013

RealTime Scenarios

Real Time Scenarios:



  1. The Situation is I do have two Check boxes (Checkbox A & Checkbox B).And My condition is to allow any one of the check box is true ,not the two at a time.

    If checkbox A is true , Check box B should be False  and IF Checkbox B is true , Check box  B should be False , Both should not be TRUE.


    Ans:use the Validation rule to do this and display the error if both are checked

    In Error Condition Formula 

    AND(checkboxA,checkboxB)

    In ERROR MESSAGE:select only once checkbox

    How will you handle 10001 SOQL problems in apex?
    Ans:10001 error means “Too many query rows”
    Public static  integer getTotalVotes()
       {
            integer totalIdea = [SELECT count() FROM Vote where Parent.Type='Idea' limit 501
    ];
            return totalIdea ;
       }

30 comments:

  1. what is code for above scenarios ? pls give my ans

    ReplyDelete
  2. Use a radio button instead of checkbox

    ReplyDelete
    Replies
    1. your right sir can you send me backend code for radio buttons

      Delete
  3. suppose 10 check boxes are there. If u check some X then automatically uncheck some Y chk box and remaining check boxes are independent. So here radio buttons are not suited.

    ReplyDelete
  4. AND( checkboxA__c = true && checkboxB__c = true || checkboxA__c = false && checkboxB__c = false)

    ReplyDelete
    Replies
    1. AND( checkboxA__c = true && checkboxB__c = true)

      Delete
  5. and (checkboxA__c, checkboxB__c)

    ReplyDelete
    Replies
    1. If we use above code then it will work only for true condition for false we have to check. Otherwise without checking the check box we will be able to save.

      so we can use below code

      ( CheckBox_A__c = True && CheckBox_B__c = True ) || ( CheckBox_A__c = False && CheckBox_B__c = False )

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

    ReplyDelete
  7. AND( CheckboxA__c = true <> CheckboxB__c = false)

    ReplyDelete
  8. AND(checkbox_c=true = checkboxB_c=true)

    ReplyDelete
  9. AND( checkbox_A__c = true <> checkbox_B__c = false || checkbox_A__c = false <> checkbox_B__c =true)

    ReplyDelete
  10. isn't this the easy one -->
    OR(AND( Check_A__c , Check_B__c),AND( !Check_A__c , !Check_B__c))

    ReplyDelete
  11. (male__c = true && female__c = true) || ( male__c = false && female__c=false) practically i have done with this validation

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

    ReplyDelete

  13. Great presentation of Salesforce form of blog and Salesforce tutorial. Very helpful for beginners like us to understand Salesforce course. if you're interested to have an insight on Salesforce training do watch this amazing tutorial.https://www.youtube.com/watch?v=5FTe-ah3WBU

    ReplyDelete
  14. NOT( OR ( AND(box1__c =false,box2__c =true),AND(box2__c =true,box1__c =false)) ) check this

    ReplyDelete
  15. incident resolution with real time projects

    ReplyDelete