Announcements
Hi All,
Anyone can give me some guide or tips on this scenario.
I delete the record in InventTrans and InventSum.
Now I am trying to create a Job to insert it back to InventTrans and InventSum as well using the record in SalesLine.
Anyone can help me.
Thanks in Advance
Ariston
Lol
haha
Andi, you crack me up :-)
I've seen the same picture with the phrase "one does not simply implement vanilla AX"...
[View:http://cdn.memegenerator.net/instances/400x/34903227.jpg]
:)
Hi Ariston,
If your sales Lines has not been received/posted with anything, then delete that sales lines and insert them again.
Otherwise.....I would +1 on Joris suggestion of restore a backup and rethink.
For your reference, AX uses a bunch of classes to manipulate the inventTrans due to complex logic and connections to different module and business processes. Which is the reason why manipulating them directly has been a No-no from day 1.
Thanks Joris,
But my Consultant want to do that I think he want to do something on that.
These are the scenario.
In SQL my Consultant delete the record in INVENTTRANS and INVENTSUM.
Then he want to put it back using Job in AX.
I have a valid SALESLINE record with InventTransID. No need to create new InventTransID when I push it back to INVENTTRANS and INVENTSUM also just push all the record to that table.
This is my sample job code do you think this is wrong? do I need to put some classes or methods?
static void Job24(Args _args)
{
SalesLine salesLine;
InventTrans inventTrans;
;
while select salesLine where
salesLine.SalesId == 'SO1208/0001'
{
select forupdate inventTrans;
inventTrans.InventTransId = salesLine.InventTransId;
inventTrans.ItemId = salesLine.ItemId;
inventTrans.Qty = salesLine.SalesQty;
inventTrans.insert();
}
}
Manipulating records in inventtrans and inventsum directly is a HUGE violation of AX data. Never, ever, ever, ever, ever, ever, ever update, insert or delete records in these tables yourself. There is ALWAYS a way to use the front-end transaction (salesline, journaltrans, etc) to achieve what you wish to do.
My advice: restore your database and rethink what you are trying to achieve.
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... 290,142 Super User 2024 Season 2
Martin Dráb 227,979 Super User 2024 Season 2
nmaenpaa 101,148