Microsoft.Dynamics.Nav.Runtime.INavRecordHandle is Unknown

Ravi_Thakkar
Member Posts: 392
Hello All,
I am working with NAV web services through VS 2008.
When I tried to execute one function of one codeunit of NAV published as a web-service, It got executed completely and after last line of function execution, I am gett9ing the following error:
"The type Microsoft.Dynamics.Nav.Runtime.INavRecordHandle is unknown."
Please help me if you have any idea.
Thanks.
I am working with NAV web services through VS 2008.
When I tried to execute one function of one codeunit of NAV published as a web-service, It got executed completely and after last line of function execution, I am gett9ing the following error:
"The type Microsoft.Dynamics.Nav.Runtime.INavRecordHandle is unknown."
Please help me if you have any idea.
Thanks.
0
Answers
-
how did you find out that it's the last line?
Also what kind of code are you executing?0 -
Actually, By putting the ERROR messages I tested that code.
Web Services are able to throw an error on web from NAV ERROR messages.
So, I put, ERROR message in last line of my function.
So, instead of showing "The type Microsoft.Dynamics.Nav.Runtime.INavRecordHandle is unknown." ERROR,
It displayed, my ERROR message on web.
So, I can come to know about the success of execution up to which line.0 -
can you paste your code. Are you doing anything special with your code?
I would like to replicate the issue.0 -
Below is my function in NAV :
ExpenseClaimedByEmployee(VAR PurchHeader_IRec : Record "Purchase Header")PurchHeader_IRec.TESTFIELD("Claim Status",PurchHeader_IRec."Claim Status"::Open); PurchHeader_IRec.TESTFIELD("Job No."); Resource_lRec.RESET; Resource_lRec.SETRANGE("No.",PurchHeader_IRec."Buy-from Vendor No."); IF Resource_lRec.FINDFIRST THEN Resource_lRec.TESTFIELD("Resource Group No."); UserSetup_lRec.RESET; UserSetup_lRec.SETRANGE("User ID",UPPERCASE(USERID)); IF UserSetup_lRec.FINDFIRST THEN UserSetup_lRec.TESTFIELD(UserSetup_lRec."Employee No.") ELSE ERROR(Text0033,USERID); Purchline_Lrec.RESET; Purchline_Lrec.SETRANGE("Document Type",Purchline_Lrec."Document Type"::Invoice); Purchline_Lrec.SETRANGE("Document No.",PurchHeader_IRec."No."); IF Purchline_Lrec.FINDSET THEN REPEAT IF Purchline_Lrec."Requested Amount" = 0 THEN BEGIN Flag_Lbool := TRUE; ERROR(Text0023); END; Purchline_Lrec."Manager Approved Amt" := Purchline_Lrec."Requested Amount"; Purchline_Lrec.MODIFY; UNTIL (Purchline_Lrec.NEXT = 0) OR Flag_Lbool; PurchHeader_IRec."Claim Status" := PurchHeader_IRec."Claim Status"::"Pending Approval"; PurchHeader_IRec."Document Date" := WORKDATE; PurchHeader_IRec.MODIFY; ApprMgt_gCdu.InsertApplApprovalEntry(PurchHeader_IRec); ERROR('ABC');
It is giving me the result in exception : ABC
That means successful execution of whole function up to ERROR('ABC') stmt.
If i am not putting the ERROR('ABC') stmt then it is showing me the error
Microsoft.Dynamics.Nav.Runtime.INavRecordHandle is Unknown
Can you help me?0 -
What if you remove the VAR on the parameter?Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
I have used this codeunit function as an extension codeunit due to my need of Record Variable as a parameter.0
-
Yes, but your function is declared with a VAR parameter:
ExpenseClaimedByEmployee(VAR PurchHeader_IRec : Record "Purchase Header")
This probably means that Webservices will see this as a function taking a Record as parameter (which in your C# method is a key) and returning a Record - which cannot be done - there you have it.
I am just guessing here - haven't tried it.Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Hi Freddy,
Thanks for your response.
I think you may be right.
I have used the Function Parameter as a Pass By Reference. I will try to change it and try to do that. Will revert back.
Thanks.0 -
Yes Freddy.
You were right.
Actually I had one Variable as a Parameter which was a "Pass By Reference Variable".
I changed the logic and removed that variable and it worked.
Thanks.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions