I m writing a nas service for entegration with other program. This service is create General Journal Line with any parameter. Outside program is fill a parameter table and call nas service with msmq. if nas service receive a any message in msmq process with ticket id and create jounal lines.
But I need catch error message in navision side and write parameter result table. For example currency code is not true , i want write a error message parameter result table. I was try write a function like bellow but it is not run. I think because my modify code is rolle back.
Also, I can use only for Custom ERROR message. I cannot use for default error message. for example
Currency Code 'USD_' does not exist.
How can I catch all navision error.
thanks.
IF ("Recurring Method" IN
["Recurring Method"::"B Balance","Recurring Method"::"RB Reversing Balance"]) AND
("Currency Code" <> '')
THEN BEGIN
//ISG001 16.12.2008 ICI BEGIN
//
SetWebError(STRSUBSTNO(
Text001,
FIELDCAPTION("Currency Code"),FIELDCAPTION("Recurring Method"),"Recurring Method"));
//ISG001 END
ERROR(
Text001,
FIELDCAPTION("Currency Code"),FIELDCAPTION("Recurring Method"),"Recurring Method");
END;
My functions
//set ticket id
SetWebTicketID(paramWebTicketID : Code[20])
WebTicketID:=paramWebTicketID;
//Write error message
SetWebError(ErrDesc : Text[250])
//ISG001 16.12.2008 ICI BEGIN
//
IF WebTicketID<>'' THEN BEGIN
"Business Process Order Header".RESET;
"Business Process Order Header".SETRANGE("Business Process Order Header".TicketID,WebTicketID);
IF "Business Process Order Header".FINDFIRST THEN BEGIN
"Business Process Order Header"."Error Desc.":=ErrDesc;
"Business Process Order Header".Result:="Business Process Order Header".Result::Error;
"Business Process Order Header".MODIFY;
END;
END;
//ISG001 END
Ibrahim COBANI | Dynamics-NAV Developer Team Manager
I m a Consult
E-Mail:
ibrahim@imaconsult.comMy BLOG0
Comments
viewtopic.php?t=28178
The basic approach should be described there. Don't hesitate to ask for details if you get stuck.
Thomas
my be I dont understand but this solution for like only "Yes We have a problem but I dont know what is problem". getlasterror function is great but we use 4.03.
I m a Consult
E-Mail: ibrahim@imaconsult.com
My BLOG
But as you're on version 4.03 that doesn't help - can you upgrade the client version to 5.0 and leave the objects alone? I did this for a client and it was a very quick easy way for them to support this new functionality with their NAS integration layer without going through all of th pain of upgrading their objects.
Epimatic Corp.
http://www.epimatic.com
Works like a charm!
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Yes, this is a very good workaround, we used it several times.
I m a Consult
E-Mail: ibrahim@imaconsult.com
My BLOG
NTimer have two Events - OnTimer and OnError. What is started in OnTimer and ends with error, the OnError is called adn it have one parameter - ErrorText...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
http://www.mibuso.com/forum/viewtopic.php?f=23&t=4636
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog