Hi
I have a standard section with a hide-when…the formula works ok in the inverse of what I need but if I tried to achieve the opposite result it doesnt work at all…
the following works:
approvalsrequired := @DbLookup(“”:“nocache”; “”; “lu_asset_class”; @Text(Class)
; “Approvals”);
show := @Contains(approvalsrequired; “Delivery”);
show
but if I change the last line to !show or create an if statement to reverse the result it does not work…
Any ideas greatly appreciated
Subject: Try x := !@Contains()
Subject: No luck…
not sure what logic its using…only seems to be accurate without the ‘inversion’
Subject: RE: No luck…
Have you tried putting the formula in a computed-for-display field or computed-text formula to actually see what the formula is returning?
Subject: getting close…
thanks Lawrence…when i do that I get what I expect on the forms with a class that includes the substring (eg. computed field gives: Billing; C&N; Delivery (QA1); Quality Assurance (QA 2/3); Systems)
but if the substring isnt in the lookup field i get an error opening the document: “field Untitled: Entry not found in index or index not built”
Do I need to somehow capture this error to get consistent results?
Subject: can’t invert @contains
show := @If(@Contains(approvalsrequired; “Delivery”);@False;@True);show
Reverse the @False/@True to get opposite results.
Subject: thanks - but
I have tried this same strange results…there is something more sinister here…but I dont know what to post to tell you…the approvals string is an editable dialog box field…could that have something to to with it? I’m using @text but it doesnt seem to make a difference. I don’t want to use exact text matching so prefer @contains to @IsMember.
Subject: RE: thanks - but
It wouldn’t have to do with the fact that @Contains is case-sensitive would it?
If so, then how about:
show := @If(@Contains(@UpperCase(approvalsrequired); “DELIVERY”);@False;@True);
show
Subject: RE: thanks - but
Just read some of your other comments…
You should always error check your Lookups…
approvalsrequired := @DbLookup(“”:“nocache”; “”; “lu_asset_class”; @Text(Class)
; “Approvals”);
tmp := @If(@IsError(approvalsrequired);“Delivery”;approvalsrequired);
show := @If(@Contains(tmp; “Delivery”);@True;@False);
show
If you want the hide when to hide when the lookup returns an error, then use the code example above; else, change the @If(@IsError to reflect something different in the ‘True’ position.
Subject: aahhh! - that was it,
To both Lawrences…thank you VERY much…I really appreciate your quick responses and perserverance…
have a Great Day (Night?)