Thanks alot James, It's work after I have change it to run on server! I would like to ask if this is a proper way to do in this way? I never try to touch inventmovement so I don't have much confident on it. Thanks in advance.
--- In Axapta-Knowledge-Village@yahoogroups.com, "James Flavell" <[EMAIL PROTECTED]> wrote: > > Make sure you code is setup to run on the server not on the client. > Some part of the reservation code has to run on the server or you get this > message > > > -----Original Message----- > From: Axapta-Knowledge-Village@yahoogroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of cugwilsont > Sent: 03 August 2007 13:11 > To: Axapta-Knowledge-Village@yahoogroups.com > Subject: [Axapta-Knowledge-Village] Reserve a Salesline for a specify > inventdim by code > > Hi > > I want to write a code to reserve a salesline for a specify > inventdim. > > Since my client provide a CSV file specific what serial ID he wants, > so I want to create a salestable/salesline by the information he > provided. > There is my code > salesline = salesline::find("1095328",1); > inventmovement = InventMovement::construct(salesLine); > inventDimCriteria = inventdim::find("788873"); > > inventDimParm.initPrimaryDimReservation(inventMovement.dimSearch > (),inventMovement.dimGroupId(),inventDimCriteria); > inventDimFixed = InventDimFixedClass::inventDimParm2InventDimFixed > (inventDimParm); > > inventMovement.inventdim(inventDimCriteria); > inventUpd_Reservation = InventUpd_Reservation::newMovement > (inventMovement,inventDimCriteria, inventDimParm, inventDimFixed, - > 15); > inventUpd_Reservation.parmAllowAutoReserveDim(false); > inventUpd_Reservation.updateNow(); > > It seems to work since the inventTrans already changed to Reserved > physical. > > But there is an info message > "The cursor is invalid for instantiating recordViewCache." > > I wonder if my code has written in a proper way to do this. Any > comment? > > > > > > Sharing the knowledge on Axapta. > Visit www.frappr.com/axapta for axapta friends. > > Come and choose your preferred name for Microsoft Dynamics AX on the Axapta > Knowledge Village, Visit www.axapta-knowledge-village.tk > > > Yahoo! Groups Links >