Quote Head to QuoteDtl Field Copy

  • 22 June 2023
  • 2 replies
  • 52 views

Hi,

 

I have created copy fields from the QuoteHed to the QuoteDtl.

 

We set the dates at a header level and have these copy through as a default when a new line is created which we want to overwrite by exception if needed:

 

I have written an InTransaction BPM to do this which works perfectly.

 

var ttQuoteDtl_xRow = (from ttQuoteDtl_Row in ttQuoteDtl
select ttQuoteDtl_Row).FirstOrDefault();
if(ttQuoteDtl_xRow != null)
{
    var QuoteHed = (from QuoteHed_Row in Db.QuoteHed
      where QuoteHed_Row.Company == Session.CompanyID
      && QuoteHed_Row.QuoteNum == ttQuoteDtl_xRow.QuoteNum
    select QuoteHed_Row).FirstOrDefault();
    if(QuoteHed != null)
    {
      ttQuoteDtl_xRow.EntryDate_c = QuoteHed.EntryDate;
      ttQuoteDtl_xRow.DueDate_c = QuoteHed.DueDate;
      ttQuoteDtl_xRow.DateQuoted_c = QuoteHed.DateQuoted;
      ttQuoteDtl_xRow.ExpirationDate_c = QuoteHed.ExpirationDate;
      ttQuoteDtl_xRow.FollowUpDate_c = QuoteHed.FollowUpDate;
      ttQuoteDtl_xRow.ExpectedClose_c = QuoteHed.ExpectedClose;
    }
}

 

However, I am unable to change the date as the BPM forces the line item date back to the header date, how do I copy the field then keep it dynamic so we can change the dates at line level after the initial copy.

 

Thanks in advance all

Steve


2 replies

Userlevel 3

Add a condition to only run the BPM when the Quotedtl.RowMod = “A”

this will then only run the first time the row is created on the quoteDtl and allows for you to update it.

Userlevel 4

Unsure as to why you need a modification for this, if you set the dates at the quote header these will default at the line level but can be overridden.

So, add a quote then navigate to the Quote | Details tab/area and add a Need By and Ship by Date, then when you add lines these will inherit the header dates which you can override on  a line by line basis.  Any orders created from the quote inherit the dates to create the lines/release information.

I  can see that you are calling a number of “custom” fields (_c) but these are standard fields in the default dataset.

Am I missing something?

 

Reply