malagasy Posted January 16, 2007 Posted January 16, 2007 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 ?
Genx Posted January 16, 2007 Posted January 16, 2007 ... 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..
malagasy Posted January 16, 2007 Author Posted January 16, 2007 So pretty much, I have to change all the else if by If and make sure the End If is there for each of the If ...right ? ;-)
malagasy Posted January 16, 2007 Author Posted January 16, 2007 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?
malagasy Posted January 16, 2007 Author Posted January 16, 2007 By the way, I just tried the If End if thing but it doesn't work
comment Posted January 16, 2007 Posted January 16, 2007 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 ] ...
malagasy Posted January 16, 2007 Author Posted January 16, 2007 IT's working. Thanks a lot...problems came from the syntax. CHEERS !!!
Genx Posted January 16, 2007 Posted January 16, 2007 Sorry, Looks like I made up a question to solve my self
Recommended Posts
This topic is 6914 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 accountSign in
Already have an account? Sign in here.
Sign In Now