[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

validating SalesFormLetter code

5by5

1/16/2006 7:09:00 PM

Hi all,

I am attempting to create a packing slip for a sales order using X++, so I
copied and modified PO/Invoice code from the MSDN article 'Integrating
Microsoft Axapta using the Axapta Business Connector and Visual Basic .NET',
as per the below code. Further changes will be made to create only
salesParmLines that match rows from an external table, rather than copying
all the rows from the existing SO, but the flow is roughly similar.

However, I want to ensure the correct calls are being made for SO/packing
slip. Some threads on this newsgroup mention using SalesFormLetter.Update,
but the template I used does not reference it? Can anyone explain why I
should or should not be using it?

Also, there's mention of a TECHNET article called 'How to post customer and
vendor transactions with X++' on these forums but I am unable to locate it.
Can anyone point me to a copy of this article?

str makePackingSlip2(boolean _print)
{
SalesFormLetter salesFormLetter;
SalesParmTable salesParmTable;
SalesParmLine salesParmLine;
;
salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.createParmUpdate();
salesFormLetter.createParmTable( salesParmTable, salesTable);
// external packing slip number
// salesParmTable.Num = salesTable.SalesId;
salesParmTable.insert();
while select salesLine
where salesLine.SalesId == salesTable.SalesId
{
salesParmLine.ParmId = salesParmTable.ParmId;
salesParmLine.InitFromSalesLine(salesLine);
salesParmLine.DeliverNow = salesLine.QtyOrdered;
salesParmLine.setQty(DocumentStatus::PackingSlip, false, true);
salesParmLine.setLineAmount();
salesParmLine.insert();
}
salesFormLetter.proforma (false); // proforma ?
salesFormLetter.printFormLetter(_print); // print ?
salesFormLetter.specQty (SalesUpdate::All); // what to update?
salesFormLetter.transDate (today()); // update date
salesFormLetter.run();
if(_print)
return 'Shipped and Printed';
else
return 'Shipped';
}

Thanks in advance for your help.