How To INSERT Comment Lines - by PAGE WEB SERVICE - WEB

Ravi_ThakkarRavi_Thakkar Member Posts: 392
edited 2013-09-09 in NAV Three Tier
Hello,

I have published 67 PAGE Sales Comment Sheet as a WEB SERVICE.
Now by using CREATE function I want to create COMMENTS for particular Sales Invoice.
Code is as below.
SaComm.Document_Type = Navweb.Web.db1.Document_Type.Invoice;
SaComm.No = "ER/MT/0175";
SaComm.Document_Line_No = 10000;
SaCommServ.Create(ref SaComm);
I have SaComm is instance of Sales Comment Sheet and SaCommServ is the Service instance.
I have already assigned Document Type to INVOICE. But, after execution of CREATE function,
It has created the Record with,
No. - "ER/MT/0175"
Document Type - Quote (Default of System)
Document Line No - 0
Line No. - 10000.


Anybody guide me, what to do for my above requirement.
Thanks in Advance.
Ravi_Thakkar
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com

Comments

  • JDVyskaJDVyska Member Posts: 179
    I haven't personally tried these functions yet, but I believe you have to set the PK, then CREATE the record. Once it's created, *then* you can set the other fields and UPDATE.

    http://blogs.msdn.com/freddyk/archive/2 ... d-rtm.aspx
    JEREMY VYSKA
    CEO, Spare Brained Ideas, Göteborg, Sweden
    New (April 2021) Getting Started with Microsoft Dynamics 365 Business Central Book Available: "Your First 20 Hours with Business Central"
  • ara3nara3n Member Posts: 9,256
    The document type is not on the page 67. I don't think you could use them in your Csharp code.
    You'll need to add the field to the page, and make it by default not visible.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello,
    ara3n wrote:
    The document type is not on the page 67. I don't think you could use them in your Csharp code.
    You'll need to add the field to the page, and make it by default not visible.
    I have already completed the same procedure suggested by you.
    I am on the stage of Creating the record.
    Any suggestion?
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello,
    JDVyska wrote:
    I haven't personally tried these functions yet, but I believe you have to set the PK, then CREATE the record. Once it's created, *then* you can set the other fields and UPDATE.

    http://blogs.msdn.com/freddyk/archive/2 ... d-rtm.aspx
    Yes true. But, while creating the record, I need to assign 4 values of PK fields in the Reference of the record. "Document Type, Document No., Document Line No.,Line No."
    Now, while creating the record, I will not have the Line No. value.
    Then also If I am passing other 3 fields values, It is only passing Document No. Value to NAV code execution. And taking other values Default of the system.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    Page 67 doesn't contain the key fields you are referring to - you must have added them in order to set them???
    In a situation like this - I would recommend creating a card page for table 44. Page 67 is clearly not designed for exposure as a web service - and shouldn't be made to.

    You might still ask why it doesn't work - and I think that has something to do with the properties set on the page:

    DelayedInsert = Yes
    MultipleNewLines = Yes
    AutoSplitKey = Yes

    You will probably find that setting these properties to their default values (or some of them) will make the page work through web services, but then it won't work as designed in the RTC.

    If you find out what it takes to make it work as WS - I would like to know that - but I still think you should give up changing page 67 and create a card page for the purpose.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello Freddy,
    Thanks a Lot for your understabdable reply.
    freddy.dk wrote:
    Page 67 doesn't contain the key fields you are referring to - you must have added them in order to set them???
    Yes, I have already added those fields.
    freddy.dk wrote:
    In a situation like this - I would recommend creating a card page for table 44. Page 67 is clearly not designed for exposure as a web service - and shouldn't be made to.

    You might still ask why it doesn't work - and I think that has something to do with the properties set on the page:

    DelayedInsert = Yes
    MultipleNewLines = Yes
    AutoSplitKey = Yes

    You will probably find that setting these properties to their default values (or some of them) will make the page work through web services, but then it won't work as designed in the RTC.

    If you find out what it takes to make it work as WS - I would like to know that - but I still think you should give up changing page 67 and create a card page for the purpose.
    May be you are right. But, Still I will try for it and also as your suggestion.
    In between, let me know if any new idea.
    Thanks.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    Note, that if you change these properties, the page might not work in the RTC.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Thanks for Suggestion.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • jbrajbra Member Posts: 32
    Ravi,
    Can you share what did you ended up doing on this? We are also struggling to receive order comments from a WS.
    -jbra
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hi Jbra,

    Since this is a 4 years old post, I will have to see in my data repository and will have to revert back.

    Let me see into that. I will let you know. :)

    Regards,
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • jbrajbra Member Posts: 32
    Thanks for the effort Ravi :)

    I copied the comment page to a new one in my range, then set the defaults for DelayedInsert, MultipleNewLines, and AutoSplitKey.

    That seemed to take care of comments.
Sign In or Register to comment.