how do we add our AL Extension code for in between standard code
in C/AL, i used to add parameters.
here is one of the code in
Table 37 (Sales Line) - CalcVATAmountLines
Table 290 (VAT Amount Lines) - Sum Line
Please advise how should we do it in AL
You would need create your own function to update your fields and then call this function from an event subscriber. You can use the Event Recorder in BC to find out which events are published and then find where the subline function is called.
but this VAT Amount lines is just a buffer table.
I need this because in Statistic page I have new fields to be shown
I am not sure about event recorder
I tested start it.. and then go to sales order, click statistics , and then go to VAT Amount lines
once i go back to event recorder, there is nothing there..
and the recorder is stopped
Getting the event recorder to work may need a few tries. In my case I noticed the if an error occurs, then it doesn't record anything. But if going from the event recorder page (via search) to the page with the function I want to record, then do the process (with no errors - this is NOT a debugging tool) and exits back to the event recorder page. Then when I click Stop it asks me if I want to display the events that it recorded.
In you case then at least it should record when you opened the statistics page.
But you may be in a situation where there are no usable events to subscribe to. In which case you can do two things:
1: Go to AL on Github to request the event publishers you would need. This event then (maybe) will be added to the next major release. Or request it via MS support for current versions.
2: Create a new statistics page. Copy existing functions etc. and make your own page.
Requesting the event publisher may take 6 months or more to be available but only a few hours when available, where as creating the new could be done now, but take a lot more than with a subscriber. Not ideal, but the number of events is still limited, compared to how much functionality exists in NAV/BC.
any idea how to add code in AL here?
I am using Report 1496 (Suggest Bank Acc. Recon. Lines)
upon Suggest Bank recon lines, I added New field
in CAL, During EnterBankAccLine funtion I've added this code
As Eric suggest with page, you need to do the same thing, Create a new AL Object,
It is not possible to hook into this report where you want.
Use could use exporttonewsyntax and Txt2Al.exe, then you have the base object in AL.
Then you can modify that object.
1. Base Object
2. Base Object --> converted become AL
3. I modify this AL object from point no.
once i compile, isnt it will become redundant object?
something like error message, this object id already exist
Of course, you also need to give it a new object number, and use page extension or similar to replace where the old report is called.