getDBField Syntax

 3 Replies
 1 Subscribed to this topic
 15 Subscribed to this forum
Sort:
Author
Messages
Garry Ferwerda
Basic Member
Posts: 20
Basic Member
    Hi:   Maybe someone can tell what I am doing wrong with this statement written against the GLMASTER table:

    user.isMemberOf('RSS-SHOPPING-IT') && trim(getDBField('GLACCMXVAL','MX-VALUE',getDBField('GLCHARTDTL','OBJ-ID',table.CHART_NAME,table.ACCOUNT,table.SUB_ACCOUNT),'RSS-ACCOUNT')) == 'Y'

    I am trying to limit access to accounts based on an attribute value.  I have tried numerous combinations of trim, lztrim and no matter what I have tried no acccounts are ever accessible.

    Thanks,
    John Henley
    Posts: 3353
      I do have some examples of how to do this (and I do feel your pain), and will post them next week.
      Thanks for using the LawsonGuru.com forums!
      John
      Garry Ferwerda
      Basic Member
      Posts: 20
      Basic Member
        Thanks John. I did figure out what the problem was. I needed to specifiy the index to use when accessing the GLCHARTDTL table. Here is the working version:

        user.isMemberOf('RSS-SHOPPING') && trim(getDBField('GLACCMXVAL','MX-VALUE',getDBFieldByIdx('GLCHARTDTL','OBJ-ID','GDTSET2',table.CHART_NAME,table.ACCOUNT,table.SUB_ACCOUNT),'RSS-ACCOUNT'))== 'Y'

        I am not trying to understand how the isElementGrpAccessible works.
        Garry Ferwerda
        Basic Member
        Posts: 20
        Basic Member
          Typo in previous post.

          meant to say I am now trying to understand how the isElementGrpAccessible works.