fiogf49gjkf0d Hi,
We need to be able to call execute a business rule that applies some fairly complex rules to an Opportunity and creates a new Opportunity from the original. We need to call this from an external application and don't want to have to reproduce the business logic that's already in place in our Business Rule Method in App Architect. Has anyone had any experience of executing a Business Rule Method from SData?
I've imported the package reference to SData into my project using Nuget and can query data as follows. Here's a brief example:
ISDataService
svc =
new SDataService("http://webserver:5555/sdata/slx/dynamic/-/", "lee", ""
);
// Now create the request, passing in the ISDataService we created
// above
var req = new SDataResourceCollectionRequest
(svc);
// Tell it which kind of resource we want to access, in this case
// Contacts. Note, this needs to match the values on the SData tab
// of the entity in Application Architect
req.ResourceKind = "Contacts"
;
// This part is optional (without it we'd be getting ALL contacts).
// This is our where clause, or condition of which contacts we want.
// In this example we want all contacts whose last name starts with
// the value 'Ab'. We need to use the exact property name as defined
// in the entity (case-sensitive).
req.QueryValues.Add( "where", "LastName like 'Ab%'"
);
I know the above code is not relevant to what we need to do but I've included it to show the kind of things that we know how to do! Does anyone have any code examples of how we can invoke a Business Rule Method? Any pointers/documentation/code examples would be welcomed.
Regards
Daniel
|