I am trying to add currency conversion from base to selected currency but cant seem to put the pieces together. I am able to save the base currency but the conversions is not working. What am I missing?
The DAC
class GTItems
{
#region CuryInfoID
[PXDBLong]
[CurrencyInfo]
public virtual long? CuryInfoID { get; set; }
public abstract class curyInfoID : PX.Data.BQL.BqlLong.Field<curyInfoID> { }
#endregion
#region ItemAmt
[PXDBBaseCury]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? ItemAmt { get; set; }
public abstract class ItemAmt : PX.Data.BQL.BqlDecimal.Field<ItemAmt> { }
#endregion
#region CuryItemAmt
[PXUIField(DisplayName = "Item Amount", Enabled = false, Visibility = PXUIVisibility.Visible)]
[PXDBCurrency(typeof(curyInfoID), typeof(ItemAmt))]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? CuryItemAmt { get; set; }
public abstract class curyItemAmt : PX.Data.BQL.BqlDecimal.Field<curyItemAmt> { }
#endregion
}
The Graph
public class ItemsMaint : PXGraph<ItemsMaint, GTItems>
{
public PXSelect<GTItems> Items;
public PXSelect<CurrencyInfo, Where<CurrencyInfo.curyInfoID, Equal<Current<GTItems.curyInfoID>>>> currencyinfo;
}
Added to ASPX Pages
Included this link in the aspx pages for FormView
<pxa:PXCurrencyRate DataField="Curyid" ID="edCury" runat="server" RateTypeView="currencyinfo" DataMember="_Currency_" />
[I dont know where _Currency_ is from, got this from browsing through other acumatica screens]