Releasing a line item to a job from Sales Order screen


Here is my desired goal:

1.  Add button to Sales Order (Lines Detail tab) called 'Release To Job'
2.  When user clicks the button it executes a BPM (or something) to go ahead and release the line item to a job.
  1. Display a message on success/fail.

So far, I’ve added the button and hooked the click event. Since this is not tied to any specific form function, I am guessing I have to add the code to call a JobManager.CreateJob has to be done using the form script editor inside the button’s click event. Trying to find some direction to do this. I think I have all the BO names via the Trace Log. Does someone have a template? That would be super cool.

Have a great day!

I’m a big fan of not recreating the wheel. Why not use the Order Job Wizard?

1 Like

i was thinking the same thing. there is already a button in the order job wizard. it does what you are trying to achieve.

That’s a great question and I’ll find the answer to that in a few hours. For arguments sake, could you call the Order Job Wizard from a custom button and/or, by pass the wizard interface and just pass the data through transparently. Is that unclear enough? :slight_smile:

I’m sure you could, but I don’t know how offhand.

If you are looking to automate the job creation process, why not just let MRP create the job overnight?

The Order Job Wizard is ghosted out on my menu. And I do have admin access since I develop. I’m assuming this is how the customer wanted it created. Guess I’ll have to try and turn it on to see what it does.

Make sure the part in question has a method of manufacturing and the demand on the sales order is to make it. Check the release.

Its not ghosted. But we want to set the “Make Direct” box and then call OrderJobWiz.CreateJob and get a message back if successful. I’m assuming I will have to call this from the Click event of the form control. Syntax and scoping is different, so I’m trying to find an example shell.

Have a great day!

We have done something related, calling the OrderJobWizard functionality from within a BPM to create jobs once the entire order is released, so it must be possible to do the same thing within the form.

I was able to call the CreateOrders method using the code listed below. The question I have now: when the user hits that custom button, I want to force the ‘Make To Order’ flag on the Order Detail table, save it, then call the CreateJobWiz. Any ideas?

indent preformatted text by 4 spaces
        OrderJobWizAdapter adapterOrderJobWiz = new OrderJobWizAdapter(this.oTrans);
         MessageBox.Show("Adapter declared and connected");
		// Declare and Initialize Variables
		// TODO: You may need to replace the default initialization with valid values as required for the BL method call.
		string pErrorMessages = String.Empty;

		// Call Adapter method
		bool result = adapterOrderJobWiz.CreateJobs(out pErrorMessages);
         MessageBox.Show("After Call");
indent preformatted text by 4 spaces

That’s actually the easy bit.

From memory, the “Make” field is on the OrderRel table. You can access it by grabbing the OrderRel EpiDataView (something like EpiDataView edvRel = (EpiDataView)oTrans.EpiDataViews[“OrderRel”]) and setting “Make” to true. Then oTrans.Update() saves the whole order.

You have to play around a bit with the variables you pass to the OrderJobWiz CreateJobs method, I seem to remember. But it works well once you have it sorted.