GetDBField

 3 Replies
 0 Subscribed to this topic
 16 Subscribed to this forum
Sort:
Author
Messages
Jay2
Veteran Member Send Private Message
Posts: 84
Veteran Member
I am trying to secure AP90.3 using the following rule:

isElementGrpAccessible('EGProcLevelAP','','AP',getDBField('APINVOICE','PROC-LEVEL',form.API_COMPANY,form.API_VOUCHER_NBR))

When I check the log it shows that it is not returning the PROC-LEVEL value:

2011-02-28 15:08:06 com.lawson.lawsec.default.FINEST com.lawson.lawsec.author.runtime.JSRMFactory.getDBField()()
input parameters:
userId=Jeremy.Test
dataSource=INTTEST
tableName=APINVOICE
fieldName=PROC-LEVEL
keys=10, 174785,

2011-02-28 15:08:06 com.lawson.lawsec.default.FINEST com.lawson.lawsec.author.runtime.JSRMFactory.getDBField()()
return

 

But it is not working.  Is it because VOUCHER-NBR is not a key value?

Dave Amen
Veteran Member Send Private Message
Posts: 75
Veteran Member
When you use getDBField, it follows the primary index on the table - APISET1 in this case.

With that, you have to supply ALL of the keys in order for it to succeed - Company, Vendor, Invoice (and Suffix, Cancel_Seq if they are non-zero values).

If you don't have those keys, you may need to use a different index on the table, in which case you'd use getDBFieldByIdx which lets you specify any index you'd like to use.

You've undertaken a challenging requirement here since the APINVOICE indexes are somewhat involved. Does my answer give you enough to move forward with?

Best regards,
Dave
(303) 773-3535
Jay2
Veteran Member Send Private Message
Posts: 84
Veteran Member
Gives me a little better understanding.

I will let you know how it turns out.

Jay
Jay2
Veteran Member Send Private Message
Posts: 84
Veteran Member
Ok, this is not going to work. I tried to use the index APISET4 but I am not able to pull in all of the values needed.

Do you know if there is a way in AP90.3 to only allow users to choose from the drop-down list, rather than enter a voucher number manually?

These may seem like stupid questions, but I came into this position after we went live with this system and never actually had the Lawson training on security. Any help would be greatly appreciated.

thanks

Jay
603-271-7807