Expand my Community achievements bar.

SOLVED

Multiple condition If and statement

Avatar

Level 4

I am using the if statement below on a button. What I would like to happen is if Name, Address, City, State, Zip and Member (fields) are empty you get the message Please complete all required fields or if the Member(field) (which is a yes=1, no=2) radio button equal 1 and eitehr Class, Room, Return or Local are empty you will get that same message. But if either of these conditions are met then it clicks the printbutton1.

if ((Name.rawValue == null) or

    (Address.rawValue == null) or

    (City.rawValue == null) or

    (State.rawValue == null) or

    (Zip.rawValue == null) or

    (Member.rawValue == null) or

then

xfa.host.messageBox("Please complete all required fields to print.")

elseif

    (Member.rawValue == 1) and

    (Class.rawValue == null) or

    (Room.rawValue == null) or

    (Return.rawValue == null) or)

    (Local.rawValue == null))

   

then

xfa.host.messageBox("Please complete all required fields to print.")

else

PrintButton1.execEvent("click")

endif

Any assistance would be greatly appreciated.

Thanks

Parre

1 Accepted Solution

Avatar

Correct answer by
Level 7

Try this (in formcalc):

if ((Name.isNull or Address.isNull or City.isNull or Zip.isNull or State.isNull or Member.isNull) or (Member == 1 and (Class.isNull or Room.isNull or Local.isNull))) then

    xfa.host.messageBox("Please complete all required fields to print.")

else

    PrintButton1.execEvent("click")

endif

View solution in original post

3 Replies

Avatar

Correct answer by
Level 7

Try this (in formcalc):

if ((Name.isNull or Address.isNull or City.isNull or Zip.isNull or State.isNull or Member.isNull) or (Member == 1 and (Class.isNull or Room.isNull or Local.isNull))) then

    xfa.host.messageBox("Please complete all required fields to print.")

else

    PrintButton1.execEvent("click")

endif

Avatar

Level 4

Thank you so much this worked great.

Avatar

Level 1

Hi

I need to put two conditions in my PAGINATION TAB of my sub form .

suppose vendor is not equal to previous vendor OR

              currency is not equal to previous curr . so it has to go and print in new page .

If i put one condition it is working fine but i want to check two condition how to write .

thanks

kiran