Quantcast
Channel: Martin Dráb's Activities
Viewing all 17532 articles
Browse latest View live

send Json data to external WebService from AX2009

$
0
0

How can I realize to send JSON data to an external Webservice from AX2009?

I think I have to create an external C# tool where I put my data (URL, Login Data and Data to post) in and than send the stuff from there. Am I right?

How can I easily realize this and how can I handle this inside AX?


When building by building the form property "Data Source Query", An error occurs.

$
0
0

An error occurs when building by building the form property "Data Source Query".
If you know the solution, would you please tell me?

<Error Message>

Compilation failed. Abnormal termination with unhandled exception. System.NullReference. Object reference not set to an instance of objetct.

<Error Image>

How to create query like this output?

$
0
0

Hi all.

Please help me,

in table LedgerJournalTrans, i try open journalNum 'JE_0001' for sample.

and then, i want to create report from this table for output like this picture below :

or

Can i do it in ax2012? and How?

Please help me. Thanks.

Menu item name in custom entity wizard

$
0
0

I am trying to create a DIXF (Data import/export Framework) Custom Entity with the Wizard.

The thing is during the wizard I am asked to enter the "Display menu item name" value.

The questions are why is it mandatory, where does this menu item will be shown and what can I do it now for it?

Request Virtual/Demo Dynamic 365

$
0
0

Hi All

How i can Request Virtual/Demo Dynamic 365 for install in my server?

Thanks

Get access to additional queries in Sales Update form

$
0
0

I have a user who can click the Select Query dropdown in the Sales Update form and see a list of options. I only have the Query Used option.

How go I get other queries to appear in this dropdown?


Standard interface

$
0
0

In AX2009 Is there a standard interface to step back to ,

the interface that was there fresh out of the box,

before all the (insert air-quotes) certified programmers messed them up.

The interface at the moment is cluttered with menu items/options marked by an * (asterix)

cluttered with menu items that do not work or generate errors.

There are no menu items programmed for the company I work for.

I'm training a new AP employee and would like to get rid of all the clutter.

(AP = accounts payable = vendor= creditor in AX speak)

Disgruntled AX2009victim

Remove case sensitive duplicates from lookup ax 2012

$
0
0

I have a lookup in which I am inserting values on run time, all things are going fine. Requirement is to avoid replicating values if case sensitive. Like ABCD and abcd should not be there in lookup at a time.

Below is my code that I've tried so far.

public void lookup()
{

   Query query = new Query();
    QueryBuildDataSource queryBuildDataSource;
    QueryBuildRange queryBuildRange;
    SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventJournalTrans), this);

    sysTableLookup.addLookupField(fieldNum(InventJournalTrans,vehicleNo));


    queryBuildDataSource = query.addDataSource(tableNum(InventJournalTrans));
    queryBuildDataSource.addSortField(fieldNum(InventJournalTrans,vehicleNo),SortOrder::Descending);
    queryBuildDataSource.addRange(fieldNum(InventJournalTrans, vehicleNo)).value(SysQuery::valueNotEmptyString());

    sysTableLookup.parmQuery(query);
    QueryBuildDataSource.orderMode(OrderMode::GroupBy);
    sysTableLookup.performFormLookup();



    this.replaceOnLookup();
}

Here is the image of lookup.

enter image description here


Print Management Error when running in Batch

$
0
0

I can successfully use Print Management to print/e-mail Sales Order Invoices when I do NOT run as a batch. 

But if I enable batch, then SOME of the records will send successfully (both print and/or e-mail) but will fail part way through with the following error message:

ANY suggestions or thoughts, no matter how crazy they may sound are welcomed at this point.  Here is some general information about the setup:

-AX 2012 R3 CU 8

-3 AOS's using RD web access for client connection

Things I have tried:

- Running the batch on different AOS's

- Running the batch with only 1 thread (eliminating multithreading)

- Running the batch at different times

- Running the batch without also posting the invoices (using Print Management after invoice posting)

- Running in a Dev and Test environment restored from Production (These run successfully)

How to pass parameter between 2 forms

$
0
0

Dear All,

Can you please let me know how to pass parameter between 2 forms :

Form : Indent Form

