I need some guidance to figure out why this custom form blanks after executing the UD05Form_Load code.
{
// Add Event Handler Code
//**********************************
// See if the UD05 record exist
//**********************************
string JobNum = "";
string AsmSeq = "";
string OprSeq = "";
string OpCode = "";
string Serial = "";
//See if something is calling the form with parameters
if (UD05Form.LaunchFormOptions != null)
{
if (UD05Form.LaunchFormOptions.ContextValue != null)
{
string MyData = UD05Form.LaunchFormOptions.ContextValue.ToString();
if (MyData != "")
{
//Parse the "|" delimited string
string[] words = MyData.Split('|');
JobNum = words[0];
AsmSeq = words[1];
OpCode = words[2];
Serial = words[3];
OprSeq = words[4];
}
}
}
//Note: If we are checking to see if the serial is not “” then we are eliminating FAB jobs from this process, may want to remove that check
if (JobNum != "" && AsmSeq != "" && OprSeq != "" && Serial != "" && OpCode != "")
{
//Put the first code I sent you to Load to Create a UD05 record here
bool RecordExist = false;
string whereClause = "Company = 'DTSF' AND Key1 = '" + JobNum + "' AND Key2 = '" + AsmSeq + "' AND Key3 = '" + OpCode + "' AND Key4 = '" + Serial + "' AND Key5 = '" + OprSeq + "'";
bool recordSelected;
bool showSearch = false;
DataSet fSet = SearchFunctions.listLookup(UD05Form, "UD05Adapter", out recordSelected, showSearch, whereClause);
//If record exist…
if (fSet.Tables[0].Rows.Count > 0)
{
oTrans.GetByID(JobNum, AsmSeq, OpCode, Serial, OprSeq);
}
//Else, record does not exist
else
{
//Record Does Not Exist.
oTrans.GetNew(JobNum, AsmSeq, OpCode, Serial, OprSeq);
oTrans.Update();
oTrans.GetByID(JobNum, AsmSeq, OpCode, Serial, OprSeq);
EpiDataView edv = (EpiDataView)(oTrans.EpiDataViews["UD05"]);
//edv.dataView[edv.Row]["Key1"] = JobNum;
//edv.dataView[edv.Row]["Key2"] = AsmSeq;
//edv.dataView[edv.Row]["Key3"] = OpCode;
//edv.dataView[edv.Row]["Key4"] = Serial;
//edv.dataView[edv.Row]["Key5"] = OprSeq;
string baqID = "DTSF-JobAssemDesc";
DynamicQueryAdapter dyAdpt = new DynamicQueryAdapter(UD05Form);
dyAdpt.BOConnect();
Ice.BO.QueryExecutionDataSet execSet = dyAdpt.GetQueryExecutionParametersByID(baqID);
execSet.ExecutionParameter.Clear();
execSet.ExecutionParameter.AddExecutionParameterRow("JobNum", JobNum, "nvarchar", false, Guid.NewGuid(), "A");
execSet.ExecutionParameter.AddExecutionParameterRow("AsmSeq", AsmSeq, "int", false, Guid.NewGuid(), "A");
dyAdpt.ExecuteByID(baqID, execSet);
edv.dataView[edv.Row]["Character01"] = dyAdpt.QueryResults.Tables["Results"].Rows[0]["JobAsmbl_Description"].ToString();
//edv.dataView[edv.Row]["ShortChar03"] = dyAdpt.QueryResults.Tables["Results"].Rows[0]["JobAsmbl_ShortChar01"].ToString();
//edv.dataView[edv.Row]["ShortChar10"] = dyAdpt.QueryResults.Tables["Results"].Rows[0]["JobAsmbl_ShortChar08"].ToString();
//edv.dataView[edv.Row]["ShortChar11"] = dyAdpt.QueryResults.Tables["Results"].Rows[0]["JobAsmbl_ShortChar09"].ToString();
neTempPrintLength.Value = Convert.ToDouble(dyAdpt.QueryResults.Tables["Results"].Rows[0]["JobAsmbl_Number01"].ToString());
nePrintTopStrap.Value = Convert.ToDouble(dyAdpt.QueryResults.Tables["Results"].Rows[0]["JobAsmbl_Number08"].ToString());
nePrintBotStrap.Value = Convert.ToDouble(dyAdpt.QueryResults.Tables["Results"].Rows[0]["JobAsmbl_Number09"].ToString());
edv.dataView[edv.Row]["ShortChar03"] = GetFractionalForm(Convert.ToDouble(neTempPrintLength.Value.ToString()));
edv.dataView[edv.Row]["ShortChar10"] = GetFractionalForm(Convert.ToDouble(nePrintTopStrap.Value.ToString()));
edv.dataView[edv.Row]["ShortChar11"] = GetFractionalForm(Convert.ToDouble(nePrintBotStrap.Value.ToString()));
dyAdpt.Dispose();
//txtDesc.ReadOnly = true;
//oTrans.JobNum, AsmSeq, OpCode, Serial, OprSeq);
}
}
}```