# Problem in posting Invoice -PO ax 2012

**URL:** <https://www.dynamicsuser.net/t/problem-in-posting-invoice-po-ax-2012/56057>\
**Category:** Developer Forum\
**Created:** [November 28, 2014, 8:28am UTC](https://www.dynamicsuser.net/t/problem-in-posting-invoice-po-ax-2012/56057 "2014-11-28T08:28:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![harini](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@harini](https://www.dynamicsuser.net/u/harini)\
**Post date:** [November 28, 2014, 8:28am UTC](https://www.dynamicsuser.net/t/problem-in-posting-invoice-po-ax-2012/56057/1 "2014-11-28T08:28:41Z")

</div>

Hi,

currently am working in ax 2012. i have created a purchase order through code. i have used purchformletter class.

my requirement is to create a pending invoice. I have used

"purchFormLetter = PurchFormLetter::construct(DocumentStatus::Invoice);

purchFormLetter.update(purchTable, strFmt("%1", purchTable.PurchId));"

this snippet of code successfully Post the Invoice. but i need to create pending invoice. can anyone help me to solve this issue.

thanks in advance
