Skip to main content

Posts

X++ code for Project Item Requirement posting in Ax 2012

Below is the X++ code for Project Item Requirement posting in Ax 2012. SalesFormLetter salesFormLetter; salesTable Salestablelocal; str 200 msg; if(this.parmSalesid()) { changeCompany(_legalentity) { select Salestablelocal where Salestablelocal.Salesid ==this.parmSalesid() && 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 : " + this.parmSalesid() + " Posted "; } else

Seeking help to get Miscellaneous charges for Purchase order in Ax 2012

If you are Seeking help to get Miscellaneous charges for the Purchase order in Ax 2012 then this code can help you. Sometimes we need to display Miscellaneous charges total in the report then you can get help as per below code. while select sum(Value),MarkupCode from markuptrans_txt group by MarkupCode join purchline where purchline.RecId ==markuptrans_txt.TransRecId && markuptrans_txt.TransTableId == purchline.tableid && purchline.PurchId == vendPurchOrderJour.PurchId && markuptrans_txt.Value != 0.00 { purchPurchaseOrderHeader.MiscChargeDesc = purchPurchaseOrderHeader.MiscChargeDesc+strFmt("Add %1 : \n",MarkupTable::find(MarkupModuleType::Vend,markuptrans_txt.MarkupCode).Txt ) ;

Get particular Financial dimension value from default dimension in Axapta

To get particular dimension value from default dimension you can try below code as per your requirement. DimensionAttributeValueSetItem dimvalue; DimensionAttributeValue dimAttValue; DimensionAttribute dimAtt; int length; //DimAttributeOMCostCenter viewCostCenter; DimensionFinancialTag viewCostCenter; DimAttributeOMDepartment viewDepartment; DimensionFinancialTag locations; str name; ; length = 0; Select dimvalue join dimAttValue join dimAtt Where dimvalue.DimensionAttributeValueSet == _DimensionDefault && dimvalue.DimensionAttributeValue == dimAttValue.RecId && dimAttValue.DimensionAttribute == dimAtt.RecId && dimAtt.Name == 'ProductCategory'; select viewCostCenter where viewCostCenter.Value == dimValue.DisplayValue; return viewCostCenter.Description;