14.09.2017, 13:11 | #1 |
Участник
|
alirazazaidi: Select on InventSum vs InventOnHand Class Dynamics Ax 2012 R3.
Источник: https://www.tech.alirazazaidi.com/se...cs-ax-2012-r3/
============== Today I face the very strange behavior of X++ code. We develop customization. We generate transfer and issuance through X++. Logic was very simple,If stock is available then transfer / Issuance or Adjustment journal create otherwise generate error message, We took this decision based of query on Inventsum. It works fine in most of cases but In one case when stock is zero it fails. We create Movement Journal to generate stock in that Item variant. The select query always return Zero stock in posted quantity. Even I get the recid in debug mode and placed in table explorer, Quantity is available in table explore. This case occurs when got Zero stock in Inventsum table and we try to increase stock by movement journal, other wise select on InventSum works fine. The query will be very similar Select * from InventSum where Inventsum.ItemId == line.ItemId && inventSum.invetdimId == line.fromInventiDimId;This will not work. Even Db synch, Inc Cil, Cache clear done, even Restart the Test server AOS. I have to switch code from select query to Class InventOnhand. Very similar to following. InventOnHand inventOnhandIts works perfectly fine. I think InventonHand class is better the do direct query on Inventsum table. Источник: https://www.tech.alirazazaidi.com/se...cs-ax-2012-r3/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|