Posts

Showing posts from February, 2019

How to get inventory on-hand in Dynamics AX 2012 Through X++

How to get inventory on-hand in Dynamics AX 2012 Through X++     InventDim           inventDim;     InventDimParm   inventDimParm;     InventOnHand     inventOnHand;     inventDim.InventLocationId = "01";     inventDim.modifiedField(fieldNum(inventDim,InventLocationId));     inventDimParm.initFromInventDim(inventDim);     inventOnHand = InventOnHand::newItemDim("111001", inventDim, inventDimParm); inventOnhand.availPhysical();

How to update contact in Dynamics AX 2012 Through X++

How to update contact in Dynamics AX 2012 Through X++     DirPartyContactInfoView         dirPartyContactInfo;     DirParty                        dirParty;     LogisticsLocation               location;     VendTable                       vendTable   = VendTable::find("Vendor number");     container                       roles;       location = LogisticsLocation::create("Phone", false);     DirParty::addLocation(vendTable.Party, location.RecId, false, true);     dirParty = DirParty::constructFromCommon(vendTable);     dirPartyContactInfo.LocationName                = "Phone";   ...

How to update address in Dynamics AX 2012 Through X++

How to update address in Dynamics AX 2012 Through X++     DirPartyPostalAddressView       dirPartyPostalAddressView;     DirParty                        dirParty;      VendTable                       vendTable   = VendTable::find("Vendor number");       dirParty = DirParty::constructFromCommon(vendTable);     select dirPartyPostalAddressView where dirPartyPostalAddressView.Party == vendTable.Party  && dirPartyPostalAddressView.IsPrimary == true;     dirPartyPostalAddressView.CountryRegionId   = "Jor";     dirPartyPostalAddressView.ZipCode           = "11";     dirPartyPostalAddressView.Street            = "";     dirPartyPostalAddressView.City...

How to remove value from default dimension in Dynamics AX 2012 Through X++

