0
votes

I try to modify the sum calculation for Requisition bidding total value by adding custom field from each Requisition Bidding line. here is the definition of custom DAC

[PXDBCurrency(typeof(RQBidding.curyInfoID), typeof(RQBidding.quoteExtCost))]
[PXUIField(DisplayName = "Bid Extended Cost", Visibility = PXUIVisibility.SelectorVisible, Enabled = false)]
[PXFormula(typeof(Add<Mult<RQBidding.quoteQty, RQBidding.curyQuoteUnitCost>, RQBiddingExt.usrCuryPatternCost>), typeof(SumCalc<RQBiddingVendor.curyTotalQuoteExtCost>))]
[PXDefault(TypeCode.Decimal, "0.0"

the custom field is usrCuryPatternCost. The problem is, when user are not inputing Pattern Cost, the total value would not updated with the total value. How to keep total value updated even when user not inputting the custom field?

1
does it calculate if the user enters in the quoteQty or the curyQuoteUnitCost? - Brendan
yes it does when using standard PXFormula --> Mult<RQBidding.quoteQty, RQBidding.curyQuoteUnitCost>. It seems that when user not inputting, the pattern cost value is null so the SumCalc are not executed. - Arsiadi
What happens if your wrap your field inthe PXFormula in IsNull? IsNull<RQBidding.curyQuoteUnitCost, decimal0> - Brendan
it is going to be the answer that I looking for. It works with wrapped it in IsNull attribute. thanks mate. - Arsiadi
you are welcome. glad i could help. - Brendan

1 Answers

0
votes

Try to wrap the field in an IsNull to avoid the null in the formula like so:

[PXFormula(typeof(Add<Mult<RQBidding.quoteQty, RQBidding.curyQuoteUnitCost>,
    IsNull<RQBidding.usrCuryPatternCost, decimal0>>),
    typeof(SumCalc<RQBiddingVendor.curyTotalQuoteExtCost>))]