Anybody know why a simple code like this wouldn’t work? None of the two lines (GetByID or GetRows) retrieve the invoice dataset, the dataset it empty.
The invoice number I use is an un-posted invoice in a group. I am trying to programmatically add a misc charge into an invoice but first I must read the invoice record.
Ok so it looks like the service is working, but it’s just not returning data (but schema is being populated).
In the BL Tester (not BO Tester, my bad), I assume it also returns no rows?
The other thing I’d look at is to verify your session is in the correct company
It allows you to configure the company/site you’re in and then call business objects and their methods. I’d definitely start there to verify your calls are returning valid data before banging your head on the desk with code problems.
Thanks!! My BL Tester is not setup, I will have to set it up, however I did my code test using both pilot and live environments and it retrieves empty dataset.
If that’s a valid invoice in the right company it should work. GetByID should throw an error if the invoice doesn’t exist.
var aRInvoiceImpl = WCFServiceSupport.CreateImpl<Erp.Proxy.BO.ARInvoiceImpl>(epiSession, Erp.Proxy.BO.ARInvoiceImpl.UriPath);
var ds = aRInvoiceImpl.GetByID(10273);
Yes that is correct, when I pass an invalid invoice number it throws an exception, however for the right invoice number it still retrieves blank record!!! I am starting to worry something serious is wrong!! When I check the trace logs these are the same methods being called by Epicor, I don’t understand why it doesn’t work when I call them in the code!!
I do have access to it, but honestly I have never used it so I don’t even know how to set it up. I have Visual Studio projects where I test all Epicor BOs and I have been doing that for 6+ years…
Here are the screenshots of the BL Tester setup and error that I get.
Well you need to match the binding on there to whatever the environment binding is. It’s probably Windows Authentication binding, not username over SSL, but you’d have to see in the environment settings in the Epicor Admin Console.
I need to read it first then create a line misc invoice. I need the GetByID to work!! I don’t know why it doesn’t! I have done this with many other business objects like Salres Order Entry or Purchase Order Entry and so on and they work but not this one!
Ok I was able to get it setup thanks to your hint I had to choose the same binding. And tested it and it retrieves data in there but not through code!!!
Ok that’s good, that means our data is fine and we shouldn’t bark up that tree then. The other things we should look at now are the configuration settings we are passing in the WCF service.