Form : Trsnafer Order Form

Please give me more shed on this.

Thanks!

Arpan Sen

Dynamics 365 cloud based - CALS

$
0
0

Hi,

We are planning to deploy Dynamics 365 Plan 1 Enterprise Edition Cloud version via Office 365 and would like to know if we require CAL license for Dynamics 365 (Cloud).

Thanks,

Mitesh

Failed to update database "MicrosoftDynamicsAX" because the database is read-only.'0' 'Sales order header' record(s) inserted in staging

$
0
0

Dear

Following error found in DMF while Uploading Sales Order Header File

How Can i resolve it

regards

Menu item could not be opened

$
0
0

Hello guys, 

I have just made some adjustments: created new field in form to enter information, updated logic to take the value and save together with other values in HcmEmployment table, as well as creating additional field in that table for the new value. Everything built well, but as I try to access it through client, I get  "The menu item with name hcmworkerlistpage could not be opened". Thanks for ideas in advance.

AOT query ranges

$
0
0

My required condition is:

where  (InventTransOrigin.ReferenceCategory == InventTransType::Purch &&  InventTrans.StatusIssue == StatusIssue::Sold ) 

|| (InventTransOrigin.ReferenceCategory == InventTransType::ٍSales &&  InventTrans.StatusReceipt == StatusReceipt::Purchased ) 

I want to rephrase the following x++ code to achieve this condition effect:

queryBuildDataSource = query.dataSourceTable(tableNum(InventTransOrigin));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(InventTransOrigin, ReferenceCategory));
queryBuildRange.value(queryValue(InventTransType::Purch));

queryBuildDataSource = query.dataSourceTable(tableNum(InventTransOrigin));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(InventTransOrigin, ReferenceCategory));
queryBuildRange.value(queryValue(InventTransType::Sales));

queryBuildDataSource = SysQuery::findOrCreateDataSource(query, tableNum(InventTrans));
SysQuery::findOrCreateRange(queryBuildDataSource, fieldnum(InventTrans, StatusIssue)).value(queryValue(StatusIssue::Sold));

queryBuildDataSource = SysQuery::findOrCreateDataSource(query, tableNum(InventTrans));
SysQuery::findOrCreateRange(queryBuildDataSource, fieldnum(InventTrans, StatusReceipt)).value(queryValue(StatusReceipt::Purchased));

Thanks in advance.

AOT query with a relation to two parent tables

$
0
0

Here is a SQL Select statement:

Select * from InventTransOrigin
Join InventTrans on InventTransOrigin.RecId = InventTrans.InventTransOrigin
Join InventDim on InventDim.InventDimId=InventTrans.InventDimId
Join InventSerial on InventSerial.InventSerialId = InventDim.InventSerialId 

and InventSerial.ItemId = InventTransOrigin.ItemId

How can I implement this SQL statement by building an AOT query?

Thanks in advance.


Authentication issue with OData service

$
0
0

How can I consume ODATA service in VHD provide by Microsoft. I have setup VHD at my place, have created basic forms and other basic stuffs, but as in-bound ports are no longer there, how can I access the ODATA service from AOS running inside the VHD?

How to insert SID using JOB to Upload Purchase Order

$
0
0

Hi Experts,

I have a problem when I am uploading Purchase Order using JOB. There is one field from Purchase Order line that I need to upload, but when I do the personalized the SID is a method from PurchLine not a field.
Here is the screen shot from the Purchase Order line

The field of SID is PurchLine.ARPTaskWBSId

/////

