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

Unable to connect to TFS by X++ code

$
0
0

Hi ALL,

I’m trying to connect to TFS from AX.

The code that I try to use is the following:

 

but on the #22 row I’ve got this error

Then I tried to replicate the code in Visual Studio

Error that I’ve got here is the following:

Exception:Thrown: "Server was unable to process request. ---> TF400367: The request could not be performed due to a host type mismatch. Please check any connection information and verify the information is correct. The request was executed against a Deployment, Application." (Microsoft.TeamFoundation.Framework.Client.TeamFoundationServiceException)

A Microsoft.TeamFoundation.Framework.Client.TeamFoundationServiceException was thrown: "Server was unable to process request. ---> TF400367: The request could not be performed due to a host type mismatch. Please check any connection information and verify the information is correct. The request was executed against a Deployment, Application."

Time: 1/26/2017 9:55:50 PM

Thread:<No Name>[3432]

any help is appreciated


Table extension in AX 2012

$
0
0

Dear All,

I have a doubt in extending a table from Standard table (HcmWorker). Earlier, I had added new fields in Hcmworker table. But now, I want to move the customizations to a new customized table. For table inheritance, SupportInheritance property should be set to Yes. But Hcmworker table doesn't have it. I referred the link http://daxonline.org/9-table-extension-framework.html. But it also requires a delete action to be created in standard table & I don't need it. Is there anyother way to extend a new table from Hcmworker?

Thanks in advance!!

Asterisk showing when adding a custom report -- how to remove?

$
0
0

AX 2012 r3 automatically adds *To Report Name* -- is there anyway we can remove this? Why is this here? I googled and couldn't find an answer unfortunately.

Show data in Inquiry screen from External database (table or view)

$
0
0

Requirement –

I want to display the data in AX inquiry screen from External database (table or view).

 

Available Option -

There is a way to do this by using ODBC Connection (How to: Connect to an External Database from X++ Code [AX 2012]). In this approach we are executing a SQL statement to get the ResultSet & then we are looping the ResultSet to fill the data in TmpTable to show on the inquiry screen.

It is expected to get the 300,000 records populated every day in the External Database table. Let’s imagine over a period of time, Looping through the ResultSet will be expensive task to fill the data in TmpTable to show a simple enquiry screen.

 

Question –

Is there any way (Other than OdbcConnection) to show data on Inquiry screen in AX.

ADDING user in work flow Approval

$
0
0

Dear

is there any short way to add a user in all work Flow approvals in all levels?

Regards

How to debug Connector for AX by Microsoft ?

$
0
0

We are using the Connector for AX for the CRM integration . Issue is that we are not able to debug  code .  I have tried writing jobs but its not that much useful . I want to have real time debugging .

select where something equals to (If null then All)

$
0
0

Hi,

I am building a simple "while select" query which filters on an optional field, if the optional field is not set then the filter should be bypassed.

Is there a way to do this in x++,

If i should go with query builder than just mention that.

How to create row number in Grid Form?

$
0
0

Hi all..

i have custom form with filter by date and group like this picture.

i want to add one new column for line number or row number in the left column Reksadana.

So, this result like this.

And this is if i filter from date 1/17/2017.

and, i want result like this picture below.

Can i do it?

Please help me explain more for this case.

Thanks master.


Tool of Crash dumps analysis doesn't analysis properly

$
0
0

We have problem in making analysis of AX crash dumps.
The tool of analysis doesn't run propertly since 28,Dec 2016.

It seems that the tool runs well when I upload the crash dumps,
but the tool doesn't work property when I try to analysis them.

I deleted the old records (about 200 datas), because I thought
this was the reason why tool won't work.

We would like to analysis more about 100 dumps as soon as possible,
 so let me know some information to solve this problem.
 
Regards,
falph_sequri

Disable a field based on second field value in AX 2012 R3.

$
0
0

Hi all,

I have a scenario where I have to disable a field if the second field value is yes.

I have two fields created in InventTabble table i.e.

- String type (Manufactur ID)

- Enum type (MID per batch)

