WebService Method Run Successfully message need in NAV 2013

sharadsharad Member Posts: 112
edited 2013-09-25 in NAV Three Tier
Hello Friends,

I need a help Urgent,
I am making a web application using NAV webservices,In that application I am making new Customers. but the problem is that when i create customer from my web application and if customer create successfully then not any successful message shown. I just want to show a message "Create Successfully" and this i need in Navision (It's a condition). so please help me on that.



Thanks
Sharad Gupta
Navision Technical Consultant & .Net Developer

Comments

  • postsauravpostsaurav Member Posts: 708
    Hi,

    can you explain how you are doing it.

    I guess you would have a codeunit on which you pass parameters from web application to NAV. based on that parameters you are creating the customer.

    If that is the case then why don't you put a message at end of function.

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
  • ichladilichladil Member Posts: 68
    Hello,

    as you are running the code from web application I assume that you want the user feedback from web application. If that is the case then it is the responsibility of your web application to return any feedback to the users of web application. With NAV you can only get some output or return values from the functions called via web service (no matter which ones these are - codeunits, pages or xmlports). And based on that output you have to display something to the user. Web Service calls do not provide any user interface feedback itself.

    If the question is however different please clarify.

    Regards, Igor
  • Wisa123Wisa123 Member Posts: 308
    The way I interpret his Question is, that he just wants to somehow get Confirmation whether the customer was successfully created.
    Austrian NAV/BC Dev
  • sharadsharad Member Posts: 112
    postsaurav wrote:
    Hi,

    can you explain how you are doing it.

    I guess you would have a codeunit on which you pass parameters from web application to NAV. based on that parameters you are creating the customer.

    If that is the case then why don't you put a message at end of function.



    Not Working. It insert data but not Show message;
    Sharad Gupta
    Navision Technical Consultant & .Net Developer
  • sharadsharad Member Posts: 112
    Wisa123 wrote:
    The way I interpret his Question is, that he just wants to somehow get Confirmation whether the customer was successfully created.


    Yes Right. But for this I want to change in navision not in web application.
    Sharad Gupta
    Navision Technical Consultant & .Net Developer
  • postsauravpostsaurav Member Posts: 708
    Hi Sharad,

    Is this the way you are prompting message.

    - suppose web application send request to create customer C0001.
    - A codeunit creates the customer, at the end there will be a code say - cust.Insert.
    - Call a function after that say testcust(ccode code [20]) with ccode as C0001.
    - Function testcust find the customer in customer table and display a message.

    cust.Insert;
    TestCust(CNo); // CNo contain customer send by web application
    
    ----------------------FUNCTION---------------------------------------
    
    TestCust(custno : Code[20])
    IF RecCust.GET(CustNo) THEN
      Message('Customer %1 created successfully',Custno);
    

    Let me know if you have any issues.

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
  • ichladilichladil Member Posts: 68
    Hello,

    from the conversation so far I believe the scenario is the following:

    1) There is NAV. In NAV there is some function CreateCustomer(somedetails). This function is published via web service.
    2) There is external web application calling NAV.CreateCustomer web service.

    Request is to
    1) modify NAV function CreateCustomer so that it displays something in external web application and
    2) not to modify web application at all

    I can say this is impossible to do. You cannot display anything in web application without modifying that web application. Only option would be that web application already can handle web service errors. In that case you may do the following in NAV:
    Function CreateCustomer()
    ... create customer ...
    COMMIT;
    ERROR('Customer created succesfully');
    

    That way the web application might if you are very lucky display the error message. But on the other hand it may also make it not working at all.

    Please note that messages from web service calls are not propagated in the results to the caller.


    Regards,
    Igor
  • Wisa123Wisa123 Member Posts: 308
    Yeah, im on icladil's side.

    Just expose a function that fullfills your needs and expose it as WS.
    You wont come around to not edit your Application if you want something shown.

    Webservices dont allow User Interaction such as Messages.
    Austrian NAV/BC Dev
Sign In or Register to comment.