Hi,
I am trying to call a function from a method directive and I am getting an error which appears to be an issue relating to a version component, but I am not sure what’s wrong. I am hoping it’s something really daft I am doing
Here is the code:
string ApiKey = “”;
var functionContent = new RestContent(
new{
iOrderNum = orderNum,
});
var restClient = new RestClientBuilder()
.SetAppServerUrl(“https://my epicor url”)
.SetCompanyId(“OPL”)
.SetDefaultApiKey(ApiKey)
.SetIsSingleSignOn(true)
.Build();
var functionResponse = restClient.Function.Post(“OPTIMA”, “TestFunction”, functionContent, published: true);
Here is the error:
The type ‘HttpResponseMessage’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.
For what it’s worth I have used a very similar piece of code in a form customisation and it worked fine.
Ideas / solutions gratefully received.
Many thanks,
Steve