mibuso.com

Microsoft Business Solutions online community
It is currently Wed Jun 19, 2013 6:28 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Running business logic from web service
PostPosted: Fri Feb 13, 2009 7:34 am 
Offline

Joined: Wed Oct 15, 2008 12:15 pm
Posts: 418
Hello

I am writing a test webservice to modify the customer record name, and it's not modifying the ""Search Name". Is there something I'm missing? Here is my code. What do I need to do to run business Logic?
Code: Select all
            CustomerWS.Customer_Service service = new WebServiceApp.CustomerWS.Customer_Service();
            CustWS.UseDefaultCredentials = true;
            CustomerWS.Customer Cust = new WebServiceApp.CustomerWSr.Customer();
            Cust = service.Read("10000");
            Console.WriteLine(Cust.Name);
            Console.WriteLine(Cust.Search_Name);
            MyCust.Name = "test2";
            Console.WriteLine(Cust.Name);
            Console.WriteLine(Cust.Search_Name);
            service.Update(ref Cust);


thanks


Top
 Profile E-mail  
 
 Post subject: Re: Running business logic from web service
PostPosted: Fri Feb 13, 2009 8:06 am 
Offline
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Thu Oct 16, 2003 8:50 am
Posts: 12266
Location: Brno
Country: Czech Republic (cz)
You need to check it after the update, the record is transfered and the business logic is called by insert/update/delete, not just by assigning the value (I suppose)...

_________________
Kamil Sacek
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.


Top
 Profile E-mail WWW  
 
 Post subject: Re: Running business logic from web service
PostPosted: Fri Feb 13, 2009 10:41 am 
Offline
Microsoft employee

Joined: Fri Nov 28, 2008 5:13 pm
Posts: 18
Location: Denmark
That's correct. There is no business logic built into the service objects you have created in your code. The properties will be updated after making a call into the web service (i.e. update, read, etc.). In general, all business logic is executed on the NAV server when invoked from web services, or role-tailored client.

_________________
Tom Cornelius
Test Lead
Microsoft Dynamics NAV

This posting is provided "AS IS" with no warranties, and confers no rights.


Top
 Profile E-mail  
 
 Post subject: Re: Running business logic from web service
PostPosted: Fri Feb 13, 2009 2:39 pm 
Offline

Joined: Wed Oct 15, 2008 12:15 pm
Posts: 418
ok so the business logic is executable on update, insert.

My question is still is why isn't the "Search Name" updated when I go to the Customer Card?


Top
 Profile E-mail  
 
 Post subject: Re: Running business logic from web service
PostPosted: Fri Feb 13, 2009 3:12 pm 
Offline
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Thu Oct 16, 2003 8:50 am
Posts: 12266
Location: Brno
Country: Czech Republic (cz)
You never told us that the Search name is not updated when you look at the modified card through RTC or CC. I though that you mean it is not updated when you execute your code, because you are displaying the search name before the business logic is executed...

_________________
Kamil Sacek
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.


Top
 Profile E-mail WWW  
 
 Post subject: Re: Running business logic from web service
PostPosted: Fri Feb 13, 2009 3:45 pm 
Offline

Joined: Wed Jan 23, 2002 8:01 am
Posts: 161
Location: Norwell, MA
Country: United States (us)
Updating the Search Name on the customer table involves the use of xRec to compare the previous value of the Name field to the Search Name field. An earlier version of NAV 2009 (CTP3 or CTP4) had a bug with web services where xRec was not being set properly. This was supposed to be fixed in the final release of NAV 2009, but I have not had a chance to test it. It could be that this error still exists.


Top
 Profile E-mail  
 
 Post subject: Re: Running business logic from web service
PostPosted: Fri Feb 13, 2009 5:07 pm 
Offline

Joined: Wed Oct 15, 2008 12:15 pm
Posts: 418
The bug is still exists. If Search Name is blank it populates it. If Search name is same as Name it doesn't overwrite.

Also does it know the sequence of validation of fields if validation happens on update,insert?


Top
 Profile E-mail  
 
 Post subject: Re: Running business logic from web service
PostPosted: Fri Feb 13, 2009 9:25 pm 
Offline
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Thu Oct 16, 2003 8:50 am
Posts: 12266
Location: Brno
Country: Czech Republic (cz)
I think that the sequence is in ID field sequence...

_________________
Kamil Sacek
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.


Top
 Profile E-mail WWW  
 
 Post subject: Re: Running business logic from web service
PostPosted: Fri Feb 20, 2009 7:01 pm 
Offline

Joined: Wed Oct 15, 2008 12:15 pm
Posts: 418
Are they going to fix this :bug: in SP1 for 2009?


Top
 Profile E-mail  
 
 Post subject: Re: Running business logic from web service
PostPosted: Mon Feb 23, 2009 10:33 am 
Offline
Microsoft employee

Joined: Fri Nov 28, 2008 5:13 pm
Posts: 18
Location: Denmark
It's being looked at, but I can't tell you whether or not it will be fixed.

_________________
Tom Cornelius
Test Lead
Microsoft Dynamics NAV

This posting is provided "AS IS" with no warranties, and confers no rights.


Top
 Profile E-mail  
 
 Post subject: Re: Running business logic from web service
PostPosted: Thu Feb 26, 2009 8:20 pm 
Offline

Joined: Wed Oct 15, 2008 12:15 pm
Posts: 418
Tom Cornelius wrote:
It's being looked at, but I can't tell you whether or not it will be fixed.



Thank you? :?


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: