Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

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

)

  • Author

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

You have not quite "worked it out" to good programming practice until you lose the if statement. wink.gif

-bd

  • Author

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

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

I'd take it that the "!=" in the above is meant to refer to the < > or not-equal-to operator?!

Alternative would be -

Case(not LineItemType = "Product",1, ...etc

yes != mean not equal

I've typed directly cLineItemType != "Product", while the rest was copy and paste from post I was replying

Dj

  • Author

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)

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.