Hi All,
I am having one doubt . I am inserting some entries to Item. We know that Item No is code of 20 char and in case if I am inserting a item with more than 20 char then when I use GETLASTERRORTEXT function will it capture the error . I need to store the error when I am inserting the field in log table.
Since When it reads the lines
recitem.no = some text more than 20 char then nav will stop in this line so where can I place the function GETLASTERRORTEXT.
If anyone knows how to address this problem , kindly let me know.
Thanks in advance.
Regards,
chandru.
0
Comments
To be honest i haven't checked this by trying, but I have always taken GETLASTERRORTEXTbeing the latest error thrown based on C/AL code execution (so based on ERROR, TESTFIELD, FIELDERROR).
In your case, where you would like to catch the error based on the entering of more chars than allowed, this error is a platform and as such not based on C/AL code. I do not think that GETLASTERRORTEXT will catch that.
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
IF NOT mycodeunit.RUN() THEN BEGIN
Errorlog.init;
Errorlog."Entry No." := nextentryno;
Errorlog.text := GETLASTERRORTEXT;
Errorlog.INSERT;
END;