I mean you go to PO line then press the Functions button (or is it the invenotry button sorry I cant remember) and then the Register option this brings upo a screen that allows you to specify the registered quantity so in the code behind this screen you should have what you need right?
_____ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Shabbir Ahsan Sent: 26 November 2008 19:29 To: [email protected] Subject: [development-axapta] Re: Receiving items from purchase order in x++ Hi, I am not sure what you mean. Looking at the purchLine table there are two methods 'registered' and 'registeredInPurchUnit', both of which seem to only retrieve data not update. Looking at the WMSArrival overview form may offer another way. There doesn't seem to be a simple function to just set a single line as arrived with the data being committed, so setting a line as arrived in the WMSArrival form leaves the PurchLine table alone so status of the line is set to open - how do I then get an updated list as to progress??? Has anyone dealt with an issue like this before. Thanks in advance --- In development- <mailto:development-axapta%40yahoogroups.com> [EMAIL PROTECTED], "James Flavell" <[EMAIL PROTECTED]> wrote: > > Sorry not stopped to read your code but can't you use the status > 'Registered' (PO line / Functions / Register) and then just do Delivery note > posting based on Registered? > > > > > _____ > > From: development- <mailto:development-axapta%40yahoogroups.com> [EMAIL PROTECTED] > [mailto:development- <mailto:development-axapta%40yahoogroups.com> [EMAIL PROTECTED] On Behalf Of Shabbir Ahsan > Sent: 25 November 2008 23:58 > To: development- <mailto:development-axapta%40yahoogroups.com> [EMAIL PROTECTED] > Subject: [development-axapta] Receiving items from purchase order in x++ > > > > Hi, > > I want to be able to receive items on a PO, but process one by one, > rather than one go as is the option within AX. I want to be able to > update the status of the line to received and then when all items are > received run a function to post the entire PO. > > The current code I am using to process each line is: > > PurchTable purchTable; > PurchLine purchLine; > TransDate transDate; > ; > > transDate = SystemDateGet(); > > try > { > ttsbegin; > > purchTable = PurchTable::find(myPOId); > > select forupdate purchLine where purchLine.PurchId == myPOId && > purchLine.ItemId == myItem && purchLine.LineNum == mynum; > > purchLine.PurchReceivedNow = RecQty; > purchLine.RemainPurchPhysical = (purchLine.RemainPurchPhysical - > RecQty); > purchLine.setInventReceivedNow(); > if (purchLine.RemainPurchPhysical == 0) > { > purchLine.setPurchStatus(); > } > > purchLine.update(true); > > ttscommit; > } > catch (Exception::Error) > { > return "got an error"; > } > return "processed"; > > } > > With the above code, it sets the status as cancelled. Do I have to > calculate and set the REmainPurchFinancial value as well in order for > it to give the correct status. Is there not a function that can > receive an item and calculate this automatically? > > After all the status of items is set to received (ie all items have > matching quantity to that ordered) I will post the PO using the > following code - I don't think there will be a problem here: > > purchformletter = > purchformletter::construct(DocumentStatus::PackingSlip,true); > purchtable.clear(); > purchtable = purchtable::find(myPOId); > > purchformletter.update(purchtable,myDelNo,systemDateGet(),purchUpdate: > :All,AccountOrder::None, > NoYes::No, > NoYes::Yes); > > Some help on this would be much appreciated. > > > > > > > [Non-text portions of this message have been removed] > [Non-text portions of this message have been removed]

