Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6522 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have done that script to make sure the appropriate invoice is created and that the invoice will go in the right folder but it doesn't seem to work.

When I click on the button, only the If/Else with SP72, SP144, SP216 seem to be working but not the H125, etc...ones...

What am i doing wrong ?

Posted

... Once one If / Else If evaluates to true, the if statement is considered completed so it exits it... If you want ALL of them to evaluate:

If[condition 1 ]

#Do X

End If

If[condition 2 ]

#Do Y

End If

If conditions 1 and 2 are both true above, both X and Y will be done

If[condition 1 ]

#Do X

Else If[condition 2 ]

#Do Y

End If

If conditinos 1 and 2 are both true above, only X will be done -- FM doesn't care about condition 2 because condition 1 evaluated to true..

Posted

I really don't get it...there are 2 main things in my if...the meanTocommunicate (EMAIL,POST,FAX) and the packageID (SP72,SP144,SP216,H125,H1210, etc...) that will create a different document. Why doesn't it work.

my script is:

If[condition 1]

#Do A

Else If[condition 2]

#Do B

Else If[condition 3]

#Do C

Else If[condition 4]

#Do D

Else If[condition 5]

#Do E

Else If[condition 6]

#Do F

End If

The conditions are really distinct so condition 1 cannot really be confused with another one so on and so forth.

If all along, condition 1, 2,3,4,5 are not validated... only condition 6 should happen...right ?

What is wrong in my script?

Posted

Else If[ ] should work fine. However, your syntax for determining the packageID is incorrect. Instead of:

PackageID = "a" or "b"

you need to use:

PackageID = "a" or PackageID = "b"

It seems you could also streamline this a bit, by grouping all the common steps and placing them outside the If structure, e.g.

If [ POST ]

# common stuff for POST

If [ Package type A ]

# stuff for type A

Else If [ Package type B ]

# stuff for type B

End If [ ]

# more common stuff for POST

Else If [ FAX ]

# common stuff for FAX

If [ Package type A ]

...

This topic is 6522 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.