Reduce the Expression - I wish I could :)
pedgaard
Member Posts: 24
Hi all,
I'm upgrading some automations to DOTNET for use in NAV 2015 / 2013R1, and in that process I'm stuck on this challenge;
I've made a class library in VS with a web-service reference, everything works smoothly in NAV 2015, and the code was so much cleaner than before
I was happy...
Then I copied the objects to a client 2013R1 install, and no longer would it compile. I got the "Reduce the expression" sigh...
I was not so happy, as I can't reduce the expression myself.
The method which I call from the .DLL is named checkVatApprox and has more than 20 variables... I googled around, and there seems to be some limit in C/AL.
pRequestDate := VatCheck.checkVatApprox(pCountryCode,pVATNo,pTraderName,TraderCompanyType,TraderStreet,TraderPostCode,TraderCity,pRequesterCountryCode,pRequesterVatNumber,
pValid,pTraderAddress,dotnetx,lTempBool,dotnetx,lTempBool,dotnetx,lTempBool,dotnetx,lTempBool,dotnetx,lTempBool,pConsultationNumber);
This limit seems gone in 2015, but still there in 2013R1
I guess the only way I can get around is to make some more DOTNET coding, I see where this is going,..less and less C/AL, more DOTNET !
Any other smart ideas?
I'm upgrading some automations to DOTNET for use in NAV 2015 / 2013R1, and in that process I'm stuck on this challenge;
I've made a class library in VS with a web-service reference, everything works smoothly in NAV 2015, and the code was so much cleaner than before
I was happy...
Then I copied the objects to a client 2013R1 install, and no longer would it compile. I got the "Reduce the expression" sigh...
I was not so happy, as I can't reduce the expression myself.
The method which I call from the .DLL is named checkVatApprox and has more than 20 variables... I googled around, and there seems to be some limit in C/AL.
pRequestDate := VatCheck.checkVatApprox(pCountryCode,pVATNo,pTraderName,TraderCompanyType,TraderStreet,TraderPostCode,TraderCity,pRequesterCountryCode,pRequesterVatNumber,
pValid,pTraderAddress,dotnetx,lTempBool,dotnetx,lTempBool,dotnetx,lTempBool,dotnetx,lTempBool,dotnetx,lTempBool,pConsultationNumber);
This limit seems gone in 2015, but still there in 2013R1
I guess the only way I can get around is to make some more DOTNET coding, I see where this is going,..less and less C/AL, more DOTNET !
Any other smart ideas?
0
Comments
-
Is the complete address (name, street, city, post code, then again pTraderAddress) required for this? Just curious. Aside from this I would say you need two calls to provide all parameters, meaning two wrapper methods in the dll:
2013prepareapproxVAT(first set of parameters, no by reference vars);
2013approxVAT(the rest including your return vars);
To link these I would give a unique (like GUID) identifier.
with best regards
Jens0 -
Hi Jens,
Thanks for tip, now I now what I need to start googling on and learning today.
DLL Wrapper - sounds awesome
For the input, I need only 4 variables.
For the output, I need only like 5 of the ref variables.0 -
pedgaard wrote:Hi all,
I'm upgrading some automations to DOTNET for use in NAV 2015 / 2013R1, and in that process I'm stuck on this challenge;
I've made a class library in VS with a web-service reference, everything works smoothly in NAV 2015, and the code was so much cleaner than before
I was happy...
Then I copied the objects to a client 2013R1 install, and no longer would it compile. I got the "Reduce the expression" sigh...
I was not so happy, as I can't reduce the expression myself.
The method which I call from the .DLL is named checkVatApprox and has more than 20 variables... I googled around, and there seems to be some limit in C/AL.
pRequestDate := VatCheck.checkVatApprox(pCountryCode,pVATNo,pTraderName,TraderCompanyType,TraderStreet,TraderPostCode,TraderCity,pRequesterCountryCode,pRequesterVatNumber,
pValid,pTraderAddress,dotnetx,lTempBool,dotnetx,lTempBool,dotnetx,lTempBool,dotnetx,lTempBool,dotnetx,lTempBool,pConsultationNumber);
This limit seems gone in 2015, but still there in 2013R1
I guess the only way I can get around is to make some more DOTNET coding, I see where this is going,..less and less C/AL, more DOTNET !
Any other smart ideas?
Hi
Try Build 7.0.36919 or newer
-358991 Call to dotNET method doesn't allow to use more than 20 parameters but requires 30
Bye
MatteoReno Sistemi Navision Developer0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions