SHELL Command

bekiobekio Member Posts: 204
edited 2010-11-25 in NAV Three Tier
Does SHELL Command works in NAS, because i have made one Codeunit and it gives me warning when i compile this codeunit. I want this codeunit to be executed with job queue.
but in CSIDE help it says:
The SHELL function can only be used with a text constant on Microsoft Dynamics NAV Application Server.
The SHELL function is not supported in the RoleTailored client.

I need HELP in solving this problem.

Answers

  • kinekine Member Posts: 12,562
    Have you tried it?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • bekiobekio Member Posts: 204
    IN clasic is ok but in NAS i didn't tried it.
    Because i get the same warning like wen i was working with dataports.
    http://www.mibuso.com/forum/viewtopic.php?f=23&t=44657
  • pduckpduck Member Posts: 147
    How does your SHELL Code looks like? Their can be some trouble using parameters.
  • bekiobekio Member Posts: 204
    I just want to extract files and archive with winrar.
    I have created a batch file to exctract files from one shared folder to location to temp folder, and than import this text files in NAV. And i want to execute this text file from Navision, and i have used Shell Command.
    If you have better idea, even not using shell pleas tell me.

    Thanks pduck,
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    pduck wrote:
    How does your SHELL Code looks like? Their can be some trouble using parameters.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • bekiobekio Member Posts: 204
    SHELL('C:\Extract.bat');

    Then this batch has inside code to extract data and put to another folder.
  • crisnicolascrisnicolas Member Posts: 177
    bekio wrote:
    SHELL('C:\Extract.bat');

    That is not a text constant... a Text Constant is what you define in View - C/AL Globals (or locals) - Text Constants tab
  • pduckpduck Member Posts: 147
    Please read the help file for SHELL. Everything is explained there. You need to define a constant containing your Batch-Comand and pass this to the SHELL comand.

    TEXT001 = C:\Extract.bat <- define this as a constant

    Your Code:
    SHELL(TEXT001);
  • bekiobekio Member Posts: 204
    I have done this, and Job Queue executes good, but the Shell command that executes batch file does not work, and also does not give me any warning in Event viewer.

    Any idea? :roll:
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    bekio wrote:
    Any idea? :roll:
    If you are not willing to show us the exact SHELL command you use, they I'm afraid it stops here ](*,)
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • bekiobekio Member Posts: 204
    Attached you have what i have used to execute.

    And also, when i want something to change in codeunit, to add som additional part of code to be executed, it dosn't exectute that part of codeunit. Is stored as a file somewhere out this Job Queue.

    For Example i have comentet some lines and save codeunit, and it stills executes those lines, so i need to create another job queue with last changes of codeunit to be executet without those lines.

    Thanks Luc, :(
  • bekiobekio Member Posts: 204
    OK is with SHELL but is not ok with this questions.
    bekio wrote:
    And also, when i want something to change in codeunit, to add som additional part of code to be executed, it dosn't exectute that part of codeunit. Is stored as a file somewhere out this Job Queue.

    For Example i have comentet some lines and save codeunit, and it stills executes those lines, so i need to create another job queue with last changes of codeunit to be executet without those lines.
  • kinekine Member Posts: 12,562
    bekio wrote:
    Attached you have what i have used to execute.

    And also, when i want something to change in codeunit, to add som additional part of code to be executed, it dosn't exectute that part of codeunit. Is stored as a file somewhere out this Job Queue.

    For Example i have comentet some lines and save codeunit, and it stills executes those lines, so i need to create another job queue with last changes of codeunit to be executet without those lines.

    Thanks Luc, :(

    It means, that you need to restart the NAS executing the job queue... source of your problem is object cache...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • bekiobekio Member Posts: 204
    So if i extend object cache does it means that without restarting NAS it is going to get the latest changes of codeunit.

    Thanks kine
  • kinekine Member Posts: 12,562
    No, it will not help, theoretically it will be worse (the objects will be in the cache longer time...). It is standard that you need to restart NAS when you change objectes in the application. It is same like with other clients connected to the database...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • bekiobekio Member Posts: 204
    Thanks for information Kine, it was very helpful for me!

    :idea:
Sign In or Register to comment.