Empty subform remains disabled

ameramer Member Posts: 22
I was trying to implement "edit" mode for Card-Type forms to prevent accidental modifications (using checkbox or button to switch Form.EDITABLE property).
If a subform exists, e.g. "Fixed Asset Card" Form with DepreciationBook subform, there is a problem.
If you place a button with following code, subform (if empty) remains disabled forever.
 CurrForm.EDITABLE :=NOT CurrForm.EDITABLE;
(NAV 4.0 SP3)

Any ideas?

Thanks in advance!

Comments

  • BeliasBelias Member Posts: 2,998
    it's the way it is...
    add this after your code
    IF table ISEMPTY then
      currform.editable := true;
    
    p.s.: there are many better designs than this...but i should write more code... :mrgreen:
    btw, the concept is this one
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • ameramer Member Posts: 22
    Hello,
    I tried to add suggested code to a subform (problem is when subform record is empty) but it does not help because it seems problem is with "enabled" (set by NAV at run-time) not "editable".

    Regards,
    Amer
  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    Hi Amer,
    I tested for Fixed Asset Card
    CurrForm.EDITABLE :=NOT CurrForm.EDITABLE;
    
    in 4.0 SP3, and it works fine for me i.e. subform (if empty) doesn't remain disabled forever. Can you please check it in the fresh Cronus DB and confirm....??
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • EugeneEugene Member Posts: 309
    is your form in lookup mode ?
  • ameramer Member Posts: 22
    Sorry, there is additional line to add to generate the problem:
    Form - OnOpenForm()
    CurrForm.EDITABLE:=FALSE;
    

    Forms are not in Lookup mode, no other modifications at all.

    Regards,
    Amer
Sign In or Register to comment.