Need a way to find job creation date AND time

Hell everyone,

I need to see if there is a way to capture the timestamp of when a job was created so that it can be used in a baq. There is already a field (CreateDate) in the jobhead table for the date but there does not seem to be a timestamp field. Anyone have any creative ideas for getting the time, perhaps changelog records or something?

@cole.trent I do something like this to get Due Date Changes, but yours would be similar. BAQ with JobHead and ChgLog joined on Key1 and LogText like %new% and Tablename = JobHead.

The BAQ is updateable and the routine is on GetList Post processing. The cleanLog below would be simpler since the New Record is first and you would just be getting the 9 characters in front of New to convert into a timestamp.

string stringDate1 = string.Empty;
string stringDate2 = string.Empty;

Erp.Tables.JobOper JobOper;
Erp.Tables.JobOpDtl JobOpDtl;
Erp.Tables.JobProd JobProd;

foreach (var ttResults_xRow in ttResults)
{
  var ttResultsRow = ttResults_xRow;

  Ice.Diagnostics.Log.WriteEntry("CleanLog " + ttResultsRow.Calculated_CleanLog);
  Ice.Diagnostics.Log.WriteEntry("CleanLog length " + ttResultsRow.Calculated_CleanLog.Length);

  var ddStart = ttResultsRow.Calculated_CleanLog.IndexOf(" DueDate:") + 10;
  var ddDelim = ttResultsRow.Calculated_CleanLog.Substring(ddStart).IndexOf("->");
  var ddEnd = ttResultsRow.Calculated_CleanLog.Substring(ddStart + ddDelim + 3).IndexOf(" ");

  Ice.Diagnostics.Log.WriteEntry($"ddPos {ddStart} Delim {ddDelim} End {ddEnd}");

  if(ttResultsRow.Calculated_CleanLog.Contains("DueDate:") && ddStart > 0 && ddDelim > 0)
  {
    Ice.Diagnostics.Log.WriteEntry($"here {ttResultsRow.Calculated_CleanLog.Substring(ddStart,12)}");

    stringDate1 = ttResultsRow.Calculated_CleanLog.Substring(ddStart,ddDelim - 1);
    Ice.Diagnostics.Log.WriteEntry($"date1 {stringDate1}");

		if (ddEnd > 0)
		{
    stringDate2 = ttResultsRow.Calculated_CleanLog.Substring(ddStart + ddDelim + 3,ddEnd);
	  }
	  else
	  {
	  	stringDate2 = ttResultsRow.Calculated_CleanLog.Substring(ddStart + ddDelim + 3);
	  	stringDate2 = stringDate2.Trim();
	  }
	  
	  
    Ice.Diagnostics.Log.WriteEntry($"date2 {stringDate2}");


    Ice.Diagnostics.Log.WriteEntry($"date1 {stringDate1} date2 {stringDate2}");

    try
    {

      ttResultsRow.Calculated_PrevDueDate = DateTime.Parse(stringDate1);

    }
    catch
    {}

    try
    {
      ttResultsRow.Calculated_NewDueDate = DateTime.Parse(stringDate2);

    }
    catch
    {}

}

You should be able to get what you need from the job audit log table.

JobAudit ended up having what I was looking for, and due to some custom things we have there is another place I can get it from as well. I will definitely be keeping what you posted in mind for the future though, could prove to be useful!

You can add it to job entry or job tracker on the menu tree next to the job number.

@cole.trent good to hear. Our audit log is almost empty, so never use it.