Skip to Content
author's profile photo Former Member
Former Member

UI: Enable/Disable UDF's in Code

Hi all,

is it possible to make UDF's enabled or disabled in code? For example, in Item Master Data, I can each item

make disabled with:

Set oForm = GetFormByTyp(150, 1)

Set oItem = oForm.Items.Item("5")

oItem.Enabled = False

...

but in UDF's window, I cannot do the same:

Set oForm = GetFormByTyp(-150, 1)

Set oItem = oForm.Items.Item("udfField")

oItem.Enabled = False

...

Can anybody help?

I use SBO6.50.097 SP01 EF:07

Regards

Libor.

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Posted on Jul 27, 2004 at 01:32 PM

    Hi Libor,

    the form has to be open for this method to work. I had the same problem so I moved the method to a button click event instead of a form load and it works now.

    kind regards

    Jacintha Murphy

    SAP Business One Support

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 27, 2004 at 02:24 PM

    Hi Jacintha,

    thank's for your reply. But when I start my code, always comes this warning:

    "Item - this item is not a user-defined item an cannot be manipulated in such manner"

    My UDF's form -150 is always opened and each EditBox I want to make disabled is my own user-defined field. What's your opinion? Have I forgot something?

    Thanks and regards

    Libor.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Libor,

      Update the UDF's on FORM_ACTIVATE instead on FORM_LOAD.

      Then all the controls are available to access/modify.

      Regards,

      Gerold