web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Code to Confirm and Post Project Item Requirement for Sales Order in Ax 2012

SANTOSH KUMAR SINGH Profile Picture SANTOSH KUMAR SINGH 1,224
This is a sample Code to confirm and Post Project Item Requirement for Sales Order in Ax 2012 . You need to pass sales order in salesFormLetter class method update and you can pass transaction date or posting date as per your need it will create or post project sales order item requirement packing slip. Its same functionality as post button on project item requirement form.

 SalesFormLetter salesFormLetter;  
salesTable Salestablelocal;
str 200 msg;
salesid salesid;
if(salesid)
{
select Salestablelocal
where Salestablelocal.Salesid ==salesid
&& Salestablelocal.salestype==SalesType::ItemReq
&& Salestablelocal.SalesStatus==SalesStatus::Backorder;
if(Salestablelocal)
{
ttsBegin;
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation);
salesFormLetter.update(Salestablelocal);
salesFormLetter = SalesFormLetter::construct(DocumentStatus::ProjectPackingSlip);
salesFormLetter.update(Salestablelocal);
ttsCommit;
msg = "Item Requirement with Sales order id : " + salesid + " Posted ";
}
else
{
msg = "Item Requirement with Sales order id: "+ salesid + " already posted";
}
}
else
{
msg = "Item Requirement with provided Sales order id does not exists";
}


This was originally posted here.

Comments

*This post is locked for comments