Hi
I would like to validate that some fields is modified when the user want to update the record.
I have made corrections in the OnModify for table Job Journal Line.
TESTFIELD(Description);
When I try to insert a new record in the Job Journal and I don't update the field, I get an error that Description must be entered, when I then try to modify the field, I get an error that the uniq keys is wrong. I seens like it has thrown the connection to the record, when I trow an error.
I have tried to move the code to the page trigger, but without any result ](*,) .
Hope that someone can help me :-)
Kind regards
Kenneth Jarlshøi Bolø
Dynateam A/S
0
Comments
Feltet kan ikke valideres, fordi nøglefelter er ugyldige. :?
Best Regards,
Kenneth
Kenneth Jarlshøi Bolø
Dynateam A/S
In Table 210, in the OnModify trigger :
OnModify()
IF (Type = Type::Item) AND (xRec.Type = Type::Item) THEN
ReserveJobJnlLine.VerifyChange(Rec,xRec)
ELSE
IF (Type <> Type::Item) AND (xRec.Type = Type::Item) THEN
ReserveJobJnlLine.DeleteLine(xRec);
// This is my code :
TESTFIELD(Description);
When I insert a record without a description, I get an error :
"Description must have a value in Job Journal Line: Journal Template Name = SAGER, Journal Batch Name=STANDARD, Line No.=190000. It cannot be zero or empty."
Then I update the field, but I can't do that ](*,)
Kenneth Jarlshøi Bolø
Dynateam A/S
"Delete cannot be performed since it has a key error."
Please help, I think that I have to contact Microsoft. :roll:
Kenneth Jarlshøi Bolø
Dynateam A/S
The error states that Description value is missing...
When you dont provide TESTFIELD with the second argument, then the value is checked for not being empty.
http://msdn.microsoft.com/en-us/library/dd301274.aspx
But consider stepping back from what you're doing, and do some studying and training before proceding further.
As a partner you have access to all the training material, even instuctor material on partnersource :thumbsup:
Johannes Sebastian
MB7-840,MB7-841
If have tried to change the code to :
IF Description = '' then
error('Description must be entered');
But with same result.
The problem is not the check, but the possibility to change the data after the error.
Kenneth Jarlshøi Bolø
Dynateam A/S