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:
new SDataService("http://webserver:5555/sdata/slx/dynamic/-/", "lee", ""
// Now create the request, passing in the ISDataService we created
var req = new SDataResourceCollectionRequest
// 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
// 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).
"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.