I am using FormFieldValue to copy a field from a SubForm (TAXABLE) to the Parent form(TRANSTAXABLE). The routine does this for about ten elements. They all work good except for the Boolean field. No matter what the source value is (Y/N/null), the destination value ends up as NULL.
The source field is a normal bound Boolean field.
The destination field is an unbound field, set to Boolean format.
When I do the reverse, and send the unbound Parent field to the bound element on the subform, it does work OK. It only fails when trying to update the unbound boolean field. All of the elements on the parent form are also unbound. And all the elements on the subform are bound.
============================
If SortNo <> 0 Then {
FormFieldValue(sParentFormName, "TransSortNo", 0, SortNo)
} Else {
FormFieldValue(sParentFormName, "TransSortNo", 0, "")
}
FormFieldValue(sParentFormName, "TransParentOrder", 0, ParentOrder)
// FormFieldValue(sParentFormName, "Record", 0, ParentRecord)
FormFieldValue(sParentFormName, "TransClass", 0, ItemClass)
FormFieldValue(sParentFormName, "TransAccount", 0, Account)
FormFieldValue(sParentFormName, "TransItem", 0, Item)
FormFieldValue(sParentFormName, "TransDescription", 0, Description)
FormFieldValue(sParentFormName, "TransTaxable", 0, Taxable)
If OrderQty <> 0 Then {
FormFieldValue(sParentFormName, "TransOrderQty", 0, OrderQty)
} Else {
FormFieldValue(sParentFormName, "TransOrderQty", 0, "")
}
If ShipQty <> 0 Then {
FormFieldValue(sParentFormName, "TransShipQty", 0, ShipQty)
} Else {
FormFieldValue(sParentFormName, "TransShipQty", 0, "")
}
//If BOQty <> 0
FormFieldValue(sParentFormName, "TransBOQty", 0, BOQty)
//Else
// FormFieldValue(sParentFormName, "TransBOQty", 0, "")
If UnitPrice <> 0 Then {
FormFieldValue(sParentFormName, "TransUnitPrice", 0, UnitPrice)
} Else {
FormFieldValue(sParentFormName, "TransUnitPrice", 0, "")
}
If Discount <> 0 Then {
FormFieldValue(sParentFormName, "TransDiscount", 0, Discount)
} Else {
FormFieldValue(sParentFormName, "TransDiscount", 0, "")
}
If ExtPrice <> 0 Then {
FormFieldValue(sParentFormName, "TransExtPrice", 0, ExtPrice)
} Else {
FormFieldValue(sParentFormName, "TransExtPrice", 0, "")
}
If SalesTax <> 0 Then {
FormFieldValue(sParentFormName, "TransSalesTax", 0, SalesTax)
} Else {
FormFieldValue(sParentFormName, "TransSalesTax", 0, "")
}
// Recalculate Line Item Extended Price
mysubCalcLine()
Thanks to Carl for an old article he wrote that inspired this code for me.