0

I have two fields...

Price is an Amount field Approval is a Person or Group field

so if the Ammount field is > $1000, Approval field is required so what is the proper column formula to validate the Approval field?

For example:

If Amount field >1000, Approval Field cannot be null...

UPDATE:

I just found out the Approval Field doesn't have formula field! Now what?

3 Answers 3

1

You can do this using JQuery:

if($('#amountfieldid').val() > 1000){
   if($('#approvalfield').val() == ''){
       alert('Approval field is required!');
       return false;
   } 
}

You can use PreSaveAction() function to write your custom code before submitting the form.

0

You cannot use lookup fields in Column and List validation or Calculated field , You will have to use

  • The object model to create a validation.

  • Or change Lookup field to Choice Field

  • Or Javascript Validation as something like this

<script type="text/javascript">
    function PreSaveAction() {
        var amount= document.getElementById("Lookup Field ID");
        if (amount.val() > 1000) {
            alert("");
            return false;
        }
        return true;
    }
</script>

Check a similar thread that may help you lookup column in calculated column formula

2
  • The lookup field is tied to our active directory groups is I can't use a choice field. What about using Jquery validation?
    – normsp
    Aug 22, 2016 at 14:32
  • Please check my updated answer Aug 23, 2016 at 11:44
0

You can do this with workflow.

  • Create a workflow for this.
  • set this will be fired when an item will be created.
  • check the condition
  • if amount value > 1000 them prompt the user to input Approval field

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.