Options

Reduce the Expression - I wish I could :)

pedgaardpedgaard Member Posts: 24
edited 2014-10-06 in NAV Three Tier
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?

Comments

  • Options
    jglathejglathe Member Posts: 639
    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

    Jens
  • Options
    pedgaardpedgaard Member Posts: 24
    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.
  • Options
    matteo_montanarimatteo_montanari Member Posts: 189
    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

    Matteo
    Reno Sistemi Navision Developer
Sign In or Register to comment.