Problem with NAS in NAV 2013

marvinqmarvinq Member Posts: 69
edited 2014-01-23 in NAV Three Tier
Hi,

I am having a problem with my Dynamics NAV Application Server (NAS). Here is my scenario…

I have started a NAS, which runs a codeunit every 5 minute. In this codeunit I have, for testing, created a SMTP-mail, which sends a notification-mail to me. This works perfectly, I get a mail every 5 minute.

Now I include a new automation variable, and before calling the SMTP-mail send-out, I have a CREATE, like this:
CREATE([automation],FALSE,TRUE);
I saved the codeunit, and restated my NAS. The job queue is now after first run in a failed state. It states that:
“…Callback functions are not allowed…”.
There are no callbacks, prompting, questions, anything. Just the above mentioned CREATE.

Note: When I run the codeunit manually there are no callbacks at all. It is starting my rollcenter, but nothing else (when running from development environment). Automation works just fine when called manually. The automation is a self-developed .Net .dll.

I tried du change the CREATE to default parameters (FALSE,FALSE), but then I get this error:
“You cannot create an Automation object “[Automation]” on Microsoft Dynamics NAV Server. You must create it on a client computer.”
I am running NAV 2013 R2.

What can I do? Why is it suddenly a problem that I have an Automation in my codeunit running as a job queue?

I have never seen this problem before.

Please help! :|

Comments

  • ta5ta5 Member Posts: 1,164
    Hi
    Afaik in NAV 2013R2 server side com automation does not work anymore. NAS always runs on server side. Can you change to .NET type?
    Regards
    Thomas
  • BardurKnudsenBardurKnudsen Member, Microsoft Employee Posts: 137
    When you say 'automation', do you mean COM? or .net assembly / interop?
    I can see you write CREATE(..) which indicates COM.
    The old automations we know from the classic client are not supported on the 2013 server (due to 64 bit).
    However, if you are indeed running .net interop, then you cannot use CREATE() but instead e.g.
    MyDotNetVar := MyDotNetVar.SomeConstructor();
    Bardur Knudsen
    Microsoft - Dynamics NAV
  • marvinqmarvinq Member Posts: 69
    When you say 'automation', do you mean COM? or .net assembly / interop?
    I can see you write CREATE(..) which indicates COM.
    The old automations we know from the classic client are not supported on the 2013 server (due to 64 bit).
    However, if you are indeed running .net interop, then you cannot use CREATE() but instead e.g.
    MyDotNetVar := MyDotNetVar.SomeConstructor();

    Hi Bardur,

    It seems that it is a COM I've made.

    Do you have a guide on how to make .Net interop?

    Thanks in advance.
  • BardurKnudsenBardurKnudsen Member, Microsoft Employee Posts: 137
    Well; I think you should consult msdn :-)
    But since you have built it in .net already, it might be as easy as changing the output type in the project settings.
    Bardur Knudsen
    Microsoft - Dynamics NAV
Sign In or Register to comment.