Revalue Foreign Supplier Accounts screen: how to print the report with temporary value?

SOLVED

Hi all,

on customization on the Revalue foreign supplier account screen, where the Period Exchange Rate field is enabled. When user click OK button, I need the report generated to use the value from the edited Period Exchange Rate field. 

I have look into the code on this screen, the print report function and its transient table/view is protected, means I cannot amend the data.

   

How can I generate the report, but with my temporary value, without affecting the standard table?

thank you

  • 0

    Hi

    As the data is generated 'on the fly', you may not be able edit how the form calculates the data, but could use SQL Profiler to get which select statements are used to calculate the values using the standard Exchange Rate value on this form.  Then use them to create your own and substitute your custom value instead.

    Hope this helps

    Anthony

  • 0

    In the BeforeClick event, get hold of the adjustment using

    Sage.Common.Helper.PropertyHelper.GetValue(form.UnderlyingControl,"Adjustment")

    then you can do what you want with the adjustment.RevaluedTradingAccountEntries

  • +1 in reply to Geoff Turner
    verified answer

    I haven't tested it (no suitable demo data), but I think all you need to do (assuming it's a Period exchange rate) is set Adjustment.PeriodDocumentToBaseCurrencyRate.ExchangeRate in the BeforeClick event. The revaluation should then use that rate.

  • 0 in reply to Geoff Turner

    thank you. This method works for me. I also need to set the value for Adjustment.SingleDocumentToBaseCurrencyRate.ExchangeRate.

    Sage.Accounting.TradeLedger.TradingRevaluationAdjustment Adjustment = (Sage.Accounting.TradeLedger.TradingRevaluationAdjustment) Sage.Common.Helper.PropertyHelper.GetValue(_form.UnderlyingControl, "Adjustment");
    Adjustment.PeriodDocumentToBaseCurrencyRate.ExchangeRate = Convert.ToDecimal(periodExchangeRateTextBox.Text);
    Adjustment.SingleDocumentToBaseCurrencyRate.ExchangeRate = Convert.ToDecimal(periodExchangeRateTextBox.Text);