Question on Filtering records. SetRange

lmergirbaudlmergirbaud Member Posts: 6
Hi guys,
I just wanna ask about the alert message: "<Table Name> cannot be modified on this form."

Here's the scenario.
Im tryin to create an inquiry type form with navision table in it and a textbox where i'll enter the value to query.
In OnValidate trigger of the textbox, i create a code to set the range of the Rec to what will be the value of textbox; Rec.SetRange(column, textbox).
It actually works fine filtering the records, but when i click on the table, an alert message pops out: "<Table Name> cannot be modified on this form." Upon inspection, it is default that navision always add a new line, so when you try to go out of that line, it thinks that you are trying to save a line, in which navision doesn't permit you to.
Is there a way for these not to occur, maybe at least for the alert message not showing up? Or could it be a limitation?

Thank you very much...

Elmer Evangelio

Comments

  • krikikriki Member, Moderator Posts: 9,118
    Some things you can try:
    -add this behond your filtering code: this selects current record if it is in the filter, if not it tries to search the first record (if one is in the filter), then it does a refresh of the form. Probably this will be enough.
    "IF NOT FIND('=') THEN
      IF FIND('-') THEN ;
    CurrForm.UPDATE(FALSE);
    
    -Form-property InsertAllowed=No
    -Form-property DelayedInsert=Yes
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • lmergirbaudlmergirbaud Member Posts: 6
    Thank you very much for the quick reply.

    It is now working...there's a bit of error when currform line is placed in OnValidate trigger, i just put it in OnAfterValidate trigger. I didn't even applied the changes to the properties. But its already working...I'll just try to see its effect.

    Anyway, Thank You very much...
Sign In or Register to comment.