Hi Epicor Community, is there anyway to add in an UD field for prod qty in the job receipt to inventory page?
Your guys help is much appreciated.
Thank you
Hi Epicor Community, is there anyway to add in an UD field for prod qty in the job receipt to inventory page?
Your guys help is much appreciated.
Thank you
I think we need to know why you want to do this to suggest the correct approach. Customizing the form is fairly simple, but showing the data you want could be tricky. Do you just want to see the prod qty, or do you want to make it an editable field?
Hi @NateS, the users wanted to see the production qty not editable field, it’s for the users reference to see the qty completed is same or not for the prod qty
I don’t know the BEST way, but I do know a way…
Create a new BAQ called getProdQty. The BAQ uses just JobHead. It filters JobHead by a JobNum parameter, let’s call it myJob. Display only the ProdQty field as an output. This make a BAQ that takes in one job num, and spits out one prod qty. Now let’s get this into your form.
Open the Job Receipt to Inventory in customization mode. Add a new event, based on
EpiViewNotification for PartTran. As a proof of concept, insert MessageBox.Show(view.dataView[args.Row][“JobNum”].ToString()); in the inner if statement. This will show you that you can grab the job number from the table after the Epi view event. Next, we need to use that job number to filter your BAQ and then spit that prod qty out to a text box.
You have to go to Tools > Assembly Reference Manager and find Ice.BO.Contracts.DynamicQuery, and add that as a custom reference. The search is filtered by default, so make sure to show all files. It might take a few minutes to find the right one.
Insert a new text box on your form. Let’s call it txtProdQty. Use this bit of code to get the prod qty out of your BAQ and into the txt field:
private void edvPartTran_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.AddRow))
{
MessageBox.Show(view.dataView[args.Row]["JobNum"].ToString());
DynamicQueryAdapter yourbaq = new DynamicQueryAdapter(this.oTrans);
DataTable results;
yourbaq.BOConnect();
string baqname = "getProdQty";
Ice.BO.QueryExecutionDataSet dsBAQ = yourbaq.GetQueryExecutionParametersByID(baqname);
dsBAQ.ExecutionParameter[0].ParameterID = "myJob";
dsBAQ.ExecutionParameter[0].IsEmpty = false;
dsBAQ.ExecutionParameter[0].ParameterValue = view.dataView[args.Row]["JobNum"].ToString();
dsBAQ.AcceptChanges();
yourbaq.ExecuteByID(baqname, dsBAQ);
// Set results of query to the text box
txtProdQty.Text = yourbaq.QueryResults.Tables["Results"].Rows[0][0].ToString();
}
}
When you are done, make sure to remove or comment out the message box. You don’t need to see that anymore. Then save your customization and set it as the default customization from the menu maintenance. That should do the trick. You may want to set the text box as read only and/or give it a label but that’s all just pretty stuff you can figure out.
If you have to do this in Kinetic you better brush up on your devil bargaining skills…
Note: This still needs some more work. The new text field doesn’t clear when you clear the form, and it doesn’t seem to get updated when you change the job. Like I said this is close, but not perfect.
Good luck!
Thanks @NateS will update you when I’ve done it, really appreciate your help but I’m not sure about this part
“Open the Job Receipt to Inventory in customization mode. Add a new event, based on
EpiViewNotification for PartTran. As a proof of concept, insert MessageBox.Show(view.dataView[args.Row][“JobNum”].ToString()); in the inner if statement. This will show you that you can grab the job number from the table after the Epi view event. Next, we need to use that job number to filter your BAQ and then spit that prod qty out to a text box.”
Would be helpful if you have a screenshot of this
I am assuming you are using the modern interface. At the bottom of the main program interface there is a little upwards facing arrow. Open that bottom dock, and hover over the various icons there. Two of them on the right side are important. The Wrench is Developer or Customization mode. And The Page with the Magnifying glass icon is for tracing. First turn on developer mode. This pops-up a form before each form that you open to ask which customization you want to load. If you don’t have one, then you just load the base (make sure it is set to C#, not VB).
When you load the base version of a form the first time, it looks just like normal. you can’t edit anything until you right click on the blank area of the form and go down to Customization.
Now we are getting into the meat of it. This is the customization window for Job Receipt To Inventory.
Go to Wizards > Form Event Wizard. Choose EpiViewNotification as a triggering event. Choose the View you want to use as the trigger. In this case, the PartTran view has the Job information we need to send to the BAQ. Click the Blue arrow to make a new handler. Then at the bottom, click Update Selected Event Code. This puts some code outline into the Script Editor for you.
Just paste in that code inside the if statement. Now go to File > Save Customization. Give it a cleverer name than custom1. Now close the form and customization window. Leave Developer mode on, and open your form again. Now you can open the form with your customization to test it out.
Good luck!
Hi @NateS thanks for the screenshot, I’ve followed your step but it seems the prod qty is not showing, I’ve redo the steps a few times, am I missing something?
This is easily achieved by creating a foreign key view (classic only and no coding needed). I will try to create an example tomorrow but if you search here you should find examples
Please do. We were discussing this earlier in another thread, and some of us were having trouble making this work. A nice simple example would be appreciated.
Made a quick video showing how it is done
Customization File (2023.2.3):
App.RcptToInvEntry.RcptToInvForm_Customization_JobHead_FKV_CustomExport.xml (22.0 KB)
Welp I’m still stumped on this one, no idea what I did differently when I tried this with ShipViaCode from the POAdapter. Thanks for the vid though.
What exactly are you trying to do that isn’t working?
That’s the other thread I was talking about. I showed him how to do it another way.
thank you very much sir @tkoch, I really appreciate your help, if your doing class how to customize epicor I would like to join