BUG NAVISION? TableRelation & INSERT
I Have the table with field Ship-to-Code.
Ship-to-Code have properties
TableRelation="Ship-to Address".Code WHERE (Customer No.=FIELD(Cust No.))
ValidateTableRelation=Yes
1) I change "Cust No." (Ship-to-Code remain from old customer)
2) insert
(not with C/AL. With my hands).
The system allow to insert record with wrong Ship-to-Code !!!
Is it BUG? May be hotfix exists?
P.S. Only VALIDATE("Ship-to-Code") in triger OnInsert helps.
Comments
VALIDATE("Ship-to Code",'');").
The question is: why the code is there after you change the Customer No.??? Are you changing the Customer No. with C/AL code without Validating? Yes? -There is problem. If no, and you changed the code manually (on form), problem is that someone modified the OnValidate trigger...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
But I think that system must look at TableRelation before insert record.
Programmer say to system "This field have this table relaton". And I consider that he should not write additional code to control relations. IT IS THE BUG in my opinion.
P.S. Programmer must write additional code to control relations only if he insert(modify) the record by C/AL
If system check table relation on insert - then we can skip VALIDATE("Ship-to Code",'');") in code above
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
However, it is what it is. You want to make sure the ship-to is correct, you must validate the value. This is a 1.364 second job (the time to type in the word VALIDATE, which of course goes down the more you type it ) and we can all move on with our lives.
Don't fight Navision, just learn the features and use them. One day you will be happy that you can store an 'non-valid' value in such a field.
RIS Plus, LLC
The difference is that in Navision you have to define the same thing twice. First on the table itself, and then another time in the code of the table, while if you use referential integrity, somthing SQL Server fully supports, you can define it in one place and have the DB Server take care of it for you.
I know that it need 1 sec to write VALIDATE. I did it before post topic.
I thought that it wrong. But Kine explain
So I understood my mistaken opinion.
Thanks to all.
Topic is closed