Editable property (form controls)

alex9alex9 Member Posts: 97
Hi,
Client wants to have Purchase Invoice form non-editable based on the Status field value in Purchase Header.
I put the following code to OnAfterGetRecord:
  IF (Status = Status::Released) THEN
   CurrForm.EDITABLE(FALSE)
  ELSE
   CurrForm.EDITABLE(TRUE);
It works fine, except users are not able to create new invoice from non-editable invoice with F3 button (or somehow else) anymore. I tried to make pages non-editable instead of the whole form, but I cannot do it dynamically. The same for the frame.
Any ideas how can I do that? Of course, I can change editable property for every single control on the form, but I am looking for some simplier solution.

Comments

  • matttraxmatttrax Member Posts: 2,309
    I'm afraid there's not one....at least not one that I have ever seen.
  • BeliasBelias Member Posts: 2,998
    Different approach: make an error in the ondelete/onmodify triggers of the page, based on the status field (not tested, it probably will close the page, but it's worth a try
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • vijay_gvijay_g Member Posts: 884
    one thing you can......
    place a command button New Invoice that would behave like f3 or new.
  • SogSog Member Posts: 1,023
    Or use the approach like in the RTC, a viewer and a editor, with a filter on status on the editor card
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • AndwianAndwian Member Posts: 627
    Similar with Sog, just imitate the behaviour of Purch. Invoice form and Posted Purch. Invoice form.
    Just throw the Released Invoice to the new customized form, which set the Form Properties:
    SourceTableView: Document Type=FILTER(Invoice),Status=FILTER(Released).
    
    And then simply make it
    Editable: No.
    
    Regards,
    Andwian
Sign In or Register to comment.