locked
Set a Field to Required if picklist value equals specific value RRS feed

  • Question

  • Hi,

    I need to setRequiredLevel to a field but dependent on a picklist value... here's what i've done so far:

    i added in the picklist onChange event 

    if(crmForm.all.new_salesstage.DataValue == 40)
     crmForm.SetFieldReqLevel("new_proposaltargetdate", 1);
    
    but it doesn't retrieve the new picklist value unless it's submitted.. please any advice.

    Monday, August 8, 2011 8:19 AM

Answers

  • Hi,

    Picklist {Field}.DataValue method retuen string value try also add alert in code and check..

    try code like this:

    alert(crmForm.all.new_salesstage.DataValue);
    

    if(crmForm.all.new_salesstage.DataValue == "40")

    {
        crmForm.SetFieldReqLevel("new_proposaltargetdate", 1);
    }


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Marked as answer by Javeline Monday, August 8, 2011 11:08 AM
    Monday, August 8, 2011 8:23 AM

All replies

  • Hi,

    Picklist {Field}.DataValue method retuen string value try also add alert in code and check..

    try code like this:

    alert(crmForm.all.new_salesstage.DataValue);
    

    if(crmForm.all.new_salesstage.DataValue == "40")

    {
        crmForm.SetFieldReqLevel("new_proposaltargetdate", 1);
    }


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Marked as answer by Javeline Monday, August 8, 2011 11:08 AM
    Monday, August 8, 2011 8:23 AM
  • Thanks Jehanzeb for your prompt answer, 

    the value is returned correctly, i just forgot to add the else part in order to work correctly. 

    thanks again :)

    Monday, August 8, 2011 8:32 AM
  • Hi,

    I am glad that it solves yoru problem, please Vote as Helpful and Mark as Answer.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Monday, August 8, 2011 8:39 AM