The default value for "MID per batch" is No.

I have to show this fields in the "EcoResProductDetailsEntended" form based on a condition i.e.

- if "MID per batch" = Yes then disable "Manufactur ID) and,

- if "InventItemSetupSupplyType.DefaultOrderType <> "Purchase Order" then disable "MID per batch" and "Manufactur ID" fields.

I am using the modified( ) method under the form method and code used is -

public void modified( )
{
   if(InventTable.MIDPerBatch == NoYes::Yes)
   {
     InventTable_ds.object(fieldnum(InventTable, ManufacturID)).allowEdit(false);
   }
   else
   {
     InventTable_ds.object(fieldnum(InventTable, ManufacturID)).allowEdit(true);
   }

   if(InventItemSetupSupplyType.DefaultOrderType <> "Purchase Order")
   {
     InventTable_ds.object(fieldnum(InventTable, MIDPerBatch)).allowEdit(false);
     InventTable_ds.object(fieldnum(InventTable, ManufacturId)).allowEdit(false);
   }
   else
   {
     InventTable_ds.object(fieldnum(InventTable, MIDPerBatch)).allowEdit(true);
     InventTable_ds.object(fieldnum(InventTable, ManufacturId)).allowEdit(true);
   }
}


But I am still not able to perform the requirement - am I doing wrong or should I not be using the modified( ) method or am I calling the method under wrong form level. I tried to create the method under the data source of InventTable method but still no result.

How can I disable the fields based on the other field conditions?

Technical conference 2017

$
0
0

Is there any information when the TechCon 2017 in Seattle will be?

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.

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 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

New to Dynamics 365 - can't find stuffs

$
0
0

Hi, I am new to Dynamics. My company wants me to build integration between Dynamics and our own system. So I just installed Microsoft Dynamics 365 trial version. I have installed it for a couple of days now but still being unable to figure out. The current screen looks like below: 

enter image description here

I can't find those ... things which should appear here - something like leads, contacts, accounts, opportunities, or create new record types here. Where is everything...


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;
        } 



how to get enum name from enum value????????

$
0
0

hai all i need one help.i have a data in excel sheet in that sheet one feild is gender.

but it storing data like 0,1  which means 

0=male

1=female

so i want to import that in my table so i need to convert that 0 as male and i need to store in table.how to pass that enum value and how to get enum name pls help me

thanks in advance............

Using wildcards in queryvalue

$
0
0

Hi all

I have made a query and I want to pass some wildcards as '*' and '?' in the queryvalue. But when I use one of these wildcards and prompt the QueryRun, I can see that a backslash is being added to the queryvalue, why?

Here is an example for ItemIdMatrix value:

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, PostalCode));
        qbr.value(queryValue(documentTypeEmailMatrix.PostalCode));

        qbr = qbd.addRange(FieldNum(NCEmailMatrixTmp, PostalCode));
        qbr.value(queryValue(''));

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

        qbr = qbd.addRange(FieldNum(NCEmailMatrixTmp, Id));
        qbr.value(queryValue(''));

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

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

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

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

        qr = new QueryRun(query);
        qr.prompt();

        while (qr.next())
        {

           qr.setRecord(emailMatrixTmp);
           return documentTypeEmailMatrix;
        }

    }


SIT meaning in dynamics AX

$
0
0

Hi,

while I was reading some blogs and forums related to AX I found a phrase 'Deploying EP froms to SIT'.

Can anyone elaborate the SIT means pls.

Regards,
Rasool

New report page in fetch

$
0
0

I have a simple report (all customers) and want to print the customer details on each page. In my fetch method i have a while loop with queryRun.next() where I go through all customers. The result is one large report with many pages, but it ist one document.

Because I want to send each page by email to a different customer, I need an new and separate document for each customer, so I can mail the documents page by page. I don't mean "element.newPage()"!

Is this possible with AX 4? Otherwise I have to make a new class where I run the while command and call the report eacht time I get a new customer.

Thanks for help

Viewing all 17532 articles
Browse latest View live


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