static void UploadPOTest(Args _args)
{
    InventDim                       inventDim;
    InventSiteId                    inventSiteId;
    InventLocationId                inventLocationId;
    Counter                         counter;
    Struct                          struct = new Struct();

    PurchTable                      purchTable;
    PurchLine                       purchLine;
    AssetBook                       assetBook;
    VendTable                       vendTable;
    AxPurchTable                    axPurchTable;
    AxPurchLine                     axPurchLine;
    ARPTaskTools                    arpTaskTools;
    PurchFormLetter                 purchFormLetter;
    PurchPrepayTable                purchPrepayTable;
    PurchTotals                     purchTotals;

    container                       defaultDim;
    int                             LineNum;
    int                             row=2;
    int                             _row=2;
    int                             _row_prep=2;

    SysExcelApplication             application = SysExcelApplication::construct();
    SysExcelWorkbooks               workbooks = application.workbooks();
    SysExcelWorkbook                workbook;
    SysExcelWorksheets              worksheets;
    SysExcelWorksheet               worksheet;
    SysExcelCells                   cells;
    COMVariantType                  type;
    COMVariantType                  _type;
    COMVariantType                  _type_prep;

    FilenameOpen                    filename;
    dialogField                     dialogFilename;
    Dialog                          dialog;
    ;

    startLengthyOperation();
    dialog = new Dialog('ExcelUpload');
    dialogFilename = dialog.addField(ExtendedTypeStr("FilenameOpen"));
    dialogFilename.label('File Path');
    dialog.filenameLookupTitle('Upload From Excel');
    dialog.caption('Upload Purchase Order');
    dialogFilename.value(filename);

    if(!dialog.run())
        return;

    filename = dialogFilename.value();

    try
    {
        if (workbooks.open(filename, false, true))
        {
            workbook    = workbooks.item(1);
            worksheets  = workbook.worksheets();
            worksheet   = worksheets.itemFromNum(1);
            cells       = worksheet.cells();

            //Create PO Headers
            _row++;
            _type = cells.item(_row, 1).value().variantType();

            if (_type != COMVariantType::VT_EMPTY)
            {
                purchTable.clear();
                vendTable = VendTable::find(cells.item(_row, 4).value().bStr());
                purchTable.initFromVendTable(vendTable);

                axPurchTable = AxPurchTable::newPurchTable(purchTable);
                //axPurchTable.parmPurchId(NumberSeq::newGetNum(PurchParameters::numRefPurchId()).num());
                axPurchTable.parmPurchId(cells.item(_row, 30).value().bStr());
                axPurchTable.parmPurchaseType(PurchaseType::Purch);
                axPurchTable.parmDocumentStatus(DocumentStatus::PurchaseOrder);
                axPurchTable.parmProjId(cells.item(_row, 6).value().bStr());
                axPurchTable.parmPurchIdLama(cells.item(_row, 3).value().bStr());
                axPurchTable.parmPayment(cells.item(_row, 5).value().bStr());
                axPurchTable.parmSettleVoucher(SettlementType::OpenTransact);
                axPurchTable.parmWorkerPurchPlacer(HcmWorker::userId2Worker(curUserId()));
                axPurchTable.parmDeliveryDate(cells.item(_row, 1).value().date());   //(str2date("11/3/2016",213));
                axPurchTable.parmAccountingDate(cells.item(_row, 2).value().date());
                axPurchTable.parmPurchStatus(PurchStatus::Backorder);
                axPurchTable.parmOrderAccount(cells.item(_row, 4).value().bStr());
                axPurchTable.parmCurrencyCode('IDR');
                axPurchTable.save();
            }

            //Create PO Lines
            row++;
            type = cells.item(row, 1).value().variantType();

            ttsBegin;
            while (type != COMVariantType::VT_EMPTY)
            {
                counter++;
                inventSiteId                    = cells.item(row, 17).value().bStr();
                inventLocationId                = cells.item(row, 18).value().bStr();
                inventDim.InventSiteId          = inventSiteId;
                inventDim.InventLocationId      = inventLocationId;

                purchLine.clear();
                purchLine.initValue();
                purchLine.initFromPurchTable(purchTable);
                purchLine.initFromInventTable(InventTable::find(cells.item(row, 10).value().bStr()));


                axPurchLine = AxPurchLine::newPurchLine(purchLine);
                axpurchLine.parmItemId(cells.item(row, 10).value().bStr());
                axpurchLine.parmInventDimId(InventDim::findOrCreate(inventDim).inventDimId);
                axPurchLine.parmPurchQty(cells.item(row, 12).value().double());
                axPurchLine.parmPurchPrice(cells.item(row, 13).value().double());
                axPurchLine.parmDescription(cells.item(row, 11).value().bStr());
                axPurchLine.parmLinePercent(cells.item(row, 14).value().double());
                axPurchLine.parmTaxItemGroup(cells.item(row, 19).value().bStr());
                axPurchLine.parmTaxGroup(cells.item(row, 20).value().bStr());
                axPurchLine.parmInventLocationId(cells.item(row, 21).value().bStr());
                axPurchLine.parmRequester(HcmWorker::userId2Worker(cells.item(row, 22).value().bStr()));
                //purchline.ARPTaskWBSId() = ARPTasks::findByActivityNumber(cells.item(row, 31).value().bStr()).TaskId_Wbs;


                //Kondisi untuk FixedAsset
                select assetBook
                        where assetBook.AssetId == cells.item(row, 25).value().bStr();

                if(cells.item(row, 23).value().bStr() == 'Yes')
                {
                    axPurchLine.parmCreateFixedAsset(NoYes::Yes);
                    axPurchLine.parmAssetGroup(cells.item(row, 24).value().bStr());
                }
                else if(cells.item(row, 23).value().bStr() == 'No')
                {
                    axPurchLine.parmAssetGroup(assetBook.AssetGroup);
                    axPurchLine.parmAssetId(cells.item(row, 25).value().bStr());
                    axPurchLine.parmAssetBookId(assetBook.BookId);
                }

                //Kondisi untuk Project
                if(cells.item(row, 26).value().bStr() != '')
                {
                    axPurchLine.parmProjId(cells.item(row, 26).value().bStr());
                    axPurchLine.parmActivityNumber(cells.item(row, 27).value().bStr());
                    axPurchLine.parmProjCategoryId(cells.item(row, 28).value().bStr());
                    axPurchLine.parmProjLinePropertyId(cells.item(row, 29).value().bStr());
                    axPurchLine.parmProjSalesCurrencyId(purchTable.CurrencyCode);
                    axPurchLine.parmProjSalesUnitId('Jam');
                }

                defaultDim = conNull();
                struct.remove('DIVISI');
                struct.remove('PROYEK');
                struct.add('DIVISI', cells.item(row, 15).value().bStr());
                struct.add('PROYEK', cells.item(row, 16).value().bStr());
                defaultDim += struct.fields();
                defaultDim += struct.fieldName(1);
                defaultDim += struct.valueIndex(1);
                defaultDim += struct.fieldName(2);
                defaultDim += struct.valueIndex(2);

                axPurchLine.parmDefaultDimension(AxdDimensionUtil::getDimensionAttributeValueSetId(defaultDim));
                axPurchLine.save();

                row++;
                type = cells.item(row, 1).value().variantType();
            }
            ttscommit;

                purchTable  = PurchTable::find(axPurchTable.parmPurchId());
                purchTotals = PurchTotals::newPurchTable(purchTable);
                purchTotals.calc();

                //Kondisi untuk Prepayment
                _row_prep++;
                _type_prep = cells.item(_row_prep, 9).value().variantType();

                if (_type_prep != COMVariantType::VT_EMPTY)
                {
                    purchPrepayTable.clear();
                    purchPrepayTable.initValue();
                    purchPrepayTable.PurchTable         = purchTable.PurchId;
                    purchPrepayTable.Description        = cells.item(_row_prep, 7).value().bStr();
                    purchPrepayTable.Type               = PurchPrepayType::Percent;
                    purchPrepayTable.Value              = cells.item(_row_prep, 8).value().double();
                    purchPrepayTable.PrepayLimit        = (purchTotals.purchTotalAmount() * cells.item(_row_prep, 8).value().double()) / 100;
                    purchPrepayTable.PrepayAvailable    = (purchTotals.purchTotalAmount() * cells.item(_row_prep, 8).value().double()) / 100;
                    purchPrepayTable.Currency           = 'IDR';
                    //purchPrepayTable.PrepayCategoryId   = EcoResCategory::findByName(cells.item(_row_prep, 9).value().bStr(), 5637144576).RecId;
                    purchPrepayTable.PrepayCategoryId   = EcoResCategory::findByName(cells.item(_row_prep, 9).value().bStr(), 5637144576).RecId;
                    purchPrepayTable.insert();
                }

            info(strfmt("Inserted %1 rows",counter));
            application.quit();
        }
    }
    catch(Exception::Error)
    {
        info('Journal Upload Error');
        application.quit();
    }
}


