[development-axapta] production input journal

2009-01-26 Thread Shabbir Ahsan
Hi,

I am trying to write some x++ code that can take in a production ID 
and from it create a production input journal, create a line and 
assign a pallet id to the produced goods.  I then want to post the 
journal, again using code.  Can anyone help.  I have tried to look to 
see if there are any classes that can help, but there doesn't seem to 
be much out there.  I have looked at the WMSJournalTableData class and 
WMSJournalCreateLines.  

I couldn't find an appropriate method in the WMSJournalTableData class 
which could create and post the journal, however I was able to create 
a record in the WMSJournalTable manually.  Now not sure how to post it 
, and whether using WMSJournalCreateLines would link in with my newly 
created record.  Can't find much documentation on this.

Any help would be much appreciated.

Thanks.  



[development-axapta] Re: Receiving items from purchase order in x++

2008-11-26 Thread Shabbir Ahsan
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-axapta@yahoogroups.com, "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-axapta@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On Behalf Of Shabbir 
Ahsan
> Sent: 25 November 2008 23:58
> To: development-axapta@yahoogroups.com
> 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]
>





[development-axapta] Receiving items from purchase order in x++

2008-11-26 Thread Shabbir Ahsan
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.



[development-axapta] new to ax - printing packing slip

2008-10-15 Thread Shabbir Ahsan
Hi,

I am new to AX and was wandering if I could get some help with this.  
I want to be able to print a delivery note for an order using code.  
The code is being called using the business connector.  

I tried the following:

mysalesFormLetter  = 
SalesFormLetter::construct(DocumentStatus::PackingSlip);
 sale = SalesTable::find(PickingRoute_ds.transRefId);

ttsBegin;
mysalesFormLetter.update(sale, systemDateGet(), 
SalesUpdate::DeliverNow, AccountOrder::None);
  ttsCommit;
return ("Success");

but when running the code, nothing really happens.  Any ideas?

regards,