Package Slip & Invoice Posting

Hi All,

X++ Code to Create Purchase Order and Post the Invoice in Customization form having the fields as same as Purchase Order but slight modification in AX 2009.

You can extend \Classes\PurchAutoCreate, look at its derived classes.

use purchFormLetter class to post the invoice

use \Classes\PurchFormLetter\construct , by passing the required document status (in your case invoice)

then call \Classes\PurchFormLetter\update

static void Job10(Args _args)
{
ProductInform productInform =productInform::find(‘000385’);//purchid

PurchFormLetter purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);

;

purchFormLetter.update(productInform,'pack '//packingslip id, systemDateGet(), PurchUpdate::PackingSlip);
}

if i executed this code nothing happens in packing slip posting… i need a help…! is this code is correct or not… can anyone suggest me the solution

use the purchTable (after creating the purchTable) instead of productInform

Thanks Mr.Kranthi…[:D]