Quote Duplication does not retain operation times

Anyone have any ideas on this? To be specific, I have a configured part and all the op times are different and come from a UD table. Upon duplication of the quote for these configured part(s), the duplicated quote does not retain the operation time from the original. Would this be a “BUG” or an intended feature?

You will need to create a BPM to do this. There might be another way, but Epicor will not know for sure what to do with UD fields.

Run a trace on the action. Check to see what Business Object is being call. Create a POST Process BPM to do the copy records.

Ummm it’s not a ‘UD Field’.

Now look at the Prod Std column of the duplicated quote here:

Thought you said UD field. It is UD table.

What is coming from the UD table?

Sample Data

Is there a reason it would not use a snapshot of the quote (line) dataset for duplication and/or something in the code causing this to not copy over?

Here is the standardish rule for op times:

decimal OpTime = UDMethods.GetOpTime(Inputs.txtTrailer.Value, Inputs.txtModelYr.Value, "", OpId);

switch (Context.Entity)
	{
	case "JobOper":
		JobOper.ProdStandard = OpTime;
		JobOper.StdFormat = "MP";
		break;
	case "QuoteOpr":
		QuoteOpr.ProdStandard = OpTime;
		QuoteOpr.StdFormat="MP";
		break;
	}

UDMethods.GetOpTime :

var timeRow = (	from row in Db.UD39 
								where row.Company == Context.CompanyID && 
								 row.Key1 == Trailer.Substring(2) && 
								 row.Key2 == ModelYear &&
								 row.Key3 == Rev
								select row).FirstOrDefault();

if (timeRow != null) 
	{
	switch (OpId)
		{
		case "1":
			return timeRow.Number01;
			break;
		case "2":
			return timeRow.Number02;
			break;
		case "3":
			return timeRow.Number03;
			break;
		case "4":
			return timeRow.Number04;
			break;
		case "5":
			return timeRow.Number05;
			break;	
		case "6":
			return timeRow.Number06;
			break;
		case "7":
			return timeRow.Number07;
			break;
		case "8":
			return timeRow.Number08;
			break;
		case "9":
			return timeRow.Number09;
			break;
		case "10":
			return timeRow.Number10;
			break;
		case "11":
			return timeRow.Number11;
			break;
		case "12":
			return timeRow.Number12;
			break;
		case "13":
			return timeRow.Number13;
			break;
		case "14":
			return timeRow.Number14;
			break;
		case "15":
			return timeRow.Number15;
			break;
		case "16":
			return timeRow.Number16;
			break;
		case "17":
			return timeRow.Number17;
			break;
		case "18":
			return timeRow.Number18;
			break;
		case "19":
			return timeRow.Number19;
			break;
		case "20":
			return timeRow.Number20;
			break;
		}
	}
return -1m;

Where is the code you pasted in here located? on a form/bpm/function

Where are these Inputs coming from?

Configurator
UD Method

The UDMethod Code I pasted above:

you could simplify this by making the numbers into an array instead of the case statement.

var timeRow = Db.UD39.Where(x =>
    x.Company == Context.CompanyID &&
    x.Key1 == TrailerSubstring(2) &&
    x.Key2 == ModelYear &&
    x.Key3 == Rev).FirstOrDefault();

int opNumber;
bool opIsANumber = int.TryParse(OpId, opNumber);
valueToReturn = -1m;  //default if not found

if (timeRow != null && opANumber && opNumber >= 0 && opNumber < 20) {
    //convert to an array
    decimal[] opValues = {
    timeRow.Number01,    timeRow.Number02,    timeRow.Number03,    timeRow.Number04,    timeRow.Number05,
    timeRow.Number06,    timeRow.Number07,    timeRow.Number08,    timeRow.Number09,    timeRow.Number10,
    timeRow.Number11,    timeRow.Number12,    timeRow.Number13,    timeRow.Number14,    timeRow.Number15,
    timeRow.Number16,    timeRow.Number17,    timeRow.Number18,    timeRow.Number19,    timeRow.Number20
    };

    valueToReturn = opValues[opNumber];
}
return valueToReturn;
1 Like

Did you have any idea why the Op Times are not being duplicated when the Duplicate Quote action is used?

well… if this is configured, I believe that copying does not run the configurator rules… I think that the expectation is that the configurator would run again to process the rules.

Ok, so would you think this is a BUG or ‘intended’ feature?? I would have assumed it just took snapshot of the dataset ops and times but it does not. Do I just write up a BPM then or?

I would think it should run the configurator against the existing GroupSeq data, or do a proper full copy. I cannot see why it would not duplicate the times with everything else as it copied over the materials and operations correctly.

Ok after going through this more and getting a little more information, I found out they were checking the Operation Standards causing it to ignore the configuration and instead pull from the Operations Standards Master File (per help). This is what was zeroing the configuration time values as these are all calculated individually and specifically per trailer model configuration selection.

( Bad checkbox below for our configured product :frowning: )
image

Sorry for the confusion and thanks to all who looked at this!

1 Like