please run the following code,
The below code is for packing slip.
for invocie you have to change the docuemnet status as invoice & you have to give the invoiceid inplace of packingslipid.
For Qty, you have to pass the total no of qty(as per ur example its 50) in purchparmline.receivenow=50.
Befor e doing this thing you can check the purchline.remainpurchphysical.
The purchparmline.receivenow should be <= purchline.remainpurchphysical.
Otherwise it will give the error.
Try this & mail me if you are facing nay problem.
static void PurchaseorderPosting(Args _args)
{
purchFormLetter purchFormLetter;
purchid PurchId;
PurchTable PurchTable;
purchparmtable purchParmtable;
ParmId parmId;
num packingSlipId;
purchline purchline;
purchparmline purchparmline;
;
packingSlipId="ttt";
PurchId= "00014_049";
PurchTable=PurchTable::find(purchid);
purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);
parmid=purchFormLetter.parmId(NumberSeq::newGetNum(CompanyInfo::numRefParmId()).num());
parmId= purchFormLetter.parmId();
purchFormLetter.createParmUpdate();
purchParmtable= purchParmtable::find(purchid,parmid);
purchFormLetter.createParmTable(purchParmTable,purchTable);
purchParmTable.Num = packingSlipId;
purchParmTable.insert();
while select purchLine
where purchLine.PurchId == purchTable.purchId
&& (purchLine.RemainPurchPhysical > 0)
{
purchParmLine.ParmId = purchParmTable.ParmId;
purchParmLine.InitFromPurchLine(purchLine);
purchParmLine.ReceiveNow = PurchLine.RemainPurchPhysical;
purchParmLine.setQty(DocumentStatus::PackingSlip,false, true);
purchParmLine.setLineAmount();
purchParmLine.insert();
}
purchFormLetter.proforma (false);
purchFormLetter.printFormLetter(true);
purchFormLetter.specQty (PurchUpdate::All);
purchFormLetter.transDate (today());
purchFormLetter.run();
}
Mallikarjun Gudidevuni <[EMAIL PROTECTED]> wrote:
Hi
see the class PurchFormLetter_Invoice, it will help u.
gopala krishna <[EMAIL PROTECTED]> wrote:
hi,
I want to post the purchase order thru x++.
And i should be able to post only qty 50 even if have qty 100 in my purchase line.
which class can i use. and which method.
thanks,
Gopal.
---------------------------------
Yahoo! India Answers: Share what you know. Learn something new. Click here
Send instant messages to your online friends - NOW
[Non-text portions of this message have been removed]
Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends.
SPONSORED LINKS
Business finance course Business to business finance Small business finance Business finance consultant Business finance magazine Business finance schools
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "Axapta-Knowledge-Village" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
[Non-text portions of this message have been removed]
Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends.
SPONSORED LINKS
Business finance course Business to business finance Small business finance Business finance consultant Business finance magazine Business finance schools
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "Axapta-Knowledge-Village" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
[Non-text portions of this message have been removed]
Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends.
SPONSORED LINKS
| Business finance course | Business to business finance | Small business finance |
| Business finance consultant | Business finance magazine | Business finance schools |
YAHOO! GROUPS LINKS
- Visit your group "Axapta-Knowledge-Village" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

