We can invoke a business Service
through
1.
Runtime Events
2.
eScript
3.
User Property
·
Runtime Events
To call a business service
through runtime events
Enter
the following information in the Action
Set that you are creating
Business Service: Business Service Name
Business Service Method: Method Name
Business Service Context: “Input Argument”, “Value”
Business Service Method: Method Name
Business Service Context: “Input Argument”, “Value”
And based on the Event that you choose
this business service will be invoked
·
eScript
You can use the following Code to
invoke a business service from escript
·
Applet browser to BS server
script
var
outputPS;
var bsReject = theApplication().GetService("WHV Reverse Payment Record");
var inputPS = theApplication().NewPropertySet();
inputPS.SetProperty("ACBSeq", nACBSeq);
inputPS.SetProperty("PromoId", sPromoId);
inputPS.SetProperty("BillingNumber", nBillingDoc);
outputPS = bsReject.InvokeMethod("RejectPayment", inputPS); */
var bsReject = theApplication().GetService("WHV Reverse Payment Record");
var inputPS = theApplication().NewPropertySet();
inputPS.SetProperty("ACBSeq", nACBSeq);
inputPS.SetProperty("PromoId", sPromoId);
inputPS.SetProperty("BillingNumber", nBillingDoc);
outputPS = bsReject.InvokeMethod("RejectPayment", inputPS); */
·
Applet Server to BS server script
bs
= oAppObj.GetService("WHV Get Product Price BS");
Input.SetProperty("AccPromoPriDate", this.BusComp().ParentBusComp().ParentBusComp().GetFieldValue("WHV Account Promotion Pricing Date"));
Input.SetProperty("AccntCOT", this.BusComp().ParentBusComp().ParentBusComp().GetFieldValue("WHV Account COT"));
Input.SetProperty("UserOrganizationId", oAppObj.GetProfileAttr("UserOrganizationId"));
Input.SetProperty("ProductId", this.BusComp().GetFieldValue("Product Id"));
bs.InvokeMethod("WHVProductPrice", Input, Output);
Input.SetProperty("AccPromoPriDate", this.BusComp().ParentBusComp().ParentBusComp().GetFieldValue("WHV Account Promotion Pricing Date"));
Input.SetProperty("AccntCOT", this.BusComp().ParentBusComp().ParentBusComp().GetFieldValue("WHV Account COT"));
Input.SetProperty("UserOrganizationId", oAppObj.GetProfileAttr("UserOrganizationId"));
Input.SetProperty("ProductId", this.BusComp().GetFieldValue("Product Id"));
bs.InvokeMethod("WHVProductPrice", Input, Output);
·
User Property
You can use named method property to
invoke a business service from BC but this method is rarely used as
it including complex conditions in the User property might not be possible. But
it can come quite handy if you just want to invoke BS based on simple
conditions
Name:
Named Method 1
Value: “New Record”, “INVOKESVC”, “BS Name”, “BS Method”, “‘Input Agrument’”, “Value”, “‘Input Argument 2’”, “Value”
Value: “New Record”, “INVOKESVC”, “BS Name”, “BS Method”, “‘Input Agrument’”, “Value”, “‘Input Argument 2’”, “Value”