Disable F4

abhi1901abhi1901 Member Posts: 102
Hi,

How can we disable F4 on form depending upon the records.

Ex. for a certain field type say check.
if check=false then

while pressing F4 nothing should happen.

Please suggest me the method to do so.

Comments

  • ChinmoyChinmoy Member Posts: 359
    Disabling F4 is not possible in NAV.

    However, changing the Editable property of the Form can be used to block deletion.

    Create a function in the form, lets say, EnableDisableForm() and put the following code in it:

    IF Check = FALSE THEN
    CurrForm.EDITABLE(FALSE)
    ELSE
    CurrForm.EDITABLE(TRUE);

    Call this function in the Form OnAfterGetRecord function.
  • krzychub83krzychub83 Member Posts: 120
    Try to return FALSE in the Form - OnDeleteRecord trigger of the form if the record shouldn't be deleted.
  • abhi1901abhi1901 Member Posts: 102
    Chinmoy wrote:
    Disabling F4 is not possible in NAV.

    However, changing the Editable property of the Form can be used to block deletion.

    Create a function in the form, lets say, EnableDisableForm() and put the following code in it:

    IF Check = FALSE THEN
    CurrForm.EDITABLE(FALSE)
    ELSE
    CurrForm.EDITABLE(TRUE);

    Call this function in the Form OnAfterGetRecord function.



    Thanks Chinmoy.

    I already had find this way..But forgot to update.
Sign In or Register to comment.