4 Replies Latest reply on Mar 10, 2015 10:49 AM by Annette

    Multiple If statement in Script not working

    Annette

      Title

      Multiple If statement in Script not working

      Post

      Hi guys,

      I have two fields, I'll call Field 1 and Field 2.  Basically what I'm tryint to do in a script is perform a find based on whichever field I've completed.  Both fields are dropdown lists, I was tyring to use if statements to create a variable using whichever of the two I selected, go to a layout, enter find mode, set fields and perform the find.  If both fields were left blank a custom dialogue would come up stating one of the two fields needed to be selected.  Ive tried it multiple ways, using if, else if, etc but never works fully.  Any help would be grately appreciated.  I'm going to quickly write out summary of what I have.....

      If [ IsEmpty(field 1)] and IsEmpty (Field 2) show custom dialogue please choose one of the options

      Else If [ IsEmpty (field 1)] set variable $$option = Field 2

      else if [ IsEmtpy (field 2)] set variable $$option = Field 1

      Go to layout, enter find mode, set field...etc etc. perform find, end if

      I have tried so many different combinations now I'm not sure where I am....swapping If's for else if's, moving the order, etc.  Please help.