New Posts New Posts RSS Feed: Invoking Server Side Methods
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Invoking Server Side Methods

 Post Reply Post Reply
Author
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Topic: Invoking Server Side Methods
    Posted: 20-Jul-2010 at 7:57pm

Take a look at the EntityServerSaveInterceptor.  You can examine the objects that are being saved there and add any other records to the transaction.

Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 20-Jul-2010 at 2:14pm
You will need to use the InvokeServerMethod method of the EntityManager.  There is a synchronous and asynchronous version of this method.
Back to Top
BillG View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 05-Dec-2007
Location: Monroe, MI
Posts: 233
Post Options Post Options   Quote BillG Quote  Post ReplyReply Direct Link To This Post Posted: 20-Jul-2010 at 6:52am
I understand that classes like CustomerViewModel sit on the client side and are invoked for things like retrieving customers to display in a grid or a single customer to display in a form.
 
When I save a customer record, I would like to recalculate his balance just to ensure that it is up to date. To do this I will loop through the customers charges and payments and get a balance. I don't want to bring any records down to the client to do this, I would like to do this on the server. So I am thinking that I will have a CalculateBalance method on the server side that will do the above and update the balance in the customer table in the database.
 
How will this method get invoked?
 
I am assuming my view class will call a routine in the ViewModel and then the ViewModel will pass the call to the server.
 
Bill
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down