Calling business object methods from within an epicor 10 bpm

Does anyone have an example of how to invoke a BO method?

I am using APInvGrp.PrePostGroupInvoices am trying to validate that specific fields in ApInvHed are populated for transactions posted within a particular time frame.

What I realize is that the APinvdataset is not available in APInvGrp.PrePostGroupInvoices. The only thing that is available that I can use is the PostGoupID parameter.

I need some direction on how to call the APInvoice method and get the dataset where APInvhed. GroupID = PostGoupID Parameter

Are you planning to manipulate the APInvoice dataset in anyway, or just look at it for validation before posting? If the latter, you might be better off just using some LINQ code to query the db instead of bringing in whole datasets and inspecting them.

Firstly you need to get your using and references sorted. In this example I’m invoking a credit manager record set

image

image

After the you need to initialize the service in the code

var CMOrders = Ice.Assemblies.ServiceRenderer.GetService < Erp.Contracts.CreditManagerSvcContract > (Db);

After that you can use the method, for example:

CMOrders.UpdateCMOrderHed

I always use the BL tester on the app server to go through the method calls and verify the results.

Hope that helps.

Thanks for your recommendation, Tom. will try that.

This helps. Thank you.

Call with BL tester and call with ServiceRendere work differently. BL tester uses client-side proxies that do a lot of magic. So, calls that work with BL Tester can stop working with ServiceRenderer.

Tests with REST Help provide more relevant results.

4 Likes