Dear Team,
I’m tried to bind the values on Job Number and Qty from dashboard using process caller (Launch Options) but I’m able to pass the values, but not able binding in the view. Kindly, Help me.
The below codes are used for pass and retrieve.
The values are passed from Dashboard to Job Receive Salvage on button click event. I’m able to pass the values, but not able to values are bind in epiview[“PartTran”] job number field on the Job Receive Salvage screen
Dashboard button click:
private void btnRcvSalvageQty_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
EpiUltraGrid mesGrid;
mesGrid = (EpiUltraGrid)csm.GetNativeControlReference(“863b4eab-4334-4673-82b8-b9e73c64e59f”);
UltraGridRow ultraGridRow = mesGrid.ActiveRow;
Qty = Convert.ToInt32(ultraGridRow.GetCellValue("Calculated_NetWeight"));
JobNumber = ultraGridRow.GetCellValue("SerialNo_JobNum").ToString();
LaunchFormOptions opts = new LaunchFormOptions();
opts.IsModal = true;
opts.ContextValue = ((Convert.ToInt32(Qty)) + "~" + Convert.ToString(JobNumber));
ProcessCaller.LaunchForm(oTrans,"IMGO3019",opts);
}
The below code for try to bind the Job Number and Qty in Job Receive Salvage
// **************************************************
// Custom code for RcptToSalForm
// Created: 15/12/2020 13:18:27
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
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 **
private EpiDataView edvPartTran;
private decimal Qty = 0;
private string JobNumber = string.Empty;
// 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
this.edvPartTran = ((EpiDataView)(this.oTrans.EpiDataViews["PartTran"]));
this.edvPartTran.EpiViewNotification += new EpiViewNotification(this.edvPartTran_EpiViewNotification);
// 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
this.edvPartTran.EpiViewNotification -= new EpiViewNotification(this.edvPartTran_EpiViewNotification);
this.edvPartTran = null;
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
private void RcptToSalForm_Load(object sender, EventArgs args)
{
//string PartNumber = string.Empty;
// Add Event Handler Code
/*if(RcptToSalForm.LaunchFormOptions !=null)
{
EpiDataView edvCustomView = (EpiDataView)RcptToSalForm.LaunchFormOptions.ContextValue;
if(edvCustomView !=null)
{
string Param = RcptToSalForm.LaunchFormOptions.ContextValue.ToString();
char[] delimiterChars = {'~'};
string[] SplitParam = Param.Split(delimiterChars);
if (SplitParam.Length != 0)
{
MessageBox.Show("2");
MessageBox.Show("Part Number - " + Convert.ToString(SplitParam[0]));
MessageBox.Show("Job Number - " + Convert.ToString(SplitParam[1]));
PartNumber = Convert.ToString(SplitParam[0]);
JobNumber = Convert.ToString(SplitParam[1]);
edvCustomView.dataView[edvCustomView.Row]["PartNum"] = "001";
edvCustomView.dataView[edvCustomView.Row]["JobNum"] = "002";
}
}
}*/
if (RcptToSalForm.LaunchFormOptions != null)
{
MessageBox.Show("1");
string Param = RcptToSalForm.LaunchFormOptions.ContextValue.ToString();
char[] delimiterChars = {'~'};
string[] SplitParam = Param.Split(delimiterChars);
if(SplitParam != null)
{
MessageBox.Show("2");
MessageBox.Show(SplitParam[0].ToString());
MessageBox.Show(SplitParam[1].ToString());
EpiDataView reqedv = (EpiDataView)(oTrans.EpiDataViews["PartTran"]);
reqedv.dataView[reqedv.Row]["ActTranQty"] = Convert.ToInt32(SplitParam[0].ToString());
reqedv.dataView[reqedv.Row]["JobNum"] = Convert.ToString(SplitParam[1]);
//Qty = Convert.ToInt32(SplitParam[0]);
//JobNumber = Convert.ToString(SplitParam[1]);
}
//EpiDataView reqedv = (EpiDataView)(oTrans.EpiDataViews[“MoveRequest”]);
//reqedv.dataView[reqedv.Row]["JobNum"] = jobnumbertext;
/* object o = RcptToSalForm.LaunchFormOptions.ValueIn;
string[] values = (string[])o;
EpiDataView edvReportParams = (EpiDataView)oTrans.EpiDataViews["PartTran"];
MessageBox.Show(values[0].ToString());
MessageBox.Show(values[1].ToString());
/
//edvReportParams.dataView[edvReportParams.Row][“ActTranQty”] = values[0];
//edvReportParams.dataView[edvReportParams.Row][“JobNum”] = values[1];
/
EpiDataView edv = ((EpiDataView)(this.oTrans.EpiDataViews[“PartTran”]));
//System.Data.DataRow edvMainRow = edv.CurrentDataRow;
//DataRow edv = ((EpiDataView)oTrans.EpiDataViews[“PartTran”]).CurrentDataRow;
string Param = RcptToSalForm.LaunchFormOptions.ContextValue.ToString();
char[] delimiterChars = {'~'};
string[] SplitParam = Param.Split(delimiterChars);
if (SplitParam.Length != 0)
{
//EpiDataView edv = ((EpiDataView)(this.oTrans.EpiDataViews["PartTran"]));
//System.Data.DataRow edvJobRcv = edv.CurrentDataRow;
//if ((edvMainRow != null))
//{
MessageBox.Show("2");
MessageBox.Show("Qty - " + Convert.ToString(SplitParam[0]));
MessageBox.Show("Job Number - " + Convert.ToString(SplitParam[1]));
Qty = Convert.ToInt32(SplitParam[0]);
JobNumber = Convert.ToString(SplitParam[1]);
edv.dataView[edv.Row]["PartTran.ActTranQty"] = SplitParam[0];
edv.dataView[edv.Row]["PartTran.JobNum"] = SplitParam[1];
MessageBox.Show("Part Number - " + Qty);
MessageBox.Show("Job Number - " + JobNumber);
*/
/*edvOrderHed.dataView[edvOrderHed.Row][“PONum”] = PartNumber;
edvOrderHed.dataView[edvOrderHed.Row][“PONum”] = JobNumber;
edvMainRow["PartNum"] = PartNumber;
edvMainRow["JobNum"] = JobNumber;
edvMainRow.BeginEdit();
edvMainRow["JobNum"] = Convert.ToString(SplitParam[0]);
edvMainRow["PartNum"] = Convert.ToString(SplitParam[1]);
edvMainRow.EndEdit();*/
//}
//edv["JobNum"] = Convert.ToString(SplitParam[0]);
//edv["PartNum"] = Convert.ToString(SplitParam[1]);
//rmAReceipt = Convert.ToInt32(SplitParam[2]);
//MessageBox.Show(JobNumber.ToString());
//MessageBox.Show(Qty.ToString());
//}
}
}
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))
{
if ((args.Row > -1))
{
}
}
}
}
Please find the below screen shot: