usually in tables like this, you would insert only one record: inserting the record with a blank primary key, allows you to use
"TBCompanyInfo.GET" instruction without arguments for the "get" function.
I'm pretty sure that the use is this
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
Yes, in a setup table the key is always left blank, because there can only be 1 record in a setup table.
Debugging is twice as hard as writing code. Therefore if you write the code as cleverly as possible you are by definition not smart enough to debug it.
Yes, it works until there is one record with blank PK. If there is no record with blank PK, it will show you standard error.
Someone is using more records e.g. in Company Info table to store adresses and data for different offices and it is easy to modify the reports to get the correct address - just instead .GET you use .GET(MyOfficeCode) and you are done...
Someone is using more records e.g. in Company Info table to store adresses and data for different offices and it is easy to modify the reports to get the correct address - just instead .GET you use .GET(MyOfficeCode) and you are done...
I've seen the same use of the company info table.
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
This means you don't need to do any modifications to store different company logo for one company?
Just use companyinfo.GET if you want to use the standard logo. And use companyinfo.get('1') if you want logo for another company.
Yes, for example. You just need to add the Primary key to the form and fill it by some code. Than you can store that code into some setup, to not use "Magic constants" in the code and you are done...
Some tables are supposed to have only one record, like the Company Information table. There is code in NAV all over the place that does a simple GET without a parameter, and if you enter more than one record into those tables, you might screw up the functionality without meaning to.
For your purpose (as I've already posted in the newsgroup) I would suggest a different solution for those different bank accounts. I'm thinking about adding a bank account number to the currency table, or a table that stores bank accounts for currencies. I do not think having multiple records in the Company Information table is the right solution for you.
Also, there are a number of issues with your syntax. I'd consider getting your NAV partner involved for some lessons in NAV development. Where I used to work we had a 1 day C/AL primer, and a 2 day reporitng class for absolute beginners.
I'm thankfully not daft enough to try this in the "Live" version and I was worried I'd have to make changes to every report which I think you've confirmed, as well as other unseen complications.
I'm not sure if we've got the licence to add tables and it wouldn't work with just currency, it needs to choose if currency blank, standard account, if country Ireland then Irish Bank or if Currency Euro and country Not Ireland then EURO account. I'll try and add a table and see how I get on.
I've done the report writer course but that barely touched CAL in the time we had and I'm wondering why I can't seem to find any resource to help with writing in CAL on the web, surely considering the cost of the software there should be at least a reference manual on Customer Source? I can't get another training day authorised at the moment!
I can't get on the newsgroup either - I guess that's whay you posted here too.
From the Help menu, select "C/SIDE Reference Guide", in there you will find technical help. On your product disk, there is a folder called 'Doc', which contains the technical manuals. The one you're looking for is the Application Designer Guide, a file called 'w1w1adg.pdf'. Tons of information for you there .
What I suggested is based on having no real sense of your requirement, just a suggestion of what I'm thinking based on what you posted in here. Your actual requirement is probably much more complex, and can be solved in more than one way.
It's not just syntax that I think you need some help with, but also some design help from an experienced consultant. Instead of trying to figure out HOW to do this, start with WHAT you need first, and discuss it with a NAV consultant. There might be a solution you haven't considered yet.
Oh certainly don't feel stupid for not knowing something, that's being too hard on yourself. I didn't know about that folder until probably 2-3 years into my NAV developer career
Comments
"TBCompanyInfo.GET" instruction without arguments for the "get" function.
I'm pretty sure that the use is this
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
http://ssdynamics.co.in
Have you tried to insert another records into the setup table? Does the SetupTable.GET still work if there are more than one record?
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Someone is using more records e.g. in Company Info table to store adresses and data for different offices and it is easy to modify the reports to get the correct address - just instead .GET you use .GET(MyOfficeCode) and you are done...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Just use companyinfo.GET if you want to use the standard logo. And use companyinfo.get('1') if you want logo for another company.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Interesting Observation............ :whistle: :whistle:
http://ssdynamics.co.in
Yes, for example. You just need to add the Primary key to the form and fill it by some code. Than you can store that code into some setup, to not use "Magic constants" in the code and you are done...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Yeah, but you need to modify a standard Navision table to do this. Nothing wrong with it, but if you can get away with not modifying, then don't.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
As a complete novice I tried adding some CAL code to the report and came up with the following but I get a syntax error.
"Issued Reminder Header - OnAfterGetRecord"
IF "Currency Code" = '' THEN
CompanyInfo.GET('')
FormatAddrCodeunit.Company(CompanyAddr,CompanyInfo)
ELSE
IF ""Issued Reminder Header"."Country/Region Code" ='IE'THEN
CompanyInfo.GET('IRE')
FormatAddrCodeunit.Company(CompanyAddr,CompanyInfo)
ELSE
IF "Currency Code" = 'EUR' THEN
CompanyInfo.GET('EUR')
FormatAddrCodeunit.Company(CompanyAddr,CompanyInfo)
ELSE END;
Any tips gratefully received.
Thanks
For your purpose (as I've already posted in the newsgroup) I would suggest a different solution for those different bank accounts. I'm thinking about adding a bank account number to the currency table, or a table that stores bank accounts for currencies. I do not think having multiple records in the Company Information table is the right solution for you.
Also, there are a number of issues with your syntax. I'd consider getting your NAV partner involved for some lessons in NAV development. Where I used to work we had a 1 day C/AL primer, and a 2 day reporitng class for absolute beginners.
RIS Plus, LLC
MVP - Business Apps
I'm thankfully not daft enough to try this in the "Live" version and I was worried I'd have to make changes to every report which I think you've confirmed, as well as other unseen complications.
I'm not sure if we've got the licence to add tables and it wouldn't work with just currency, it needs to choose if currency blank, standard account, if country Ireland then Irish Bank or if Currency Euro and country Not Ireland then EURO account. I'll try and add a table and see how I get on.
I've done the report writer course but that barely touched CAL in the time we had and I'm wondering why I can't seem to find any resource to help with writing in CAL on the web, surely considering the cost of the software there should be at least a reference manual on Customer Source? I can't get another training day authorised at the moment!
I can't get on the newsgroup either - I guess that's whay you posted here too.
What I suggested is based on having no real sense of your requirement, just a suggestion of what I'm thinking based on what you posted in here. Your actual requirement is probably much more complex, and can be solved in more than one way.
It's not just syntax that I think you need some help with, but also some design help from an experienced consultant. Instead of trying to figure out HOW to do this, start with WHAT you need first, and discuss it with a NAV consultant. There might be a solution you haven't considered yet.
RIS Plus, LLC
MVP - Business Apps
RIS Plus, LLC
MVP - Business Apps