AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
CRM
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 11.01.2012, 17:24   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006


If something, Stratus has taught me how buggy the implementation of Web services in Microsoft Dynamics NAV is. Let me be clear from the onset: Web services are a great functionality in NAV, one of the best additions (together with .NET interop) to NAV stack in a long while. But it’s buggy.

Being buggy doesn’t mean it doesn’t work. It only means you need to twist and bend your code to achieve things which you would expect to work out of the box. During development of Stratus, we had to make a series of workarounds in Web services to achieve simple goals, and I decided to share those bugs (and workarounds) with you, to help you be more productive in your Web services based projects.

So, here we go for bug #1: lowercase codes in primary key.



Problem

Check this out:

Customer_Service svc = new Customer_Service();svc.UseDefaultCredentials = true;Customer cust = new Customer { No = "test" };svc.Create(ref cust);

(I assume I don’t need to give details about how to configure the Web reference in C# or how to expose page 21 Customer Card as a Web service called Customer.)

 Now, imagine you write this code in your OnRename trigger in table 18 Customer:ERROR('Gotcha %1!',"No.");

Guess what happens?

Well, you get the ‘Gotcha!’ error. Inserting a lowercase value into a code field actually first insert the lowercase value, then renames it to an uppercase value. Pretty cool, eh?

Funny thing – this cannot be done through RTC. OnRename never gets triggered if you insert a lowercase code value to a key field through RTC. This is how Web services should actually behave as well.

Workaround

Not much you can do here. Make sure you uppercase your codes before shipping them over to NAV. RTC seems to do just that.

Read this post at its original location at http://navigateintosuccess.com/blog/...web-services-1, or visit the original blog at http://NavigateIntoSuccess.com. )

Читать дальше
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 18:54.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.