Web Service - Archive Sales Orders

gianmariaigianmariai Member Posts: 7
edited 2014-02-12 in NAV Three Tier
Hello,
I'm tring to find the page that can expose a web service capable of archive sales orders. The same operation you can do in NAV with the button "Archive". I've tried with pages 42 and 48 but there are no exported methods to do it.
Please some one can give some good information on it?

my best regards,
Gianmaria

Comments

  • postsauravpostsaurav Member Posts: 708
    Hey,

    Why don't you try to publish Codeunit 5063 and use ArchiveSalesDocument function from the exposed codeunit.

    The function accept a parameter that is Sales Order No.

    Let me know the issue completely.

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
  • gianmariaigianmariai Member Posts: 7
    Hello,

    a nice idea.. I've tried to access this code unit but seems i don't have permission. I work a lot with other web services using pages and everything goes ok, but when i try to use code units and expose as web service. Visual studio give me a permission error. Same thing if i try to open the SOAP url by internet explorer. Seem I have to unlock something.

    Regards,

    Gianmaria

    ERROR:
    Errore during download from 'http://xxx.xxxxxxx.it:7057/COMPANY/WS/BS/Codeunit/ArchiveManagement/_vti_bin/ListData.svc/$metadata'.
    Request failed with error:
    --
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:Microsoft.Dynamics.Nav.Service.WebMetadata.ServiceBrokerException</faultcode><faultstring xml:lang="it-IT">Service "Codeunit/ArchiveManagement/_vti_bin/ListData.svc/$metadata" was not found!</faultstring><detail><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Service "Codeunit/ArchiveManagement/_vti_bin/ListData.svc/$metadata" was not found!</string></detail></s:Fault></s:Body></s:Envelope>
    --.
    Metadata contains a reference cant be resolved: 'http://xxx.xxxxxxx.it:7057/COMPANY/WS/BS/Codeunit/ArchiveManagement'.
    La richiesta HTTP non è autorizzata con lo schema di autenticazione client 'Anonymous'. Intestazione di autenticazione ricevuta dal server: 'NTLM'.
    Errore del server remoto: (401) Non autorizzato.
    Se il servizio è definito nella soluzione corrente, provare a compilare la soluzione e ad aggiungere nuovamente il riferimento al servizio.
    
  • geordiegeordie Member Posts: 655
    I think you can't directly use codeunit ArchiveManagement as webservice since the function defined accept a record variable.
    Simply create a wrapping codeunit which receive document type and document no. as separated parameters and call ArchiveSalesDocument function :wink:
  • gianmariaigianmariai Member Posts: 7
    Thank you Daniele,
    I already tried this way ... but seem i can't add a new codeunit (nag development environment) nor i can view the code of existing one. Don't have permission to do it. Will call my support and will ask them how to unlock.

    Gianmaria
  • geordiegeordie Member Posts: 655
    gianmariai wrote:
    Thank you Daniele,
    I already tried this way ... but seem i can't add a new codeunit (nag development environment) nor i can view the code of existing one. Don't have permission to do it. Will call my support and will ask them how to unlock.

    Gianmaria

    Oh, I thought you were already working with a development license: you'll probably better getting in touch with your partner and ask for this new custom functionality.
Sign In or Register to comment.