Hi,
I'm having number field where i was checking the requested tickets are greater than available and showing error as shown below:
If(
(DValue_TRequest.Selected.Value = "General" && Value(GTickets.Text) > Value(A_GenTickets.Text)) || (DValue_TRequest.Selected.Value = "VIP" && Value(VIPTickets.Text) > Value(A_VIPTickets.Text)),
"Requested tickets are more than available tickets",
Blank()
)
But, when i try to enter -1 in requested where the available is 0, it is not throwing any error ? am i doing any wrong here ?
Solved! Go to Solution.
Please try:
The key is that 0 is indeed greater than -1. According to the logic of your formula, no error will be reported.
So,I suggest you add a judgment condition "check whether the inventory is less than or equal to 0",For example:
If(
(
DValue_TRequest.Selected.Value = "General" &&
(Value(GTickets.Text) > Value(A_GenTickets.Text) || Value(A_GenTickets.Text)<=0 )
)||
(
DValue_TRequest.Selected.Value = "VIP" &&
(Value(VIPTickets.Text) > Value(A_VIPTickets.Text) || Value(A_VIPTickets.Text)<=0)
),
"Requested tickets are more than available tickets",
Blank()
)
Best Regards,
Bof
Hi @Sharuk ,
If DValue_TRequest a combobox control ? Have you select a value for this control before you get this behavior ?
Sincerily I prefer for combobox:
First(DValue_TRequest.SelectedItems).Value
Hope it helps !
Please try:
The key is that 0 is indeed greater than -1. According to the logic of your formula, no error will be reported.
So,I suggest you add a judgment condition "check whether the inventory is less than or equal to 0",For example:
If(
(
DValue_TRequest.Selected.Value = "General" &&
(Value(GTickets.Text) > Value(A_GenTickets.Text) || Value(A_GenTickets.Text)<=0 )
)||
(
DValue_TRequest.Selected.Value = "VIP" &&
(Value(VIPTickets.Text) > Value(A_VIPTickets.Text) || Value(A_VIPTickets.Text)<=0)
),
"Requested tickets are more than available tickets",
Blank()
)
Best Regards,
Bof