In 10.2.300 Quote Entry, trying to create a MOM from data in a UD table.
I can create operations on assembly 0 okay (ops 10 - 30), and can create a subassembly okay. The issue is creating an operation on the subassembly.
The subassembly, sequence 1, gets focus after it’s created and it’s updated with oTrans.Update(). So far so good.
At a messagebox just before I get a new operation record with GetNewJobOper(false), the subassembly still has focus and the assembly sequence in edvJobAsmbl.CurrentDataRow[“AssemblySeq”] is 1. Still okay.
But upon getting the new job operation instead of getting op 10 on subassembly 1, it’s placed on assembly 0 and focus goes to the new operation created on assembly 0 instead of 1.
I would expect the new operation to be created on the current focus subassembly.
I substituted edvJobAsmbl with edvCurrAsm, and saw no changes in operation.
By the time I create the new operation, I have added operations on assembly 0 and have added assembly 1, and assembly 1 is displayed with focus on it. By my thinking, adding a new operation would be added to the current subassembly, but it’s not happening.
But, if I then physically click on assembly 1 in the jobtree and then add just the operations, they add in at the right place.
I wonder if there is a way to programmatically select the assembly I’ve just added. ??
Here’s the code. The first thing I do after getting the new record is set the assembly sequence, but the record has already been added under assembly 0. Setting it to 1 generates an error.
I’m wondering what I might see passed in on a BPM. Will try than next.
Thanks for the ideas.
Joe
private void getFSJobOper(string externalreferenceid, string assemblyseq)
{
// BAQ for records from Fan Selector - UD03
string baqName = "TCF_FSQuoteLineOpr";
dtFSJobOper = null;
DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID(baqName);
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("paramExternalReferenceID", externalreferenceid, "nvarchar", false, Guid.NewGuid(),"A");
qeds.ExecutionParameter.AddExecutionParameterRow("paramAssemblySeq", assemblyseq, "nvarchar", false, Guid.NewGuid(),"A");
dqa.ExecuteByID(baqName,qeds);
dtFSJobOper = dqa.QueryResults.Tables["Results"];
dqa.Dispose();
if (dtFSJobOper.Rows.Count > 0)
{
for (int i = 0; i < dtFSJobOper.Rows.Count; i++)
{
bool result = oTrans.GetNewJobOper(false);
// we set the assembly sequence here, but it's already been set to asm 0 on the getnewjoboper
edvJobOper.CurrentDataRow["AssemblySeq"] = dtFSJobOper.Rows[i]["UD03_AssemblySeq_c"].ToString();
edvJobOper.CurrentDataRow["OprSeq"] = dtFSJobOper.Rows[i]["UD03_OprSeq_c"].ToString();
edvJobOper.CurrentDataRow["OpCode"] = dtFSJobOper.Rows[i]["UD03_OpCode_c"].ToString();
edvJobOper.CurrentDataRow["EstSetHours"] = dtFSJobOper.Rows[i]["UD03_EstSetHours_c"].ToString();
edvJobOper.CurrentDataRow["ProdStandard"] = dtFSJobOper.Rows[i]["UD03_ProdStandard_c"].ToString();
edvJobOper.CurrentDataRow["StdFormat"] = dtFSJobOper.Rows[i]["UD03_StdFormat_c"].ToString();
edvJobOper.CurrentDataRow["QtyPer"] = dtFSJobOper.Rows[i]["UD03_QtyPer_c"].ToString();
edvJobOper.CurrentDataRow["EstScrap"] = dtFSJobOper.Rows[i]["UD03_EstScrap_c"].ToString();
edvJobOper.CurrentDataRow["EstScrapType"] = dtFSJobOper.Rows[i]["UD03_EstScrapType_c"].ToString();
edvJobOper.CurrentDataRow["IUM"] = dtFSJobOper.Rows[i]["UD03_IUM_c"].ToString();
oTrans.Update();
}
}
}
No, that example was from JobEntry so I’m not sure it will work. I also took a quick peek at the code for the QuoteEntry form and it appears the method on oTrans is hardcoded to use the value of the assembly sequence in the currentAssyView. Hope that helps!