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?

normsp
  • 97
  • 1
  • 1
  • 8

3 Answers3

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.

Keerthi
  • 1,113
  • 2
  • 15
  • 32
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

Mohamed El-Qassas MVP
  • 45,382
  • 9
  • 53
  • 96
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