In the other/cross posted question, I posted a potential answer - hope it helps.
Unfortunately the only entity available in document rules is quote Dtl. UD tables are not offered.
You could do three things:
- a post-configurator BPM that creates/writes the data to the correct line in UD25, or
- you could move the fields to be QuoteDTL UD fields like us (number of fields don’t matter, plus you can have as many of a given type as you want which would be easier unless you have to have UD25 separate), or
- you could build your tab in Quote Entry as a dynamic BAQ that uses the PcInputValue View provided by Epicor. It would be a big BAQ for that many values, but it would not require having the data duplicated into UD fields and the BAQ/View could be used in other places.
Hi Lori,
I do something similar to copy all the Configurator Input data into the UD fields. We have quotes/orders being created by API call, so I need to have all of the document rules able to run server-side when there are no configurator inputs.
In the Configurator “OnPageLeave” expression, I call a server-side UD Method, that looks like this:
//__ LINQ Query: Get DB Fields from OrderDtl/QuoteDtl __________________
dynamic ld = 0;
if (Context.Entity == "OrderDtl") {
ld = Db.OrderDtl.Where(od => od.Company == Context.CompanyID
&& od.OrderNum == Context.OrderNumber
&& od.OrderLine == Context.OrderLineNumber).FirstOrDefault();
} else if (Context.Entity == "QuoteDtl") {
ld = Db.QuoteDtl.Where(qd => qd.Company == Context.CompanyID
&& qd.QuoteNum == Context.QuoteNumber
&& qd.QuoteLine == Context.QuoteLineNumber).FirstOrDefault();
}
//____________________________________________________________________
if (Context.Entity == "OrderDtl" || Context.Entity == "QuoteDtl") {
// Order Info Fields
ld.PID_c = Inputs.cPID.Value;
ld.Dx_c = Inputs.cDx.Value;
ld.OrderNotes_c = Inputs.eOrderNotes.Value;
ld.Height_c = Inputs.dHeight.Value;
ld.Width_c = Inputs.dWidth.Value;
ld.Depth_c = Inputs.dDepth.Value;
}
This gets all the data from the Configurator Inputs into the OrderDtl or QuoteDtl table when the configurator is saved, and then I can access those fields in the Document Rules. Because the API orders/quotes don’t have any configurator input data, I also have a reversed UDMethod that is called on “OnPageLoaded” that populates the Inputs from the UD table.
//__ LINQ Query: Get DB Fields from OrderDtl/QuoteDtl __________________
dynamic ld = 0;
if (Context.Entity == "OrderDtl") {
ld = Db.OrderDtl.Where(od => od.Company == Context.CompanyID
&& od.OrderNum == Context.OrderNumber
&& od.OrderLine == Context.OrderLineNumber).FirstOrDefault();
} else if (Context.Entity == "QuoteDtl") {
ld = Db.QuoteDtl.Where(qd => qd.Company == Context.CompanyID
&& qd.QuoteNum == Context.QuoteNumber
&& qd.QuoteLine == Context.QuoteLineNumber).FirstOrDefault();
}
//____________________________________________________________________
if (Context.Entity == "OrderDtl" || Context.Entity == "QuoteDtl") {
// Order Info Fields
Inputs.cPID.Value = ld.PID_c;
Inputs.cDx.Value = ld.Dx_c;
Inputs.eOrderNotes.Value = ld.OrderNotes_c;
Inputs.dHeight.Value = ld.Height_c;
Inputs.dWidth.Value = ld.Width_c;
Inputs.dDepth.Value = ld.Depth_c;
}
It’s really convenient in the Document Rules. The method rules get a little more complicated, because in order to access those OrderDtl_UD fields from the Rule Actions, you’d have to call a query on every material or operation, which is way too many. There’s an easy fix using method variables, though. Let me know if you are interested in that.