Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all 175888 articles
Browse latest View live

RE: Excel >Dynamics AX > options equivalent

$
0
0

Hi Sam Khawaja,

Excel add-in can publish to any company now and usually you will have company field in your template where you can specify company. If you want to limit records returned to only one company you can go to "Filter" and add a range by dataareaId field.


RE: Personalization > query equivalent in D365

$
0
0

Hi Sam Khawaja,

In current version you can right click on a field, from menu click on a "Form name : x", where x is a form name. AX will open you a form where on administration tab you can see Control name, Data source and data field. Also query statement is available, please refer to screenshot below:

RE: Excel >Dynamics AX > options equivalent

RE: Code movement from Usr layer to Var layer

$
0
0

Your process is wrong, because you neither keep IDs the same nor you do something about changed IDs. What you did is guaranteed to cause data loss, and various ID conflicts are likely (that's the case of "field string length decreased").

I have no idea what "issue in table & fields" are you facing if you follow the process recommended by Microsoft. You must explain your problem if you want others to help you with it.

RE: Ledger Allocation rule

$
0
0

Hi An Suong,

Unfortunately, such an allocation is not possible, as AX only picks up those account transactions that have a posting in transaction currency amount.

You will experience the same issue if you try to shift the amount you see manually through a GL Journal because also this can't be done directly.

Best regards,

Ludwig

RE: Personalization > query equivalent in D365

$
0
0

When I click on the form name nothing is happening. Thanks Sam

RE: Scheduling of production order simulatneously

$
0
0

But you can not complete the main item without the pegged item right?

Scheduling of production order simulatneously

$
0
0

I want to schedule a pegged production order. There are two production order, one is derived from another one- Production and packing. Packing is done simultaneously with Production. So, I want to schedule my order simultaneously and not one after the other.

Defining packing as an operation will not work as stock of packed inventory and loose inventory are kept separately


RE: Personalization > query equivalent in D365

RE: Error when create Invoice For PO

$
0
0

Hi Friends,

I am also faced the same warning message while trying to invoice for multiple purchase order and finally i got the solution. So I thought to post if it helps anybody. I will explain it with one example.

I have 2 purchase orders, PO1 and PO2. I have done upto packing slip for both POs. Now I am trying to do invoice. When i open invoice from PO1, i can see PO1 lines and I am trying to add PO2 by using "add another purchase order" option and click ok, this warning is coming. So i could not add PO2. Its because, when you open PO2 invoice , the lines already selected, so you have to unselect this PO2 using "add another purchase order" option. now you can select both lines in PO1 and do invoice. Its because of the selection in case of multiple purchase orders.

Thanks

Work

Error when create Invoice For PO

$
0
0

One or more of the selected purchase order lines does not have a corresponding product receipt line. Invoice lines were not created.

Loyalty Point does not update when creating Customer Order in MPOS

$
0
0

Hi,

When we creating a Sales Order in MPOS for a Retail Channel and add a customer who has Loyalty card number to sales order and then pay it, loyalty point for customer's card number updated.

But when we create a Customer Order and add a customer who has Loyalty card number to it and then pay it, loyalty point for customer's card number does not updated(The same product with the same price as above Sales Order).

After some debugging we reach a code in Retail SDK (Microsoft.Dynamics.Commerce.Runtime.Services.dll) in class LoyaltyService.cs  in method CalculateLoyaltyRewardPoints, there is a comment says that as follows : 

// Calculate loyalty only when the loyalty card number exists.
// Calculate loyalty only when the transaction type is Sales (i.e. Cash and carry).
// Other transactions such as PendingOrder and CustomerOrder will calculate in HQ after invoicing.

but when we post mentioned customer order in HQ, the loyalty point for customer's card number does not updated.

Any idea how loyalty point updated for Customer Order.

Thanks.

RE: Pass multiple list parameters to custom service

$
0
0

Thanks Martin.

The issue is resolved. Earlier I didn't deserialize the object in my MVC application.

RE: unable to save Sales Quotation report as pdf to a local drive through x++ code ax4

$
0
0

The error says that the problem is init() method of BCSalesQuotation_v1_02 report, at line 33, therefore start your debugging there. If you don't see any problem, please show us the code of init() and share you findings with us.

Also, please use </> button in the rich formatting view to paste source code. It makes it easier for other to read the code, which will increase your change to get an answer.

By the way, your use of a persistent table that's cleaned up when running a report is potential dangerous. You may get into problems if the same user runs the same report twice at the same time. If you must use a persistent table, you can at least improve your code. If there is only one record per user, replace deleting and inserting with an update. If there may be more, replace while select+delete with delete_from. Also note that name isn't necessarily unique, therefore using user ID would be safer.

RE: How to save Sales Quotation report to a local drive in PDF format without displaying it on screen through x++ code

$
0
0

Hi Maria, I see you've asked a subsequent question in another thread, but you haven't replied to this thread in past three days.

Please make clear whether you still need out help. And please don't limit yourself to this thread; review all your open questions and either close them by verifying the answer, or make clear what else you need from us.

please review your older threads and make clear whether you ne e


How to save Sales Quotation report to a local drive in PDF format without displaying it on screen through x++ code

$
0
0

Hi,

Please let me know , how could I save a Sales Quotation report by passing the Quotation-ID dynamically in PDF format to a local drive without displaying it on screen through x++ code.

Regards,

Mania

RE: unable to save Sales Quotation report as pdf to a local drive through x++ code

$
0
0

Thanks  a lot for your reply.

Please find code for init() and fetch method of my Report as below:

init() :
void  init()
{;
//MCA:PM 5/21/2010 SSRS reporting BEGIN
    if(MCASSRSReportSetup::find(MCASSRSReport::SalesQuotation).RecId)
    {
        element.callSSRSReport();
        super();
        return;
    }
//MCA:PM 5/21/2010 SSRS reporting END
    super();

    printCopyOriginal = element.args().parmEnum();

    if (classidget(element.args().caller()) == classnum(salesQuotationEditLinesForm_Sales_Send) || classidget(element.args().caller()) == classnum(salesQuotationEditLinesForm_Proj_Send))
    {
        salesQuotationEditLines = element.args().caller();
    }

    if (element.args().record())
        journalList         = SalesQuotationEditLinesForm::createJournalListCopy(element.args().record());
    else
        journalList         = element.args().object();

    if (element.args().parm())
        inqueryType = element.args().parm();
    else
        inqueryType = "";

    if (!journalList)
        throw '';

    journalList.first(custQuotationJour);

    if (!custQuotationJour)
        throw error("@SYS26348");

    custFormletterDocument      = CustFormletterDocument::find();
    custFormletterParameters    = CustFormletterParameters::find();
    companyInfo                 = CompanyInfo::find();

    this.changeDesign();

    if (custFormletterParameters.TaxSpecPrintLevel != TaxSpecPrintLevel::None)
    {
        if (custFormletterParameters.TaxSpecPrintLevel == TaxSpecPrintLevel::Currency)
        {

        }
    }

    this.enableTotalsSections();

    inventDimReport = new InventDimCtrl_Rep_Sales(element);
    inventDimReport.parmDocumentStatus(DocumentStatus::Quotation);
    inventDimReport.parmDisableLabel(custFormletterParameters.PrePrintLevelQuotation == PrePrintLevel::PrePrinted);
    inventDimReport.initDimParmVisible();
    inventDimReport.updateControls();
    inventdimSetup = inventDimReport.dimFieldsActive(inventDimReport.parmDimParmVisible());

    salesFormLetterReport = SalesFormLetterReport::construct(DocumentStatus::Quotation);
    salesFormLetterReport.parmReportDesign(element);


    //Karya - Start - 11/12/2016
     //qbrReport = this.query().dataSourceName('CustQuotationTrans').addRange(fieldnum(CustQuotationTrans,ItemId));
    // qbrReport.value(queryvalue(CustQuotationTrans.ItemId));
    //Karya - End - 11/12/2016
}


fetch() :

 

boolean  fetch()
{
    QueryRun                tradeLoopTrans;
    boolean                 printFooters;
    int                     i,j=1,k=1;
    int                     nTransCount;
    QueryRun                testTrans;
    DocuRef                 docuRef;
    Boolean                 notes=false;
    ;
    setprefix(this.design().caption());

//    PCTest = True;
    IS_OSH = False;  // Init IS_OSH

    while (custQuotationJour)
    {
        setprefix(strfmt("@SYS70899", custQuotationJour.QuotationId));

        isSummaryUpdated    = custQuotationJour.isSummaryUpdated();

        element.design().languageID(custQuotationJour.LanguageId);

        //Set the initial numnber of copies based on what the user entered
        salesFormLetterReport.initialPrinterCopies(element.printJobSettings().copies());

        if (printCopyOriginal == PrintCopyOriginal::OriginalPrint)
        {
            salesFormLetterReport.numberOfCopies(custQuotationJour.PrintCopies);
            salesFormLetterReport.numberOfOriginals(custQuotationJour.PrintOriginals);
        }
        else
            salesFormLetterReport.setPrintOriginalOrCopy(printCopyOriginal == PrintCopyOriginal::Copy);

        salesFormLetterReport.checkSomethingToPrint();

        while (salesFormLetterReport.stillOriginalsOrCopiesToPrint())
        {
            if (salesFormLetterReport.numberOfOriginals())
            {
                salesFormLetterReport.printingCopy(false);
                if (salesQuotationEditLines)
                {
                    element.unpackPrintJobSettings(salesQuotationEditLines.findPrinterSettings(PrintSetupOriginalCopy::Original));
                }
                else
                {
                    element.unpackPrintJobSettings(SalesQuotationEditLinesForm::getPrinterSettingsFormletter(DocumentStatus::Quotation,PrintSetupOriginalCopy::Original));
                    element.printJobSettings().setTarget(PrintMedium::Screen);
                }
                salesFormLetterReport.initialPrinterCopies(element.printJobSettings().copies());
                element.printJobSettings().copies(salesFormLetterReport.printNumberOfOriginals());
            }
            else
            {
                salesFormLetterReport.printingCopy(true);
                if (salesQuotationEditLines)
                {
                    element.unpackPrintJobSettings((salesQuotationEditLines.findPrinterSettings(PrintSetupOriginalCopy::Copy)));
                }
                else
                {
                    element.unpackPrintJobSettings(SalesQuotationEditLinesForm::getPrinterSettingsFormletter(DocumentStatus::Quotation,PrintSetupOriginalCopy::Copy));
                    element.printJobSettings().setTarget(PrintMedium::Screen);
                }
                salesFormLetterReport.initialPrinterCopies(element.printJobSettings().copies());
                element.printJobSettings().copies(salesFormLetterReport.printNumberOfCopies());
            }

            this.send(custQuotationJour);

            if (docuTitle)
                element.execute(1);
            if (docuIntro)
                element.execute(2);
            if (docuConclusion)
                element.execute(3);

            lineHeaderPrintedCount = 0;

            tradeLoopTrans = new TradeLoopTrans(custQuotationJour, tablenum(CustQuotationTrans)).buildQueryRun();
//            tradeLoopTrans.query().dataSourceTable(tablenum(CustQuotationTrans)).addRange(FieldNum(CustQuotationTrans,QuotationDocNum))
            tradeLoopTrans.query().dataSourceTable(tablenum(CustQuotationTrans)).addSortField(fieldnum(CustQuotationTrans,ProjTransType),SortOrder::Descending);
            j= SysQuery::countTotal(tradeLoopTrans);
            i=0;
            while (tradeLoopTrans.next())
            {
                testTrans = tradeLoopTrans;
                custQuotationTrans = tradeLoopTrans.get(tablenum(CustQuotationTrans));
                salesQuotationLine = SalesQuotationLine::findInventTransId(custQuotationTrans.InventTransId);
                inventTable        = InventTable::find(custQuotationTrans.ItemId);
                element.setFieldsVisible();
                this.send(salesQuotationLine);
                this.send(custQuotationTrans);
                while Select firstonly Notes from docuRef where docuRef.RefTableId == Tablenum(SalesQuotationLine) &&
                                                docuRef.RefRecId == SalesQuotationLine.RecId &&
                                                docuRef.TypeId == "Note" &&
                                                docuRef.Restriction == docuRestriction::External

                if(docuRef.Notes)
                {
                    notes = True;
                }

                if(notes)
                {
                    element.execute(7);
                }
                i++;
                if(i!=j)
                {
                    element.execute(6);
                }
                //info(int2str(i));
                SQID = custquotationtrans.origQuotationId;
            }
            HeaderCustQuotationTrans.height(0,units::char);
            HeaderCustQuotationTrans.lineBelow(LineType::None);
            Select firstonly Notes from docuRef where docuRef.RefTableId == Tablenum(SalesQuotationTable) &&
                                                        docuRef.RefRecId == SalesQuotationTable::find(CustQuotationJour.salesQuotationTable().QuotationId).RecId &&
                                                        docuRef.TypeId == "Note" &&
                                                        docuRef.Restriction == docuRestriction::External;
            if(docuRef.Notes)
            {
                element.execute(8);
                Control_4.visible(false);
            }

            element.execute(5);

            if(salesquotationtable::find(SQID).Dimension[2] == '08')
            IS_OSH = TRUE;

// Portland ?
            //if(salesquotationtable::find(SQID).Dimension[2] != '07' && salesquotationtable::find(SQID).Dimension[2] != '09')
                salesFormLetterReport.printFormLetterRemarks(custQuotationJour);



            salesFormLetterReport.originalOrCopyIsPrinted();
            if (salesFormLetterReport.stillOriginalsOrCopiesToPrint())
                element.reset();
        }

        if (!journalList.next(custQuotationJour))
        {
            break;
        }
        else
            element.reset();

        origSalesId = custQuotationTrans.OrigSalesId;
    }

    element.execute(4); // Comment(OSH)
    element.execute(1); // Print PCTest ?
    element.execute(2);

    return true;
}



 

Please help me to understand what is going wrong

unable to save Sales Quotation report as pdf to a local drive through x++ code

$
0
0

Hi all,

Please help me out in saving the Quotation Report as pdf to a local drive.

I am getting the below error while running the job where I have written code for saving the report as pdf to a local drive.  Please let me know what am I  doing wrong ?

Please find my code as Below :

static void KTI_BusinessConnector(Args _args)
{
KTI_SalesTempQuotation kti_SalesQuotation;
Args args = new Args();
PrintJobSettings pjs = new PrintJobSettings();
SysReportRun reportRun;
filename mFile;
QuotationId qId;
;


mFile = "C:\\MyFile.pdf";
winapi::deleteFile(mFile);

pjs.fileName(mFile);
pjs.format(PrintFormat::PDF);
pjs.setTarget(PrintMedium::File);
pjs.preferredFileFormat(PrintFormat::PDF);

//Set a preferred printer so the pdf looks normal when the default of the user is
//a strange printer (like a dot matrix label printer)
// pjs.deviceName(BCSalesQuotation_v1_02::.PrinterEmulationPDF);

args.name(reportstr("BCSalesQuotation_v1_02"));

while Select forupdate kti_SalesQuotation
where kti_SalesQuotation.UserInformation == XUserInfo::find(false, curUserId()).name
{
if(kti_SalesQuotation)
{
ttsbegin;
kti_SalesQuotation.delete();
ttscommit;
}
}

kti_SalesQuotation.clear();
qId = 'QT-00085276';
//select kti_SalesQuotation;
ttsbegin;
kti_SalesQuotation.UserInformation = XUserInfo::find(false, curUserId()).name;
kti_SalesQuotation.SalesQuotationNo = qId;
kti_SalesQuotation.insert();
ttscommit;

args.record(kti_SalesQuotation);
reportRun = classFactory.reportRunClass(args);

reportRun.printJobSettings(pjs.packPrintJobSettings());
reportRun.query().interactive(false);
reportRun.report().interactive(false);
reportRun.init();
reportRun.run();
}

Error am getting as below :

 

Error:
Error executing code: The field with ID '0' does not exist in table 'CustQuotationJour'.

Stack trace

(S)\Classes\RecordSortedList\first
(C)\Reports\BCSalesQuotation_v1_02\Methods\init - line 33
(C)\Jobs\KTI_BusinessConnector - line 52

Please do the needful

Thanks and regards,

Mania

 

Deserializing object in custom service D365

$
0
0

Hi Experts,

Do I need to change the structure of the below code in D365 for the custom service. The below code is what I used in AX 2012 and exposed as a service. Can I use the same for D365?

I have to call this method (insertPOStaging) from client application using JSON. So do I need to deserialize in this method?

There are two List objects as parameters in the method insertPOStaging and I am not really sure whether its a proper way to deserialize. Kindly guide.

Class PurchaseOrderService

{

[AifCollectionTypeAttribute('_poHeaderObj', Types::Class,classStr(PurchaseOrderHeaderContract)),
AifCollectionTypeAttribute('_poLineObj', Types::Class,classStr(PurchaseOrderLineContract)),
SysEntryPointAttribute(true)]
public void insertPOStaging(List _poHeaderObj, List _poLineObj)
{

 //rest of the code to insert into staging tables.

}

}

Thanks,

N.Sridhar

RE: Error "Update for voucher xxxxxx has been canceled to avoid oversettlement. The settled customer or vendor balance for the transaction must not exceed the transaction amount."

$
0
0

I faced the same problem and on verification it was found that the referred voucher has been settled in full but the closed date in the CustTrans form is not updated. Hence the system tries to settle the referred voucher and found it is over settlement and throw error. - ILANGO PANDIRAJAN

Viewing all 175888 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>