Above is the source code of a job to Uploading Purchase Order.

Since SID is a method from PurchLine, Im a lil bit confuse how to add the code in the JOB.

Im using this code to insert po line

//Create PO Lines
            row++;
            type = cells.item(row, 1).value().variantType();

            ttsBegin;
            while (type != COMVariantType::VT_EMPTY)
            {
                counter++;
                inventSiteId                    = cells.item(row, 17).value().bStr();
                inventLocationId                = cells.item(row, 18).value().bStr();
                inventDim.InventSiteId          = inventSiteId;
                inventDim.InventLocationId      = inventLocationId;

                purchLine.clear();
                purchLine.initValue();
                purchLine.initFromPurchTable(purchTable);
                purchLine.initFromInventTable(InventTable::find(cells.item(row, 10).value().bStr()));


                axPurchLine = AxPurchLine::newPurchLine(purchLine);
                axpurchLine.parmItemId(cells.item(row, 10).value().bStr());
                axpurchLine.parmInventDimId(InventDim::findOrCreate(inventDim).inventDimId);
                axPurchLine.parmPurchQty(cells.item(row, 12).value().double());
                axPurchLine.parmPurchPrice(cells.item(row, 13).value().double());
                axPurchLine.parmDescription(cells.item(row, 11).value().bStr());
                axPurchLine.parmLinePercent(cells.item(row, 14).value().double());
                axPurchLine.parmTaxItemGroup(cells.item(row, 19).value().bStr());
                axPurchLine.parmTaxGroup(cells.item(row, 20).value().bStr());
                axPurchLine.parmInventLocationId(cells.item(row, 21).value().bStr());
                axPurchLine.parmRequester(HcmWorker::userId2Worker(cells.item(row, 22).value().bStr()));
                //purchline.ARPTaskWBSId() = ARPTasks::findByActivityNumber(cells.item(row, 31).value().bStr()).TaskId_Wbs;

ARPTaskWBSId is not exist in the class AxPurchLine, so Im adding new method but got some error. I think the error show up because ARPTaskWBSId is a method not an actual field.

Can anybody give some advice how to insert to a field where the field is not an actual field but a method ?
Your help mean a lot to me :)

