Data Directive and BO

I have to use a function from Erp.Contracts.BO.JobEntry in a data directive.

I added it’s reference in the assemblies section and added the following usages:
using Erp.BO;
using Erp.Contracts;
using Erp;

I looked up the syntax and no matter what still cannot use the BO.

Does someone has a code sample to show me how to declare and call a BO’s function in a data directive.

Do you know how to use it in a method directive? Or are you just asking about using BO’s in BPM’s in general?

BO’s in BPM’s in general. I added the references, and know the arguments for the function I need. I’m just not sure on how to declare and use the BO’s in the code.

I’ve been doing direct sql DB calls until now, but it is not an option in this case, I really need to go through the BO. (Erp.Contracts.BO.JobEntry.GetDetails)

Here is an example of using the UD table code.

Instantiating the contract is similar for all of the services. Look at this one, try to see what you would modify, and let me know where you get stuck.

adding:, and I don’t know what you are trying to do with (Erp.Contracts.BO.JobEntry.GetDetails), but that’s going to be doing a lot of stuff. I would maybe think carefully about what you are trying to accomplish.

Yeah, I’ve been adding to UD tables like your example but the BO function call seems different. I tried to switch the service to no avail.

Regarding your edit, basically when a job is created from an order, I’m adding a pre-made BOM based on the revision #.

Why not simply use the Job Manager on order entry? It’s only a couple of button clicks and you can get the details and schedule the job right from there.

var jobSvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.JobEntrySvcContract>(Db))

This is how you instantiate the JobEntry service contract.

Also, don’t forget that BPM’s have autofill. Just hit Ctrl+space to kick that off. You can find a lot of stuff that way.

2 Likes

I’m trying to bypass the Job Manger, this is part of a bigger scale project to automate our work orders.

I got it thanks to you! Here’s the code if anyone else was needing this solution:

var JobHeadDs = (from JobHead_Row in Db.JobHead where JobHead_Row.SysRowID == 
                 currentGroupSeq select JobHead_Row);
var PartNum = (from JobHead_Row in JobHeadDs select
              JobHead_Row.PartNum).FirstOrDefault();
var JobNum = (from JobHead_Row in JobHeadDs select
              JobHead_Row.JobNum).FirstOrDefault();
var QuoteNum = (from JobHead_Row in JobHeadDs select 
              JobHead_Row.QuoteNum).FirstOrDefault();
var QuoteLine = (from JobHead_Row in JobHeadDs select                                   
              JobHead_Row.QuoteLine).FirstOrDefault();

var jobSvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.JobEntrySvcContract>(Db);

using(jobSvc)
{
    var jobEntryTableSet = jobSvc.GetDetails(JobNum, 0, "Method", QuoteNum, QuoteLine, JobNum, 0, PartNum, "PART_REV", "", true, false, false, false);
}