Adding section to C/AL Code..

yuppicide0138
Member Posts: 3
Maybe a noob question, but I don't do a lot of coding, only has been with your help mostly.
When I design a report and go into view C/AL Code I will get sections like:
Documentation()
OnPreDataItem()
OnAfterGetRecord()
etc. Along with code underneath.
How do I add a section with code?
In my other report that works properly I have something that is CalcSizeStartPos() and some code. I want to add it to a copy of this report to see if it works. I think it will, and then I'll apply it to the actual report.
When I design a report and go into view C/AL Code I will get sections like:
Documentation()
OnPreDataItem()
OnAfterGetRecord()
etc. Along with code underneath.
How do I add a section with code?
In my other report that works properly I have something that is CalcSizeStartPos() and some code. I want to add it to a copy of this report to see if it works. I think it will, and then I'll apply it to the actual report.
0
Answers
-
Documentation()
OnPreDataItem()
OnAfterGetRecord()
These all are event triggers. Each event has its own life cycle.
What do you meant by adding section with code? Do you want to add section in the layout? or do you want to add custom function in C/AL? like as u mentioned different events above?Best Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.1 -
The CalcSizeStartPos() is a function - you could add it but it won't do anything until you add some code somewhere to call it.
It sounds like you're fairly new to this so if you want to start coding in NAV then it might be worth spending a bit of time with a developer to show you the basics. Good luck.1 -
Depending on where your cursor is when you select Design on a Report object, you will be taken to the code section of that data item. I think that's where you are looking to add the code?
For example a typical report data item structure might look like this:
SalesHeader
SalesLine
Interger
Footer
etc.
Depending on what you are trying to do, clicking on the first row for example and then hit F9 will take you to the code section of that section. I am guessing this is what you meant by section, though in designing report we often refer to Section as by going to the View menu on top and select Sections.
Hope this helps.
0 -
Short version:
So I have a report.. let's say Posted Sales Invoice. If I open that and hit F9 I have CalcSizeStartPos().
The problem is on Posted Credit Memo report that does not exist. I need to get it on that report.
We have something installed called "Matrix" which is for the apparel industry. Allows us to have sizes such as S, M, L, XL, 1X, 2X, 3X, O/S, etc. Anyway, not important.
When I do a Credit Memo for an item that has sizes 1X, 2X, and 3X, they mistakenly show up under S, M, and L.
Long version:
Well.. I've been a member here awhile. Not that I'm skilled. Just that I've been on the forums a long time. I was yuppicide. Unfortunately when the new forums switched over I couldn't get in, so I created a new name. I hardly use the forums any more because I don't remember how to get in. As we speak the yuppicide0138 didn't work for me to login and reply, but now yuppicide is working. Odd.
Anyway, we have Navision 3.10. Some of our machines run Windows XP stilland some are running Windows 7 now with Virtual XP.
We used to have a partner which we paid a fee to, but the fee was expensive. We're just a small company of under 10 computers. It wasn't worth paying a maintenance fee because we never needed them. Navision works, we back it up, etc.
Anyway, I do dabble in a little programming and I can understand certain things, so they created me a super user account before we ended our support contract with them.
It's not often that we modify things in Navision. I did create a few useful things of my own, but most of the time I'm just trying to fix errors that have been there since, what year 2002 or so whenever this version came out.
I saw some old documents from our Navision partner that they tell you to test everything and make sure it all works within 30 days I think it was. Within that time period they would come back and fix anything needed. Thing is it's 2016 and they still haven't used all the features or found all the errors. No way we'd have seen them all in 30 days time.
0 -
Looks like CalcSizeStartPos() is a function inside the Posted Sales Invoice report that you need to copy/paste into the Posted Credit Memo report and make that works.
It's an educated guess.
If you want to we can connect with some kind of remote software (TeamViewer or even Skype) and I could take a look to that.
Regards0 -
Open the C/AL Globals in the Posted Sales Invoice report and you will find CalcSizeStartPos under the Functions tab. Select that line, copy it and paste it in the Globals of Posted Credit Memo Report.0
-
Thanks. That's what I needed to continue. What CalcSizeStartPos was called and where to add it. Hopefully I can figure the rest out.pavithrap0992 wrote: »Open the C/AL Globals in the Posted Sales Invoice report and you will find CalcSizeStartPos under the Functions tab. Select that line, copy it and paste it in the Globals of Posted Credit Memo Report.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions