D365 Business Central Extending Deferrals

dborgdborg Member Posts: 3
Hi All,

I am trying to extended the functionality of Deferrals (Sales Lines table, onValidate of deferral code).

Automatically, when validating deferral code, NAV is creating the Deferral Schedule (in the below screenshot calling "DeferralCodeOnValidate").

217iux4id2d2.png

In short, I need to update the global variable "DeferralPostDate" before calling the function "DeferralCodeOnValidate" by using some information from the SalesLine record.

There is an event raised "OnGetDeferralPostDate" which I thought would be brilliant, to subscribe to it, update the "DeferralPostDate" and all my troubles will be solved. The thing is, that from my subscriber function, I will not have visibility to the Sales Line record (Rec) which i need for my logic. I cannot subscribe to the OnValidate event (raised by the platform) since I will not have access to the global variable "DeferralPostDate" and unfortunately the raised event "OnGetDeferralPostData" does not give access to global variables.

Obviously I cannot update any base code, as that's the whole point of BC on cloud.

I feel that i'm stuck between a rock and a hard place :smile: Any tips (or comments to correct me) will be greatly appreciated.

Good day ladies and gents
Dave


Sign In or Register to comment.