Microsoft.Dynamics.Ax.Xpp.UpdateConflictException’

This error is all about OCC (Optimistic Concurrency Control) .

read more on http://msdn.microsoft.com/en-us/library/bb190073.aspx

2 way to fix this..

first apply tablename.reread() before doing update.

second , Set OCC on table property to ‘No’

like this..

HAPPY DAXING !!

Advertisements

Send Email Proforma Sales Customize with Job.

class : SalesInvoiceController.OutputReport ()

//AIFD custom send email proforma testing
SrsReportEMailDataContract emailContract;
SRSPrintDestinationSettings         printSettings;
//END

//just example.. you can customize the parameter field Subject etc on email with your own parameter and conditions.
//add this code below at the bottom of class OutputReport
if(custInvoiceJour.isProforma())
{
    emailContract = new SrsReportEMailDataContract();
 
    emailContract.parmAttachmentFileFormat(SRSReportFileFormat::PDF);
    emailContract.parmSubject(“My Report”);
    emailContract.parmTo(“jimmi.tandiah@yahoo.com”);
 
    printSettings = this.parmReportContract().parmPrintSettings();
 
    printSettings.printMediumType(SRSPrintMediumType::Email);
    printSettings.parmEMailContract(emailContract);
    printSettings.fileFormat(SRSReportFileFormat::PDF);
 
    formLetterReport.getCurrentPrintSetting().parmPrintJobSettings(printSettings);
}

—————————-
Job example

static void AI_TestEmailProforma(Args _args)
{
    SalesFormLetter letter = SalesFormLetter::construct(DocumentStatus::Invoice);
    SalesTable sale = SalesTable::find(‘SO-14000599′);

    ttsBegin;
    letter.update(sale, systemDateGet(), SalesUpdate::All, AccountOrder::None, true, true,true);
    ttsCommit;
}