Save QuoteQTY Calculated field in a UD field

Hi everyone,

It’s my first time working on customizations and really need some help. I’ve been reading a lot of the same scenario but still can’t get it.

I am working on QuoteQTY calculated fields (TotalCost , TotalLbrCost , TotalBurCost, TotalMtlCost, TotalMtlBurCost, TotalSubCost ). I’ve created a UD column named Truecost_c under QuoteHead table. What I would like to happen is to capture the QuoteQTY TotalCost in my Truedcost_c ud column. I’m now stuck in here. I am not sure if I am using the correct event type, also I think it also might be bcause my UD column is under quotedhead table and not quoteqty? Any help will be very much appreciated.

Cheers

I’ve just done the same to get the true cost of the Quote, you will need to add a UD field to the QuoteQTY table and a UD field to the QuoteDtl table and then sum them all up to the QuoteHead UD field

To populate the QuteQty UD field you will need to do a UI customization because most of the fields on that screen are not stored in the Database, then do a BPM triggered off the Quoted checkbox on the summary screen (which is in the QuoteHed table)

The BPM needs to cycle through all QuoteDtl and QuoteQty’s and sum up the UD fields… or you can do this last part in a BAQ and add a BAQ dataview to the summary screen… you will find all you need on this site to be able to achieve this

This is the QuoteQty Customization that I did

	private void quoteQtyGP()
	{
		EpiDataView quoteQtyEdv = (EpiDataView)(oTrans.EpiDataViews["QuoteQty"]);
		DataRow qtyRow = quoteQtyEdv.CurrentDataRow;
		
		decimal totalCost = Convert.ToDecimal(qtyRow["TotalCost"]);
		decimal totalComCost = Convert.ToDecimal(qtyRow["TotalCommProfit"]);
	
		qtyRow.BeginEdit();
		qtyRow["TotalCost_c"] = (totalCost + totalComCost);
		qtyRow.EndEdit();	
		this.oTrans.Update();
		this.oTrans.Refresh();	
	
	RefreshBAQDataView(quoteGPBAQDV);

I added a After field change event on the QuoteDtl table so it would trigger the QuoteQty calculation

private void QuoteDtl_AfterFieldChange(object sender, DataColumnChangeEventArgs args)
	{
		// ** Argument Properties and Uses **
		// args.Row["FieldName"]
		// args.Column, args.ProposedValue, args.Row
		// Add Event Handler Code
		switch (args.Column.ColumnName)
		{
			case "ReadyToQuote":
			quoteQtyGP();
			break;
       }

On the QuoteDtl table, If the part was a stocked item, I pulled the cost of the item in a BPM from the Part Cost table and added it the QuoteDtl UD field

Thanks for this. It really is something I can start to work with. Another question, where does the field “ReadyToQuote” actually points to? I need the UD fields to be filled up as soon as I open an existing quote.

Cheers

Hello @mriannejoy

My example above only works for new quotes,