Create a purchase order in other company without IC transaction
damasodin
Member Posts: 2
Hi all
I would like to create a purchase order with C/AL in another company.
However when I insert the purchase header, I find that the document number used the no. series of current company.
Which does not match the no. series in another company.
How can I create a purchase order in other company without using IC transaction?
Or How do I get the Purchase order no. series from another company?
I would like to create a purchase order with C/AL in another company.
However when I insert the purchase header, I find that the document number used the no. series of current company.
Which does not match the no. series in another company.
How can I create a purchase order in other company without using IC transaction?
Or How do I get the Purchase order no. series from another company?
0
Best Answer
-
When creating the purchase order you would be using CHANGECOMPANY on the Puchase Header and Puchase Line tables in your code, however you must remember that any other tables used in validation will still be referring to the current company. The problem you are seeing is that when deciding which no series to use it is looking at the Purchase & Payables Setup record in the current company. You would also have problems in the INSERT trigger where the NoSeriesMgt codeunit gets called and all the record variables in there will be referring to the current company. Note that you will have similar problems with other field validation logic that you will be calling when creating the purchase order.
Using IC transactions is an alternative but you state that you don't want to use this - fair enough.
Another alternative is to create a codeunit to create the purchase order and then publish that as a web service. You can then call that web service for company B from NAV code in company A.5
Answers
-
Hi, To get the Purchase order no. series you can use CHANGECOMPANY function on no. series table and set filters and get the desired record.0
-
When creating the purchase order you would be using CHANGECOMPANY on the Puchase Header and Puchase Line tables in your code, however you must remember that any other tables used in validation will still be referring to the current company. The problem you are seeing is that when deciding which no series to use it is looking at the Purchase & Payables Setup record in the current company. You would also have problems in the INSERT trigger where the NoSeriesMgt codeunit gets called and all the record variables in there will be referring to the current company. Note that you will have similar problems with other field validation logic that you will be calling when creating the purchase order.
Using IC transactions is an alternative but you state that you don't want to use this - fair enough.
Another alternative is to create a codeunit to create the purchase order and then publish that as a web service. You can then call that web service for company B from NAV code in company A.5 -
Thanks Kishorm
Your explanation is very good.
Now I am trying to use IC transaction. Seems the result is OK, although numbers of setting are needed for IC partners.0 -
Using Web Service would too be a good approach if you do want to do something in the other company.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

