NetTalk Central

Author Topic: Displaying a generated conditional valu in a Browse column  (Read 3860 times)

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Hi

I have a file which has a field 'Business Type' which can have the values 0-3.  I want to have this field in the Browse but with an alpha decode of the numeric viz 0 means 'Inactive', 1 means 'Free' etc.

So, I added four conditions to the 'Conditional' tab on the template for the field viz: p_web.gsv('FND:BusinessType')=0 and set 'Display' to 'Inactive' with a picture of '@s8' and so on for the other three options.

What was displayed though was 'Inactive' for all of the Browse records whether the 'Business Type' was 0 or not.  The generated code looked good viz:

    if false
    elsif p_web.gsv('FND:BusinessType')=0 ! alternative condition for column
      loc:extra = ''
      packet.append(p_web.DivHeader('browseFindaPet_FND:BusinessType_'&FND:RecordId,,net:crc,,loc:extra))
              packet.append( p_web.CreateHyperLink(p_web._jsok(Left(p_web.mformat('Inactive','@s8')),(Net:HtmlOk*0)+(Net:UnsafeHtmlOk*0)),,,,loc:javascript,,,(Net:HtmlOk*0)+(Net:UnsafeHtmlOk*0),,,'browseFindaPet'))
    elsif p_web.gsv('FND:BusinessType')=1 ! alternative condition for column
      loc:extra = ''
      packet.append(p_web.DivHeader('browseFindaPet_FND:BusinessType_'&FND:RecordId,,net:crc,,loc:extra))
              packet.append( p_web.CreateHyperLink(p_web._jsok(Left(p_web.mformat('Free','@s4')),(Net:HtmlOk*0)+(Net:UnsafeHtmlOk*0)),,,,loc:javascript,,,(Net:HtmlOk*0)+(Net:UnsafeHtmlOk*0),,,'browseFindaPet'))

It looks as if the display should vary depending on the value of FND:BusinessType but it doesn't.

I am obviously misunderstanding something about how this works.

Thanks for any help.

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Displaying a generated conditional valu in a Browse column
« Reply #1 on: May 24, 2015, 03:56:28 AM »
Hi

I normaly use CHOOSE(MY:FIELD+1,'Value1',Value2') in the Display.

Regards Niels

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Displaying a generated conditional valu in a Browse column
« Reply #2 on: May 24, 2015, 05:13:07 PM »
Thanks Niels - works perfectly.

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27