NetTalk Central

Author Topic: Read Only If Condition  (Read 4079 times)

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Read Only If Condition
« on: November 13, 2012, 04:05:25 AM »
Hi Bruce,

I noticed it before, but forgot about it.  There appears to a bug in the above in the Read Only IF: Condition

inlist(p_web.gsv('OQ:OptionType')=1,4,8) only work for the first item, ie 1.

whereas

p_web.gsv('OQ:OptionType')=1 or p_web.gsv('OQ:OptionType')=4 or p_web.gsv('OQ:OptionType')=8

works.

Thanks
Charl

PS. I did not bother to make an example as this is straightforward.



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Read Only If Condition
« Reply #1 on: November 13, 2012, 10:08:51 PM »
Hi Charl,

I think your syntax is wrong. Try

inlist(p_web.gsv('OQ:OptionType'),1,4,8)

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Read Only If Condition
« Reply #2 on: November 14, 2012, 01:27:21 AM »
Nope, that was a typo.  It definitely acts as I described. I checked again :)

Thanks

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Read Only If Condition
« Reply #3 on: November 14, 2012, 09:58:52 PM »
then I guess you'll need to make an example (tweak one of the shipping ones).
'cause when I tried here it seemed to work ok - so I'm missing some part of the equation.

cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Read Only If Condition
« Reply #4 on: November 15, 2012, 02:31:02 AM »
Yes, I think I forgot to add it happens on a _Button_.

Sorry for that.

I added a YesNo field to the web1 example Mailboxes file, and added it as a button to the form with Read Only If condition:

inlist(p_web.gsv('MAI:SizeLimit'),1,4,8)

You'll notice when size limit is 1 it is Read Only, when Size limit is 4 or 8 it is not.

Cheers
Charl


[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Read Only If Condition
« Reply #5 on: November 15, 2012, 11:38:49 PM »
this is one of those cases when
"What goes without saying"
goes better with saying.

ie be more explicit in your test.

inlist(p_web.gsv('MAI:SizeLimit'),1,4,8) > 0

is better than just

inlist(p_web.gsv('MAI:SizeLimit'),1,4,8)

Because ultimately this condition is placed in a CHOOSE statement, and Choose has 2 forms, and because InList returns a number it uses the wrong form.

cheers
Bruce