I am currently working on a custom app which is supposed to assign priorities to orders based on the row they occupy within an EpiUltraGrid. I created a UD table for OrderHed called OrderHed_UD and it has a UD field named “OrderPriority_c”. We want to assign an order priority when creating an order (I have that part figured out), but I would like to be able to save the updated OrderPriority within the customization code of this custom app. To give you an idea of what I’m creating, here’s a picture of what it looks like:
Using the arrow keys on the side, you can move the highlighted order up or down. When I hit the “SAVE ROW” button, I want to be able to save the Priority field in the EpiUltraGrid to the OrderPriority_c field in the OrderHed_UD table.
Does anyone have an idea on how to best achieve this in the customization code?
Additionally, does anyone know how to get that save button in the tool bar in the top, does it need to be an updateable BAQ/Dashboard?
If anyone comes across this, I kind of figured it out. This question was extremely helpful in solving this.
This code is the closest I got to saving to the DB from customization code:
// make sure to import:
using Erp.Adapters;
using Ice.Adapters;
// and possibly:
using Ice.BO;
try
{
var orderNum= "123456";
var priorityNum = "1";
SalesOrderAdapter soAdapter = new SalesOrderAdapter(this.oTrans);
soAdapter.BOConnect();
soAdapter.GetByID(orderNum);
soAdapter.SalesOrderData.OrderHed[0]["OrderPriority_c"] = priorityNum;
bool result = soAdapter.Update();
soAdapter.Dispose();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
Before you can use SalesOrderAdapter, you’ll need to go to the Customization window, then click on Tools > Wizards > Customization Wizards > click on “Reference Adapter/BL Assemblies”, find your adapter (I think every table has one) and add it.
I’m not sure if this next step is necessary, but you might also have to do the following:
Tools > Assembly Reference Manager > Then add a custom reference, in the picture mine is already added…