Best Regards,
Enggar

Using OR in QueryBuildRange value

$
0
0

Hi 

I have made q query and I want to use OR in the querybuildRange value. I need to use OR instead of AND. 

The Querystring:

SELECT * FROM NCEmailMatrixTmp(NCEmailMatrixTmp_1) WHERE ((JobCode = '')) AND ((ItemId = N'FV47001-00'))

 while select documentTypeEmailMatrix
        order by Priority
        where   documentTypeEmailMatrix.DocumentType == _docType&&      documentTypeEmailMatrix.IsDefault    == false
    {
        query = new Query();
        qbd = query.addDataSource(TableNum(NCEmailMatrixTmp));


        qbr = qbd.addRange(FieldNum(NCEmailMatrixTmp, JobCode));
        qbr.value(queryValue(documentTypeEmailMatrix.JobCode));

        qbr = qbd.addRange(FieldNum(NCEmailMatrixTmp, ItemId));
        qbr.value(queryValue(documentTypeEmailMatrix.ItemId));


        qr = new QueryRun(query);

        while (qr.next())
        {

           qr.setRecord(emailMatrixTmp);
           return documentTypeEmailMatrix;
        } 



Clear cache

$
0
0

Hello again,

As I have experienced myself, cache can cause some troubles, so I would like to ask you, what is the best way to clear it in AX 7? Thanks.

CU 11 Demo VM taking long time to boot

$
0
0

Hi all,

so we have downloaded the Dynamics AX 2012 CU 11 Demo VM from LCS and having Trouble with the booting.

it is taking exactly 1 HOUR. Has anyone an idea on how to fix this Problem? Is it trying to connect to some sort of Azure Services?

(btw. the VM HAS Internet Connection!)

thanks for the replies.

regards. Ruben

Viewing all 17532 articles
Browse latest View live


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