Configurator To Create New Quote Lines

I was wondering if someone could shed some light on a process to create new lines based on some options that are selected in the product configurator. Either user defined method or BPM or function.

These items are not configurable they are stock manufactured parts.

This is doable. We have a user defined method that is called from the document rules of the Configurator. The UD Method basically connects to the Quote BO and fires the appropriate methods that you’d see being called when manually creating a new line. It uses the Lookup tables to decide which lines need to be added based on the selections in the Configurator.

1 Like

So i have found out how to get the line created but i am having an issue getting the right context for a UD field in the QuoteDtl This is in a User defined method (Server)

returnVal = "Start create";

DateTime shipDate = new DateTime();

if (quoteNum > 0 && partNum.Length > 0)
{
	Erp.Contracts.QuoteSvcContract quote;
	quote = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.QuoteSvcContract>(Db);
	Erp.Tablesets.QuoteTableset quoteTableset;

	quoteTableset = quote.GetByID(quoteNum);

	quote.GetNewQuoteDtl(ref quoteTableset, quoteNum);

	var quoteDtl_xRow = (from quoteDtl_Row in quoteTableset.QuoteDtl
			select quoteDtl_Row).LastOrDefault();
	bool lSubstitutePartsExist = false;
	string uomCode = "";

	int year = 0;        

	if(quoteDtl_xRow != null)
	{
			quoteDtl_xRow.PartNum = partNum;
			quoteDtl_xRow.Options_c = true;
			if(reqQty > 0)
						   quoteDtl_xRow.SellingExpectedQty = reqQty;
						   quoteDtl_xRow.OrderQty = reqQty;

			if(shipDate != null && shipDate >= DateTime.Today)
						   quoteDtl_xRow.ReqShipDate = shipDate;

			returnVal = "Quote Num: " + Convert.ToString(quoteDtl_xRow.QuoteNum);
			returnVal += " - part Num: " + quoteDtl_xRow.PartNum;
	}

	quote.ChangePartNum(ref quoteTableset, lSubstitutePartsExist, uomCode);

	returnVal += " - uomCode " + uomCode;
	
	returnVal += " - Part Desc: " + quoteDtl_xRow.LineDesc;

	quote.Update(ref quoteTableset);

	returnVal += " - Quote Line: " + Convert.ToString(quoteDtl_xRow.QuoteLine);

	quote = null;
	quoteTableset = null;

}

Getting this error message not sure how i can find the context to get that field.

image

Totally agree that this is doable… one challenge that I have always run into is that “someday” someone will say “When we reconfigure, the system is not updating the old lines, but it is creating new ones”. The initial “create” is easy, but updating/deleting is the difficult part.

1 Like

You will probably need to change

quoteDtl_xRow.Options_c = true;

to

quoteDtl_xRow["Options_c"] = true;

There’s certainly some extra thought that needs to go into it. Part of our UD method deletes the lines and re-creates them when reconfiguring… but that leads to a new problem. If there are any open jobs tied to the lines, we have to kill those jobs before we can re-configure. So that forced us to also add a check for open jobs in the Configurator so that if there are any jobs tied to any lines, it will not let the user re-configure and instructs them to kill the jobs first. Then, there’s also the point of no return… where we might require a reconfigure but an order is already partially fulfilled. Then we’re stuck and end up having to write a new order for the remainder. It can be a pain. But for some reason that’s how we like it. :slight_smile:

Yes that is a good point. I have explained that they will have to delete the new lines if need to reconfigure.

Also we are only handling this during the quote phase.

This is close when i replace i am missing something.

quoteDtl_xRow.[“Options_c”] = true;

image

take out the . between xRow and [“Options_c”]. That was my bad.