Jump to content

Too Many Seperators


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

Recommended Posts

Hey there,

I have created a field definition that tells me too many seperators and i was wondering how many and clauses can you put in a Case.

Or am i doing something else wrong.....Here it is:

[color:"red"]

* Note, if i take out the section in red, it works. But i need it in there help!!

If(cLineItemType = "Product",

Case(ProductStatus = "Reserved",1,

[color:"red"]

Left(max(ProductLineInvoice::cInstockCheck,1) = 1 and max(ProductLineInvoice::cInstockCheck) <> cInstockCheck and Products Current Bypass::ProductUpsell = "Yes" and Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

0),1)

Regards,

Kerrin smile.gif

Link to comment
Share on other sites

Well,

not sure why you are trying to place a Case inside an IF statement.

And the too many seperators is in reference to the ,

You can do all this inside the Case statement.

so start with case

Case(

Criteria1, result 1,

Criteria 2, result 2,

Criteria 3, Result 3 etc

)

Link to comment
Share on other sites

Hi, thanks for looking but i worked it out.

I was missing a ) on the following line before the comma..... silly me.

Left(max(ProductLineInvoice::cInstockCheck,1)

Regards,

Kerrin

If(cLineItemType = "Product",

Case(ProductStatus = "Reserved",1,

Left(max(ProductLineInvoice::cInstockCheck,1) = 1 and max(ProductLineInvoice::cInstockCheck) <> cInstockCheck and Products Current Bypass::ProductUpsell = "Yes" and Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

0),1)

PS. I put the case statement inside the If statement so save adding and cLineItemType = "Product" to every case wink.gif

Link to comment
Share on other sites

Hi,

Can you suggest a better way?

What i want is

If(cLineItemType = "Product",

Then do all these case things.......

Case(ProductStatus = "Reserved",1,

Left(max(ProductLineInvoice::cInstockCheck,1) = 1 and max(ProductLineInvoice::cInstockCheck) <> cInstockCheck and Products Current Bypass::ProductUpsell = "Yes" and Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

0), otherwise return the value 1

It seems logical to me.

Kerrin

Link to comment
Share on other sites

case stops evaluating after first match so...

Case(cLineItemType != "Product",1,ProductStatus = "Reserved",1,

Left(max(ProductLineInvoice::cInstockCheck,1) = 1 and max(ProductLineInvoice::cInstockCheck) <> cInstockCheck and Products Current Bypass::ProductUpsell = "Yes" and Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

0)

is prefered solution

Dj

Link to comment
Share on other sites

I C Now! it is all becoming clear shocked.gif

Only had to change the ! = on the first line to <> but besides that it works. Thanks.

Case(cLineItemType <> "Product",1,ProductStatus = "Reserved",1,

Left(max(ProductLineInvoice::cInstockCheck,1) = 1 and max(ProductLineInvoice::cInstockCheck) <> cInstockCheck and Products Current Bypass::ProductUpsell = "Yes" and Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

Quantity <= Products::StockSelection and CQuantityTotal <> CQuantityCount,1,

0)

Link to comment
Share on other sites

Where djukic comes from, "!=" probably has widely understood meaning.

It can be hard to follow, when things are written in a way that is not how they appear in FileMaker.

Some of us are just ordinary folks, though, and we need things explained. I guess that's why we are visiting the forum in the first place. smile.gif

Thanks to Tintagel I think I understand too, now! smile.gif

Link to comment
Share on other sites

This topic is 7911 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.