Making Editable False in List Form

vipinkuruvillavipinkuruvilla Member Posts: 143
Hai All,

Is it possible to make all the fields in a list form as non editable depending on a certain condition??
If yes kindly let me know how i can implement the same.

Thanks a lot in advance.....

Comments

  • kapamaroukapamarou Member Posts: 1,152
    CurrForm.EDITABLE(MyBoolCondition);
    OR
    CurrForm.EDITABLE := MyBoolCondition;
  • kinekine Member Posts: 12,562
    But of course, it will work for whole table, not only for one line... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • MBergerMBerger Member Posts: 413
    kine wrote:
    But of course, it will work for whole table, not only for one line... 8)
    But this WILL work if you put it in the OnAfterGetCurrRecord of the form !
  • kinekine Member Posts: 12,562
    But still, switching whole table, not only the particular line... and this lead to some visual discrepancies which can confuse someone... ;-)

    BUt I do not know if vipinkuruvilla requested this per line or per table is ok for him...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • vipinkuruvillavipinkuruvilla Member Posts: 143
    MBerger wrote:
    kine wrote:
    But of course, it will work for whole table, not only for one line... 8)
    But this WILL work if you put it in the OnAfterGetCurrRecord of the form !

    I like to get this done not in whole form but in a line.
  • MBergerMBerger Member Posts: 413
    I like to get this done not in whole form but in a line.
    There is no way to disable a line, nor is there a way to disable a tablebox control via code. The only ways are either doing the whole form ( and if it's a listform without any other controls that will LOOK the same as if you did just a line ), or do it for each and every field.
  • vipinkuruvillavipinkuruvilla Member Posts: 143
    MBerger wrote:
    I like to get this done not in whole form but in a line.
    There is no way to disable a line, nor is there a way to disable a tablebox control via code. The only ways are either doing the whole form ( and if it's a listform without any other controls that will LOOK the same as if you did just a line ), or do it for each and every field.

    But my requirement is as follows:

    consider there is a field called "a".

    if a <> 0 then i want that particular lines to be non editable. And editable for those lines where a = 0 ....

    Is this possible???
  • MBergerMBerger Member Posts: 413
    MBerger wrote:
    I like to get this done not in whole form but in a line.
    There is no way to disable a line, nor is there a way to disable a tablebox control via code. The only ways are either doing the whole form ( and if it's a listform without any other controls that will LOOK the same as if you did just a line ), or do it for each and every field.

    But my requirement is as follows:

    consider there is a field called "a".

    if a <> 0 then i want that particular lines to be non editable. And editable for those lines where a = 0 ....

    Is this possible???
    yes, just add this to the OnAfterGetCurrRecord of your form :
    currform.editable := ( a <> 0 ) ;
    
    You'll see that it works.
  • vipinkuruvillavipinkuruvilla Member Posts: 143
    But I had to put the code in the onFormat trigger of the form to make it run....

    Thanks a lot ......
Sign In or Register to comment.