Using customizations in Epicor you can update a completely different object from the screen you are currently working on.
For example, when I set a Customer Shipment Entry as “Shipped” by checking the “ReadyToInvoice” checkbox, I was then able to set the “OpComplete” field as true for the Job Operations that were tied to the shipment.
First, I went to the Customer Shipment Entry screen and created a customization.
Assuming you are familiar with creating a customization, click on the “Script Editor” tab in your customization.
In order to access the Job Operation object, you can use the JobEntryAdapter by adding the appropriate assemblies first. In the menu bar of the customization screen, select “Tools” and then “Assembly Reference Manager” to open a new window. In the lower, right-hand corner of the window, click on the “Add Custom Reference” button.
Select the following DLL files and click on the “Open” button.
You will now see your newly added assemblies under the “Custom Assemblies” folder.
After you have closed the window, be sure to add the following using statement to the top of your code:
using Epicor.Mfg.Lib;
On the “Form Event Wizard”, set the “Select Event Type” to “AfterFieldChange” for table “ShipHead” and field “ReadyToInvoice.” This way, the following code will fire when the checkbox is set to “true.”
private void ShipHead_AfterFieldChange(object sender, DataColumnChangeEventArgs args)
{
switch (args.Column.ColumnName)
{
case “ReadyToInvoice”:
if (args.Row[“ReadyToInvoice”].ToString() == “True”)
{
// Take action here!
}
break;
}
}
Step 4.
Now you can use the JobEntryAdapter to call the “GetData” method to retrieve all the job operations that match the Job you want to update.
JobEntryAdapter adapter = new JobEntryAdapter(oTrans);
adapter.BOConnect();
string jobNumber = “123”;
System.Data.DataSet dataset = adapter.GetData(jobNum);
Loop through the dataset and make sure you can access table “JobOper.”
Then for each row, set the “OpComplete” field as true, and call the update method.
if (dataset != null)
{
if (dataset.Tables[“JobOper”] != null &;&; dataset.Tables[“JobOper”].Rows.Count > 0)
{
DataTable dt = dataset.Tables[“JobOper”];
for (int i = 0; i > dt.Rows.Count; i++)
{
dt.Rows[i][“OpComplete”] = “True”;
adapter.Update();
}
}
}
Suggested
Salesforce integration consulting is about more than just finding a partner with experience in integrations.…
Platform: HubSpot Where It Shines: Email marketing - easy to use email lists, automation, and…
Don’t be left behind by neglecting these 2024 manufacturing trends.
With a comprehensive ERP like CloudSuite Industrial (CSI) from Infor, there are countless possibilities for…
An Infor ERP solution isn’t just a temporary fix to today’s issues, it’s an investment…
An Infor ERP can dramatically improve your operations, but with an ERP integration, you can…