Can we change field propert of a Table or Form at run time.

lakshman
lakshman Member Posts: 44
Hi Experts ,

Can we change field property of a table or form at run time.
My Requirement is ,i want to change editable property of some field in some table when i am running some code unit. (not only editable property or enable or minimum value, Maximum value properties). is it possible in Navision please Suggest me.



Thanks & Regards

Lakhsman
Best Regards,
Lakshman Routu
http://lakshman-routu.blogspot.in/

Comments

  • matttrax
    matttrax Member Posts: 2,309
    Editable doesn't mean that you can't change the field through code. Your end goal can be accomplished, but not the way you're thinking of going about it.

    If you don't want to change the field in your codeunit, then don't write code to assign a new value to it.

    If you do want to and want to enforce minimum and maximum values add code to that fields OnValidate trigger or create a custom function to check the allowed range.
  • kine
    kine Member Posts: 12,562
    balance(LCY) is calculated field, you never change it, you change the data in Customer Ledger Entry and this field is calulated from the data when CALCFIELDS is called.

    What is the real problem you want to solve?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • kish2007
    kish2007 Member Posts: 64
    Is there any possibility to change the filelds in forms (like Editable and Visible).

    Normally we use Currform.name.editable(false);

    Is there any way to change the Field Type without using the fieldname
    (Currform.name.editable(false).


    Thanks & Regards,
    Kishore...
  • kine
    kine Member Posts: 12,562
    If you mean to reffer the control in some dynamic way without hardcoding the control name, no - there is no way by default. You can only create some automation which will help you to set some properties of controls on the form, but there is no way directly from C/AL.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • lakshman
    lakshman Member Posts: 44
    Hi kine,


    Can you suggest me how to create Automation for changing field Property Dynamically.



    Thanks & Regards

    LAKSHMAN
    Best Regards,
    Lakshman Routu
    http://lakshman-routu.blogspot.in/
  • kine
    kine Member Posts: 12,562
    Sorry, I cannot, I am not skilled in this area (for now... :-D)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.