Hello All Experts,
1) I am facing problems in publishing the CodeUnit WEB SERVICES, which are having Record Variables as a Paramaters. Issue related screenshot is attached bellow.
If any idea then please help.
2) If any body is having idea then please, suggest me the procedure to do the Posting by using the Web Services from WEB.
Any replies will be appreciated.
Thanks in Advance.
Ravi_Thakkar
Ahmedabad, Gujarat, India
E Mail :
ravi.thakkar@hotmail.com
0
Comments
Publish the page in common way
Add the codeunit into the Web Service table, with same name as the page. Do not tick the Publis checkmark.
Now, when you look at the WebService for the page, you should see the functions from the codeunit between other methods...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
In the function.
SalesHeader.get(DocumentType,documentNo);
CU80.run(SalesHeader);
Publish this new codeunit on webservice.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I can use codeunits as an Extension Codeunit. That is right.
But,
E.G. I want to have access of methods of Code Unit 80 Sales Post.
So, I published Page 42 Sales Order with name SalesOrder and used CU 80 as an Extension CU with the same name SalesOrder.
When I try to consume the Web-Service SalesOrder at that time It should also show me all methods of CU 80. But only showing the methods of Default Page Web-Service.
So is there any another solution to get the access of such long codeunits' methods?
Please suggest me as soon as possible.
Thanks in ADV.
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I dont have put the Checkmark in that CodeUnit as the process for Extension Codeunit.
Any suggestion or help?
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com
You should create the codeunit that expresses the high-level contract you want to use and then that code can call into CU 80 or whatever.
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.
Yes, I know there is no any recommendation to expose the same CU.
And I also planned to use my customized CU and in that I called the required CU.
But, I am wondering, why I am not able to get the Methods of Existing CU having much more complexity and more methods with more parameters.
Any suggestion?
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
If that is right, then it's not a feasible option. Because I need to use so many codeunits from NAV. Then to access any simple & small methd of any Complex CU, I will require to make CU.
Is there any another option or logic to implement?
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com
And you don't necessary need to create a new codeunit for each codeunit.
You only need one codeunit with all the necessary functions.
This is for your benefied. Main reason is that if anything gets modified in NAV, you don't have to modify what ever you are integrating with.
Also what are you integrating that you need all the CU?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks. I really appreciate your suggestion.
Please, keep me updated if you find any other feasible sollution,
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com
Also, the recommendation is to create a highlevel communication with web services - and not a ton of calls to a lot of different methods.
Same with Pages - if you consume a page as a web service and somebody customizes the page (removing some fields) then your contract is broken and your consumer might run into problems. To avoid this problem you have 3 options: Create the pages you consume yourself, use loosely coupled page WS access (sample on my blog) or update the service references and recompile your web service consumer app everytime somebody customizes NAV.
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.
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com