How to remove value from default dimension in Dynamics AX 2012 Through X++ static void  removeValueDefaultDimension(Args _args) {     DimensionAttributeValueSetStorage   dimStorage;     DimensionAttribute                             dimAttr;     DimensionAttributeValue                    dimAttributeValue;     DimensionDefault                                defaultDimension;     SalesTable                                            salesTable  = SalesTable::find('1000210',true);     ttsBegin;     dimStorage            = DimensionAttributeValueSe...

How to create dialog in Dynamics AX 2012 Through X++

How to create dialog in Dynamics AX 2012 Through X++     Dialog                      dialog = new Dialog("dialog caption");     DialogField              fldInventJournalId;     InventJournalId        inventJournalId;     boolean                     result;           fldInventJournalId  = dialog.addField(extendedTypeStr(InventJournalId));       result = dialog.run();       if(result)     {         inventJournalId     = fldInventJournalId.value();               info(inventJournalId);     }

How to build a dynamic form in Dynamics AX 2012 Through X++

How to build a dynamic form in Dynamics AX 2012 Through X++         #Task         DictTable                                              dictTable;         Form                                                     form;         FormBuildDesign                                 formBuildDesign;         FormBuildDataSource                         formBuildDataSource;         FormBuildActionPaneControl             formBuil...

How to Create Movement in Dynamics AX 2012 Through X++

How to Create Movement in Dynamics AX 2012 Through X++ static void createMovement(Args _args) {     InventJournalTable          inventJournalTable;     InventJournalTrans          inventJournalTrans;     InventDim                       inventDim;     container                         ledgerDimensions;     JournalCheckPost           journalCheckPost;     //Journal     inventJournalTable.clear();     inventJournalTable.JournalType = InventJournalType::Movement;     inventJournalTable.initFromInventJournalName(InventJournalName::find('Journal Name '));     inventJournalTable.insert();     //Lines     inventJournalTrans.clear();     inv...

How to update default dimension in Dynamics AX 2012 Through X++

How to update default dimension in Dynamics AX 2012 Through X++ static void  updateDefaultDimension(Args _args) {       DimensionAttributeValueSetStorage   dimStorage;     DimensionAttribute                             dimAttr;     DimensionAttributeValue                    dimAttributeValue;     DimensionDefault                                defaultDimension;     SalesTable                                            salesTable  = SalesTable::find('1000210',true);         ttsBegin;     dimStorage            = DimensionAttributeV...

How to update worker financial dimension in Dynamics AX 2012 Through X++

How to update worker financial dimension in Dynamics AX 2012 Through X++ static void updateWorkerFinancialDimension(Args _args) {       DimensionAttributeValueSetStorage   dimStorage;     DimensionAttribute                  dimAttribute;     DimensionAttributeValue             dimAttributeValue;     HcmWorker                           hcmWorker;     HcmEmployment                       hcmEmployment;     hcmWorker           = HcmWorker::findByPersonnelNumber('10001');     dimAttribute        = DimensionAttribute::findByName("Dimension name");           hcmEmployment.validTimeStateUpdateMode(ValidTimeStateUp...

How to get dimension value from default dimension in Dynamics AX 2012 Through X++

How to get dimension value from default dimension in Dynamics AX 2012 Through X++ static void getDimensionValueFromDefaultDimension(Args _args) {     DimensionAttributeValueSetStorage   dimStorage;     DimensionValue                                   dimAttributeValue;     Counter                                                 i;     CustTable                                              custTable = CustTable::find('1002');       dimStorage = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);     for (i= 1 ; i<= dimStorage.elements() ; i++)     ...

How to read from csv file in Dynamics AX 2012 Through X++

How to read from csv file in Dynamics AX 2012 Through X++ static void readFromCSV(Args _args) {     #File     CommaTextIO          csvFile;     container                   readCon;     Dialog                       dialog;     DialogField               dfFileName;     FileName                  fileName;     int                              row;     CustAccount            custAccount;     ItemId                      itemId;     Qty                    ...

How to create quotation in Dynamics AX 2012 Through X++

How to create quotation in Dynamics AX 2012 Through X++ static void createQuotation(Args _args) {     AxSalesQuotationTable     axSalesQuotationTable;     AxSalesQuotationLine      axSalesQuotationLine;     InventDim                         inventDim;     //Header     axSalesQuotationTable =  new AxSalesQuotationTable();       //if smmQuotationAccountType::BusRelAccount         axSalesQuotationTable.parmBusRelAccount('5001');       //if smmQuotationAccountType::CustAccount         //axSalesQuotationTable.parmCustAccount('10001');     axSalesQuotationTable.save();     //lines     inventDim.clear();     inventDim.InventSiteId  = '01';     inventDim.modifiedField(fieldNum(InventDim,InventSiteId...

How to create payment in Dynamics AX 2012 Through X++

How to create payment in Dynamics AX 2012 Through X++ static void createPayment(Args _args) {     AxLedgerJournalTable                journalTable;     AxLedgerJournalTrans                journalTrans;       LedgerJournalTable                  ledgerJournalTable;     LedgerJournalTrans                  ledgerJournalTrans;     NumberSeq                               numberseq;     MainAccountNum                    offsetAccount;         // create journal table     journalTable = new AxLedgerJournalTable();     journalTable.parmJournalName('Payment Journal Name');   ...

How to create payment with post dated check in Dynamics AX 2012 Through X++

How to create payment with post dated check   in Dynamics AX 2012 Through X++ static void createPayment(Args _args) {     AxLedgerJournalTable                journalTable;     AxLedgerJournalTrans                journalTrans;     LedgerJournalTable                  ledgerJournalTable;     LedgerJournalTrans                  ledgerJournalTrans;     NumberSeq                               numberseq;     MainAccountNum                    offsetAccount;     // create journal table     journalTable = new AxLedgerJournalTable();     journalTable.parmJournalName('Payment Journal Name'); ...

How to Create Transfer Journal in Dynamics AX 2012 Through X++

How to Create Transfer Journal in Dynamics AX 2012 Through X++ static void createTransfer(Args _args) {     InventJournalTable              inventJournalTable;     InventJournalNameId          inventJournalName   = 'Journal Name';     InventJournalTrans              inventJournalTrans;     InventDim                            inventDim_From,inventDim_To;     InventJournalCheckPost      journalCheckPost;     //header     inventJournalTable.clear();     inventJournalTable.JournalType  = InventJournalType::Transfer;     inventJournalTable.initFromInventJournalName(InventJournalName::find(inventJournalName));     inventJournalTable.insert();     //lines     inven...

How to Create Sales Order in Dynamics AX 2012 Through X++

How to Create Sales Order in Dynamics AX 2012 Through X++ static void createSalesOrder(Args _args) {     SalesTable              salesTable;     SalesLine                salesLine;     InventDim              inventDim;     NumberSeq             numberSeq;     SalesFormLetter     salesFormLetter;     SalesId                    salesId;     //Sales Table     numberSeq                   = NumberSeq::newGetNum(SalesParameters::numRefSalesId());     numberSeq.used();     salesId                          = numberSeq.num();     salesTable.SalesId...

How to add a document handling note in Microsoft Dynamics 365 for Finance and Operations through X++

How to add a document handling note in Microsoft Dynamics 365 for Finance and Operations  through X++         custTable             custTable;         DocuType            docuType;         DocuRef              docuRef;         custTable   = custTable::find('US-001');         docuType   = DocuType::find('Note');         if (!docuType || docuType.TypeGroup != DocuTypeGroup::Note)         {             throw error("Invalid type");         }         docuRef.RefCompanyId    = custTable.dataAreaId;         docuRef.RefTableId           = custTable.TableId;         ...

How to use a normal table as a temporary table in Microsoft Dynamics 365 for Finance and Operations through X++

How to use a normal table as a temporary table in Microsoft Dynamics 365 for Finance and Operations  through X++         CustTable custTable;         custTable.setTmp();         custTable.AccountNum  = 'CUST-0001';         custTable.Currency    = 'USD';         custTable.Party = 1;         custTable.doInsert();         custTable.clear();         custTable.AccountNum  = 'CUST-0002';         custTable.Currency    = 'JOD';         custTable.Party = 2;         custTable.doInsert();