Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

NAV2016 Use temporary data in SubForm

$
0
0
Hello

I am migrating a Form "Repayment Card" with Subform "subfrmRepaymentSchedule" from NAV4.1 to NAV2016. The subform data is based upon a Temporary Table "tmpPaymentForecast". I am getting an error:
"A transaction must be started before changes can be made to the database". When I debug the code, the error occurs on this line:

PaymentForecast..DELETEALL;

The Page/Sub Page is relationship is similar to this post:
mibuso.com/howtos/how-to-use-temporary-table-data-on-a-subform

Page - Repayment Card OnAfterGetRecord:
CurrPage.subfrmRepaymentSchedule.PAGE.GetSchedule(Rec);

Page - subfrmRepaymentSchedule:
Global Function: GetSchedule(Repayment);
Calls a Global function in a code unit:
ScheduleCalcs.BuildRepaymentSchedule(Repayment,tmpPaymentForecast);


CodeUnit ScheduleCalcs:

BuildRepaymentSchedule(VAR Repayment : Record "Repayment Plan";VAR PaymentForecastInput : Record "Payment Forecast")

//Assign the PaymentForecastInput Record to the local variable PaymentForecast
PaymentForecast.RESET;
PaymentForecast := SettlementPlanScheduleIn;

IF PaymentForecastInput.HASFILTER THEN
PaymentForecast.COPYFILTERS(PaymentForecastInput);

IF NOT PaymentForecast.ISEMPTY THEN
PaymentForecast.DELETEALL; ****This is where my error occurs.


Is this still the best approach in NAV2016? If not, what design should I use?

If it is the still the best approach, any ideas why I might be getting the error?

Many Thanks.

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>