How delete a document from Navision

LeroyLeroy Member Posts: 199
Dear sirs, on Item label I've a button that, on push, go to an specific route on my network to look for an pdf archive. This archive, has previously added to the Item label thought a route link.
Now I want to delete some pdf's from my network thought Navision following the marked route.
I've got erase only the route puttin OnPush from button the code:

IF ("Technical route" <> '') THEN
delete;

This instruction delete the route market from Navision to the pdf, but doesn't delete the pdf document. Does anybody know how can I delete a document that is in my network following a route?. Sorry if I haven't explained well.
Thanks in advance.

Comments

  • matttraxmatttrax Member Posts: 2,309
    FILE.DELETE(PathtoFile/Filename);
  • LeroyLeroy Member Posts: 199
    Thanks, but it doesn't get me the FILE.DELETE instruction. I've Attain 3.70, this could be the problem?.
    Thanks.
  • JPHSCJPHSC Member Posts: 67
    try this : ERASE('path\filename.pdf');
  • LeroyLeroy Member Posts: 199
    Perfect!, was Erase. It delete the file from the path, but, how can I do to also delete the route writes on "Technical route" field?.
    Thanks for help.
  • JPHSCJPHSC Member Posts: 67
    "Technical route" := ''; ???
  • matttraxmatttrax Member Posts: 2,309
    Sorry...I meant ERASE. #-o
  • LeroyLeroy Member Posts: 199
    Thanks both for help;
    "Technical route" := ''; ???
    

    I imagined somethig like that but don't work. Any idea else, please?.
  • BeliasBelias Member Posts: 2,998
    how can you have technical route compiled if you've deleted the entire record (your previous instruction)?
    IF ("Technical route" <> '') THEN
    delete;
    

    what do you want to do?Delete the nav doc + the pdf doc in the path of tecnical route?if so use this code
    If ("Technical route" <> '') then
      ERASE('path\filename.pdf');  //I think this is the "technical route" field
    DELETE(TRUE);   //this will also delete the lines of the lines because of (TRUE), supposing you're using standard documents
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • LeroyLeroy Member Posts: 199
    Thanks for reply. Sorry, but if i do that it tries to erase the whole Item label!! (I put the code in OnPush)

    In this code:
    ERASE('path\filename.pdf'); I put also ERASE("Technical route"); because is different in each Item label, I need it automatic; but, evenly, it doesn't work.
    Thanks for help.
  • BeliasBelias Member Posts: 2,998
    if you only want to blank the "Technical route", you just have to erase the file first, and blank the field after:
    "technical route" := '';
    modify(TRUE or FALSE)
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • LeroyLeroy Member Posts: 199
    Oh!!, thanks, it works with "modify" at the end; thanks everybody for help.
  • BeliasBelias Member Posts: 2,998
    if you are a developer, you should really read some manuals before doing something; if you are a customer, ask your partner for some training. You must know modify and delete instructions as if they're your name!!
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • LeroyLeroy Member Posts: 199
    Thanks for advise, but I'm the network administrator from my company and have permission to unfoldment some little things in Navision; by the other side I always practical in a test database.
    Thanks.
  • BeliasBelias Member Posts: 2,998
    just be really careful when you do modification, nav it's easy to program if you know it.
    For the same reason, it's easy to make big damages if you don't know it :wink:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.