Hello ,
I am creating purch orders automatically via X++ using purchAutoCreate_sales , everything works just fine.
Only issue notice is that purchline is created with price configured at Item level and my objective is to create purchline with values supplied to system via code.
Please share what can I do to ensure that purchline price are set to values in code and do not use item or any preconfgured price in system when creating purchorder via purchAutoCreate_Sales
Thanks
Mav
Hi Mav,
Since the method createPurchaseLine in PurchAutoCreate_Sales Class is defaulted with Parameters, the price search happens by default. And We do not have any possibility of changing the parameters sent to createLine method using extensions for this specific scenario.
Only option we can think of is We can take CoC of PurchAutoCreate_Sales.createLine() method and update the purchase line price with the value we have through code.
Even OOB code we can see them updating the purchase line after creation on the same method.
Note:-Do not forget to trigger the modifiedField method for the purch price field if you are updating the price field since.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156