Hello everyone,
I am trying to add a button to the Mass Issue to Mfg. module to update the “From Bin”(BinNum) column in the grid view. I am trying to update every field in the column to “0002”.
Any help is appreciated, Thanks!
The field name in grid:
Grid Properties:
I tried to modify the script from another thread however, it doesn’t even give me an error so I assume I did some thing fundamentally wrong that I need some help with.
Here is the function I modified trying to make it work for me
private void epiButtonPHX_Click(object sender, System.EventArgs args)
{
EpiDataView edvugdIssue = oTrans.Factory("ugdIssue");
MessageBox.Show(oTrans.LastView.ViewName);
foreach(DataRowView row in edvugdIssue.dataView)
{
row.BeginEdit();
row["Mtl.BinNum"] = "0002";
row.EndEdit();
}
oTrans.Update();
}
Here is the full version:
// **************************************************
// Custom code for MassIssueForm
// Created: 9/20/2018 5:49:33 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Ice.BO;
using Erp.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
public class Script
{
// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
// Begin Wizard Added Module Level Variables **
// End Wizard Added Module Level Variables **
// Add Custom Module Level Variables Here **
public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
// End Wizard Added Custom Method Calls
}
public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
private void epiButtonPHX_Click(object sender, System.EventArgs args)
{
EpiDataView edvugdIssue = oTrans.Factory("ugdIssue");
foreach(DataRowView row in edvugdIssue.dataView)
{
row.BeginEdit();
row["BinNum"] = "0002";
row.EndEdit();
}
oTrans.Update();
}
}