Conditional Visibility Triggered by Stock Codes

For ideas, tips and tricks and comments on using or creating MoneyWorks Forms (invoices, statements, labels etc.),
Forum rules
This forum is not the official Cognito Software support channel for MoneyWorks. If you need help from Cognito, then please contact us (or your local regional support representative) directly using the contact information on the Support page of the web site.

Please try the search facility before posting a new topic to see if your topic has already been covered.

If you do post a new topic, it's a good idea to choose a Topic Subject that it a bit more informative than "Help!" or "A problem". If your topic is actually recognisable by people scanning the forum, you'll have a much better chance of getting a response. Thanks and have fun.
Post Reply
tonydrake
Posts: 2
Joined: 18 Nov 2013 17:01
Product: Datacentre
Region: New Zealand

Conditional Visibility Triggered by Stock Codes

Post by tonydrake » 18 Nov 2013 17:14

I am trying to determine visibility of an item on a form depending on stock code. I have been attempting to use ExpandDetail to count the matching items, ie a result greater than zero being true.

I can get a result for a specific code, using:
Count(ExpandDetail("Detail.StockQty", "Detail.StockCode = \"1101\""))

However, the codes I am searching for end in "01". I am having trouble with this and using the wildcards doesn't seem to be working for me. Any suggestions?

grant
Posts: 318
Joined: 02 Jun 2004 17:42

Re: Conditional Visibility Triggered by Stock Codes

Post by grant » 19 Nov 2013 08:18

If you only want a subset of items from the detail lines of a transaction to appear in an invoice/form, specify the criteria in the Search Function in the List Options. In your case, something like:

right(detail.stockcode, 2) <> "01"

should omit all items ending in "01". Of course you will need to make sure that the invoice total is still correct.

tonydrake
Posts: 2
Joined: 18 Nov 2013 17:01
Product: Datacentre
Region: New Zealand

Re: Conditional Visibility Triggered by Stock Codes

Post by tonydrake » 20 Nov 2013 05:29

Thanks. Actually I don't need to display list at all, I am just after a count result. I am making the visibility of an image dependant on a count > 0.

I can make it work for specific codes or based on the beginning of a code (e.g. "1@"), but not for codes ending in "1".

Simon
Posts: 166
Joined: 25 Aug 2004 16:00
Region: New Zealand
Location: Auckland
Contact:

Re: Conditional Visibility Triggered by Stock Codes

Post by Simon » 13 Dec 2013 14:46

Try using right(detail.stockcode,2)=`01`

Post Reply