Using a Business Object in C# BPM

,

Hi All,

I am trying to add a Miscellaneous line to AR invoices with a BPM and code.

I am trying to use the business Object to create the new miscellaneous line, but I can’t find the correct code to define the tableset.

I think the code should look like this:

        var svcInvcMisc = ServiceRenderer.GetService<Erp.Contracts.ARInvoiceSvcContract>(Db);
        Erp.Tablesets.ARInvoiceTableset tsARInvoice = new Erp.Tablesets.ARInvoiceTableset();

But I get a Compilation Error that looks like this.

        Error CS1936: Could not find an implementation of the query pattern for source type 'Erp.Tablesets.ARInvoiceTableset'.  'Where' not found.

Any ideas why this doesn’t work?

Hi Ian, you need to add the ARInvoice bo reference to the bpm

1 Like

HI Aaron,

I have this reference in my BPM.

image

Is that not the correct one?

try

var svcInvcMisc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.ARInvoiceSvcContract>(Db);
        Erp.Tablesets.ARInvoiceTableset tsARInvoice = new Erp.Tablesets.ARInvoiceTableset();

might need to be specific about your ServiceRenderer class. I did a test with that and it worked just fine

Hi Aaron,

Thanks for your help with this. Confirming that the code worked for you made me look more closely at the rest of the code and the error came from how I was using the tableset not its setup.

This is now working OK.

As an alternative… You can add
using Ice.Assemblies;
on the Usings page.

1 Like

Hi Sergey,

Yes, I have done that and I have finally got my code working!

Thanks everyone for your help.

Regards

ian