Hi,
I have a problem related to Sales orders. In our business we very often sell certain products (let's call it item A) which requires to add a non-inventory item (Item B) to the sales order. For example:
Sales order:
1. We add Item A 100 pcs X price
2. We add Item B 100 pcs Y price (mandatory addition, if Item A is added to a sales order)
As we always need to add the Item B, it would make sense to automate adding it. However, we are quite new to the Business Central world so I don't really know where to start figuring this out. Logically the easiest solution would be some sort of automation that basically would automatically add the item B on the sales order after inputting Item A to a sales order. However, I don't have any idea if this is possible?
There must be some way to handle this, as I feel this is fairly common issue?
All help or comments are appreciated!
For any other folks battling this issue. Akshay's code is a very prominent solution, especially if the need is just to add one additional item to the order. If you get the code working, this is really helpful as it's fully automated.
Ben's solution through Assembly Management functionality is the way to go when there are multiple line's to be added for a certain item. However, this requires a couple of clicks from mouse so it's not the most quickest solution. However, those clicks are worth it, especially if sold item consists of multiple different/complex set of items with different quantities. For example, if salesperson is selling a product XYZ, he/she doesn't have to remember the composition of XYZ, just add that product through the Assembly Management and then break the item down on the Sales order.
Example:
1. Salesperson put's 1 XYZ item on the order.
2. Salesperson navigates to Row -> Functions -> Explode BOM
3. This item turns into a comment line and below that you can find the items with correct quantities set up through Assembly management.
Comment: Item XYZ
Item X 3 pcs
Item Y 6 pcs
Item Z 9 pcs
This way salesperson doesn't need to remember how many X, Y or Z is in the Item XYZ. Salesperson is only required to set how many Item XYZ customer needs.
While the above customization would work in the scenario where you only need to add 1 additional Item, it will become more clunky if you need to add 3 additional products when you add the first.
You could look at using the standard Assembly Management functionality within BC. This would allow you to explode the components onto the lines for visibility.
Assembly Mgmt. would also allow you to pre-pack the bundles so you don't forget to add them at time of shipment.
Hi,
You have to right code after Insert A item code on line.After this insertion of A line you can right code for the insertion of b line.
So you have to call eventsubscriber as below
Verify, If this answer helpful for you
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156