Hi All
I have question about one strange behavior of Sales Header (Sales Order). Here is the thing:
I should do simple thing: When “Sell to Cust. No.“ is entered in a Sales Order and a comment exists for this customer, a message should appear: 'Cust comment exist'
I add only this code in a OnValidate trigger of 'Sell-to-Customer No." in Sales Header table:
IF "Document Type" = "Document Type"::Order THEN BEGIN
CommentRec.SETRANGE("Table Name",CommentRec."Table Name"::Customer);
CommentRec.SETRANGE("No.","Sell-to Customer No.");
IF FINDFIRST THEN
MESSAGE(TEXT001);
END;
(There is no other code in this trigger (only standard and this above))
After adding of this code , when I try to create new Sales Order, and filling 'Sell-to-Customer No." field appears this NAV msg:
"Do You like to rename the record?"
I don't get why this msg appears, what is reason for that? When I remove custom code (that one above), that msg doesn't appear when I choose 'Sell-to-Customer No."
and 'Sell-to-Customer No." field is not set as a part of primary key, so how I am renaming the record with choosing customer? I am a little confused.
Can anybody tell me the reason for this?
And what to be done for avoiding this?
Thanks in advance