Creating Expense Form with either or fields
Copy link to clipboard
Copied
I want each line to either have mileage or an expense amount, but not both.
I have the total for the line to calculate mileage value if there is an amount in the mileage column or put in the amount spent, but I want to limit the user to only putting a value in one column or the other.
Columns in form are:
Date, Description, Miles, Amount, GL Account, Total
Miles and Account are formatted as numbers.
My total column calculation if then script works but does not prevent using both.
Copy link to clipboard
Copied
Can you share file or photo of your fields?
Copy link to clipboard
Copied
The way to achieve that is to have each field reset the value of the other when filled. Let's say they are called Miles1 and Amout1. As the custom validation script of Miles1 enter:
if (event.value) this.resetForm(["Amount1"]);
And under Amount1 enter:
if (event.value) this.resetForm(["Miles1"]);

