Hi,
I would like to achieve the following:
When there is an item Created in Company A, this item should also get Created automatically in Company B
Same when updating in Company A, the item in Company B should also be Updated...
How can i achieve this ?
0
Comments
//Do you thing with the item
My Blog - nav.education
When i am in the OnModify function of the Item table (Comp. A), how will i know if the item exists in Comp. B ?
And how will i update it then, or if it doesnt exist insert in Comp. B
Say you are in Company A. Item is a record from the Item table.
In OnInsert or OnModify you would need to do:
Item.CHANGECOMPANY(Company ;
IF NOT Item.GET("No.") THEN
Item.INSERT;
The CHANGECOMPANY function literally points that record variable to another company, so even though you may be operating in Company A, that record variable will only see records in the company you've changed to.
Is that more clear?
My Blog - nav.education
..but remember to watch any field that validates, as the validation logic will not be impacted by the change company logic (in some cases you can get away with it (like if the validate is just a lookup to a table that contains the same data in all companies). i'd search the forum for CHANGECOMPANY and learn from that.
http://dynamicsuser.net/blogs/alexchow/ ... n-5-0.aspx
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
viewtopic.php?f=23&t=32588
In this post is also the link to Alex's BLOG
Regards