Options

Page field editable/visibile property in a extension

First I know how to set the editable/visibile property of a field on a page that is NOT what I am asking.

Am I missing something basic about extensions?

It is a common request from our users that based upon some business logic one or more fields on a page need to have their editable/visible property set (true/false). How can I do this as part of an EXTENSION?

In order to set the editable/visible property you must use code to to set a Boolean variable. First rule of extensions is "DO NOT make C/AL code modifications". So if you can't modified the code of the page object, where do you put the business logic that determines the editable/visible status?

Okay, so sounds like a job for an event. BUT the OnOpenPage event passes only the "Rec" variable of the page not the page object or it's global variables. So now what? You have an event but nothing to relate back to the sender of the event.

So I can't do this simple customization as an Extension?

Best Answer

Answers

  • Options
    greatscott001greatscott001 Member Posts: 32
    I am guessing (haven't tried it) that I could add a field to the "Rec" table and set that value in the OnOpenPage event and use that value as the editable/visible property of the page field but that is not a very elegant solution as it violates database normalization rules.

    If I could set the editable/visible property to the return value of a function I could put the logic in the table but I have not been able to make that work. I am not even sure a field value will work.
Sign In or Register to comment.