Scheduling Build Project Analysis, how to refresh the project list?

I don’t mean to underestimate you and don’t know how generic/specific you mean this.

But I was just reviewing a Function where we take a BAQ (with parameter) and shove the results into a UD table, so it’s fresh if you’d like some guidance.

I don’t do BPA (odd, though, it’s the 3rd or 4th post on it that I have responded to in the last week or so). But I assume there is enough overlap as far as making a Function, that this should help.

I’ll spare you the details for now until you ask for them. But this is the overview.

Don’t tell @Banderson that there is some code in there.

Though he actually is the one that showed me how

All this does is spares me from dozens of Set Field widgets. It can be done without code.

  Action<string, string> UpdateValues = (UD14FieldName, BAQFieldName) =>
  {
    dsNewUD14Rows.UD14[iCount][UD14FieldName] = dsTheResults.Tables[0].Rows[iCount][BAQFieldName];  
  };

/* Update the dataset*/
  dsNewUD14Rows.UD14[iCount].Key1 = Guid.NewGuid().ToString();
  UpdateValues("ShortChar01", "Calculated_PartNumber");
  UpdateValues("ShortChar02", "Calculated_Station");
  UpdateValues("ShortChar03", "Calculated_KitID");
  UpdateValues("Character01", "Calculated_Task");
  UpdateValues("ShortChar04", "Calculated_TaskType");
  UpdateValues("Character02", "Calculated_TaskValue");
  UpdateValues("Character03", "Calculated_TruckType");
  UpdateValues("ShortChar05", "Calculated_Frequency");
  UpdateValues("Character04", "Calculated_SpecialEquipment");
  UpdateValues("ShortChar06", "Calculated_OperatorID");
  UpdateValues("ShortChar07", "Calculated_ProjectNumber");
  UpdateValues("ShortChar08", "Calculated_MachineIndex");
  UpdateValues("Character05", "Calculated_DefectNarrative1");
  UpdateValues("ShortChar09", "Calculated_AuditedByID1");
  UpdateValues("Character06", "Calculated_Defect1");
  UpdateValues("ShortChar10", "Calculated_DateTime1");
  UpdateValues("ShortChar11", "Calculated_QAAuditID1");
  UpdateValues("ShortChar12", "Calculated_FixedByID1");
  UpdateValues("Character07", "Calculated_DefectNarrative2");
  UpdateValues("ShortChar13", "Calculated_AuditedByID2");
  UpdateValues("Character08", "Calculated_Defect2");
  UpdateValues("ShortChar14", "Calculated_DateTime2");
  UpdateValues("ShortChar15", "Calculated_QAAuditID2");
  UpdateValues("ShortChar16", "Calculated_FixedByID2");
  UpdateValues("ShortChar17", "Calculated_InspStatus");
  UpdateValues("ShortChar18", "Calculated_InspPassFail");
  UpdateValues("Character09", "Calculated_UD13PK");
  UpdateValues("Character10", "Calculated_Sequence");

/*Time stamps*/
  dsNewUD14Rows.UD14[iCount].ShortChar19 = DateTime.Now.ToString(); //Create date-time
  dsNewUD14Rows.UD14[iCount].ShortChar20 = DateTime.Now.ToString(); //Change date-time
  dsNewUD14Rows.UD14[iCount].Date19 = DateTime.Today; //Create date
  dsNewUD14Rows.UD14[iCount].Date20 = DateTime.Today; //Change date
2 Likes