BrandonOwens
5 years agoQrew Member
If and List Function
Hello,
I have a code below that works fine but the request was made to make the errors show one at a time. If you read the code, it has three separate error messages. If the user is entering a large set of data in grid edit, it could show all three errors at the same time. My question is, is there a way to show one error at a time until the user entering the data fixes the issue and then the system moves onto the next error? Does that make sense? I thought about employing an if statement instead of the list statement but QB errors on me. (These are data validation rules)
var Text checkInventoriedItem = If([Device Type - Make and Model] <> "" and Contains([Peripheral Plan], "Add new"),
"If assessing an inventoried item, choice in this field must be No change.");
var Text checkPeripheralTypTBD = If((([Peripheral Plan] = "Replace" or [Peripheral Plan] = "Add new") and [Peripheral Type to be Deployed] = ""),
"Or if you are adding a new peripheral than Peripheral to be deployed-replaced must be provided.");
var Text checkPeripheralTypNCTBD = If(([Peripheral Plan] = "No Change" and [Peripheral Type] = ""),
"If you are adding an inventoried peripheral than Peripheral type must be provided.");
List(",", $checkInventoriedItem, $checkPeripheralTypTBD, $checkPeripheralTypNCTBD)
Thank you!!
------------------------------
Brandon Owens
------------------------------
I have a code below that works fine but the request was made to make the errors show one at a time. If you read the code, it has three separate error messages. If the user is entering a large set of data in grid edit, it could show all three errors at the same time. My question is, is there a way to show one error at a time until the user entering the data fixes the issue and then the system moves onto the next error? Does that make sense? I thought about employing an if statement instead of the list statement but QB errors on me. (These are data validation rules)
var Text checkInventoriedItem = If([Device Type - Make and Model] <> "" and Contains([Peripheral Plan], "Add new"),
"If assessing an inventoried item, choice in this field must be No change.");
var Text checkPeripheralTypTBD = If((([Peripheral Plan] = "Replace" or [Peripheral Plan] = "Add new") and [Peripheral Type to be Deployed] = ""),
"Or if you are adding a new peripheral than Peripheral to be deployed-replaced must be provided.");
var Text checkPeripheralTypNCTBD = If(([Peripheral Plan] = "No Change" and [Peripheral Type] = ""),
"If you are adding an inventoried peripheral than Peripheral type must be provided.");
List(",", $checkInventoriedItem, $checkPeripheralTypTBD, $checkPeripheralTypNCTBD)
Thank you!!
------------------------------
Brandon Owens
------------------------------