Thursday, June 16, 2016

Understanding AOT Maps in Ax 2012

Invoicing Sales Order by Confirming SalesQuotation

Hi Daxer’s !!!

Scenario:Creating SalesQuotation >>Send SalesQuotation to Customer >> here while doing SalesQuotation confirmation i have added one Checkbox of (SalesInvoicecheck) if i check this checkbox and confirm it,then the salesorder status will be invoiced of particular sales Quotation in Sales Order form

How I achieved scenario is
First I have Created a new field in SalesQuotationTable as below


Then I have added one check box(SalesInvoiceCheck) control in SalesQuotationEditLine Form






CommandButton:Ok>>Clicked()

void clicked() // added by shiva
{

    SalesQuotationParmTable SalesQuotationParmTable1;
    SalesquotationTable  salesquotationTable1;

    super();

    SalesQuotationParmTable1 = SalesQuotationParmTable::find(SalesQuotationParmTable.QuotationId,SalesQuotationParmTable.ParmId,true);
    salesquotationTable1=SalesquotationTable::find(SalesQuotationParmTable1.QuotationId);
     if (SalesInvoiceCheck.value()==1)
    {
        SalesQuotationTable1.selectForUpdate(true);
        ttsBegin;
        SalesQuotationTable1.Sk_SalesInvoiceCheck=NoYes::Yes;
        SalesQuotationTable1.update();
        ttsCommit;

    }
}


In above method i’m just finding SalesQuotationTable recid based on quotation id and also updating SalesQuotationTable with SalesInvoicecheck value as “Yes”


Now Finally based on above condition i was gone through with the SalesQuotationLineType Class>>updateSalesQuotationTable() as below





In updateSalesQuotationTable() i have added my logic here
void  updateSalesQuotationTable()
{
    SalesQuotationTable     salesQuotationTable;
    SalesFormLetter         salesformletter;// added by shiva

    salesQuotationTable = salesQuotationLine.salesQuotationTable(update);

    salesQuotationTable.CovStatus    = 0;

    salesQuotationTable.write();

    //added by shiva invoicing salesquotation through confirmation
    if(salesQuotationTable.Sk_SalesInvoiceCheck== NoYes::Yes && salesQuotationTable.SalesIdRef)
    {
        salesformletter = salesformletter::construct(DocumentStatus::Invoice);
        salesformletter.update(salestable::find(salesQuotationTable.SalesIdRef));
    }
    // ended by shiva
}
Now goto Navigation>>Sales&Marketing >>AllSalesOrders>>
Search the Above Salesorder(001358) status is invoiced








Tuesday, June 14, 2016

How InventTrans Automatically updating when a line in PurchLine or SalesLine is created.


Hi Daxer’s !!!

Recently I have gone through one customization.

Scenario:Add “Registrationnumber” field in Other Information group of Customer form if you enter some value on registration number it should update at taxes action pane  >>tax registration >>Registration number










>>First I have added one field in custTable like sk_Registrationnumber and also added that field to customer form as above screen shot

Note : Based on Customer Accountnum in custTable ,i need to update  registrationnumber in TaxRegistration table so I need to check relation between Custtable and Taxregistration


Taxregistration.dirpartylocation>>Dirpartylocation.party>>custtable.party
CustTable>>Modifiedfield()>>

case fieldNum(CustTable,sk_registrationnumber):
            if (this.SK_RegistrationNumber)
                {
                ttsBegin;
                while select forupdate  taxregistration
                    join DirPartyLocation
                        where taxregistration.DirPartyLocation==DirPartyLocation.RecId
                            join CustTable
                                where DirPartyLocation.Party==CustTable.Party
                    if(TaxRegistration)
                    {
                        {
                            taxregistration.validTimeStateUpdateMode(validTimeStateupdate::Correction);
                            taxregistration.ValidFrom=today();
                            taxregistration.ValidTo=today()+20;
                            taxregistration.RegistrationNumber=this.SK_RegistrationNumber;
                            taxregistration.update();
                        }
                    }
                ttsCommit;
                }
---------------------------or------------------------------------


case fieldNum(CustTable,SK_RegistrationNumber):
            if(this.SK_RegistrationNumber)
            {
                ttsBegin;
                //TaxRegistration = TaxRegistration::find(DirPartyLocation::findByPartyLocation(CustTable::find(this.AccountNum)
               // TaxRegistration.DirPartyLocation=Dirpartylocation::findByPartyLocation(this.Party,true).Location;
               // TaxRegistration.TaxRegistrationTypeApplicabilityRule=5637146891;
               
                //TaxRegistration.selectForUpdate(true);
                TransDate = systemDateGet();
                transDateTo = dateMax();
                TaxRegistration.validTimeStateUpdateMode(ValidTimeStateUpdate::Correction);
                SELECT forUpdate validTimeState(TransDate, transDateTo) * from TaxRegistration
                    Join dirpartylocation
                        where TaxRegistration.DirPartyLocation==dirpartylocation.RecId
                            join DirPartyTable
                                where dirpartylocation.Party==DirPartyTable.RecId
                                    join CustTable
                                        where DirPartyTable.RecId==CustTable.Party;
                if(TaxRegistration)
                {
                    TaxRegistration.RegistrationNumber=this.SK_RegistrationNumber;
                    TaxRegistration.update();
                }
                ttsCommit;
            }




Exception from HRESULT: 0xC0048021 in DIXF AX 2012 R3



If you’re using Excel 2013 , the problem is caused by DMConfig XML file.
Go to the DMConfig.xml file in the Microsoft Dynamics AX\60\DataImportExportFramework  folder and replace the PipelineComponentInfo_Multicast, PipelineComponentInfo_ExcelSource and  <PipelineComponentInfo_ExcelDestination> nodes by the following:
<PipelineComponentInfo_Multicast>
{33D831DE-5DCF-48F0-B431-4D327B9E785D}
< /PipelineComponentInfo_Multicast>
< PipelineComponentInfo_ExcelSource>
{9F5C585F-2F02-4622-B273-F75D52419D4A}
< /PipelineComponentInfo_ExcelSource>
< PipelineComponentInfo_ExcelDestination>
{90E2E609-1207-4CB0-A8CE-CC7B8CFE2510}
< /PipelineComponentInfo_ExcelDestination>


Export a copy of the standard user acceptance testing (UAT) database

 Reference link: Export a copy of the standard user acceptance testing (UAT) database - Finance & Operations | Dynamics 365 | Microsoft ...