Company.reset; if Company.findset then repeat ToGLAccount.ChangeCompany(SyncCompany.Name); ToGLAccount.Reset; if ToGLAccount.get(ParGLAccountNo) then begin ToGLAccount.TRANSFERFIELDS(FromGLAccount, FALSE); ToGLAccount.MODIFY(TRUE); end else begin ToGLAccount.TRANSFERFIELDS(FromGLAccount); ToGLAccount.INSERT(TRUE); end; Until Company.Next = 0;
Answers
You can create a xmlport for table GLAccount with 'AutoUpdate' - true
create a codeunit with function which will have parameter the xmlport you created.
Now expose that codeunit through webservice.
Now you can call webservice URL like below
Thanks
lets say now i have 15 fields to be sync.
and then in the future i add 2 more fields.
so it means I need to add 2 more parameter to this codeunit?
so instead of pass field by field.. could it be by 1 recordset?
thanks for your comment.
so it means my understanding is correct right?
--> " lets say now i have 15 fields to be sync.
and then in the future i add 2 more fields.
so it means I need to add 2 more parameter to this codeunit?"
So if you need to have a record set have an xmlport and receive it as a Bigtext(Can explore TextBuilder Data type if it's Business Central).
P.S - Normally if its just handful of fields we make it as a direct parameter but if bunch of fields then XmlPort would be the best option as adding 2 more fields as yu saying will be an easier job.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/