Options

how to pass a page webservice to NAV Codeunit

genericgeneric Member Posts: 511
edited 2009-05-14 in NAV Three Tier
Hello.
Let say I publish a general journal page as a web service and then I have a codeunit that will take a general Journal as parameter and post it. I don't want to insert the record into the table.

I've tried to use CU as extension of a page, but when I try to use the function in C# the parameter is a string and not genjournal page object. Based on walkthrough, I was able to pass GenJournal.Key but I get an exception.

The exception is. The parameter GenJournalLine is null!

How do I pass the genjournal object to the the CU to be posted without inserting?

An example in C# would be helpful.



Thanks.

Comments

  • Options
    Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello,

    Since you have not read the record of General Journal Line which you want to post, record to pass as a parameter is not initialized. So, you are getting Exception like GeneralJournalLine is null.

    For your requirement of posting the General Journal, first you will need to READ the record of General Journal Line, which you want to Post.
    After reading the Record, you will get one Reference of the General Journal Line Record.
    Then, on calling the function of Codeunit to Post, pass this Reference of General Journal Line record as a parameter.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
Sign In or Register to comment.