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

Development Environment with VSTS (shared workspace environment)

$
0
0

Hi,

This message is just a confirmation if my understanding regarding the Development Environment with VSTS (shared work space environment) is correct or not.

Following is my understanding:

1. Development Environment will have one server having AOS, SQL Server and AX Client installed.
2. All Developers will use the same AX Client for development work space.
3. They will share the same VSTS work space.

4. They will create the model/project (I am not clear on this i.e. model or project).

5. They will then add the objects which needs to be customized in the model/project.
6. They will then make customization changes in those objects.

7. They will then check in those changes to VSTS.

Is my understanding correct?

Thanks,

Tauseef.


Create total tax trans report in SSMS

$
0
0

I am trying to create a total tax report for 2017 in AX 2012. How could I create this through SQL management studio?

 

Our company purchase raw materials in various parts of the world assembled locally and sell locally as well as internationally.

Things to consider,

  1. All the transaction In/Out associate various currencies
  2. Exchange rate need to apply for non-Local transactions
  3. Tax bracket will be varied by province to province and country to country.
  4.  4 Financial Dimensions (Customer/ Plant/ Resource/ Vendor)
  5. Sales Tax Codes 8 (A/B/C.....)
  6. Sales Tax Group 8 (1,2,3......)

 

Print Report to file and stream via AIF

$
0
0

Hey,

Iam having trouble with printing a report via AIF (http).

We use the following code (simple example):

        args = new Args(reportStr(SalesInvoice));
        args.record(custInvoiceJour);
        args.parmEnum(PrintCopyOriginal::Original);
        // need to say ReportRun not to change PrintJobSettings in fetch-method
        args.parm(settings);

        reportRun = new ReportRun(args);
        reportRun.report().interactive(false);
        reportRun.query().interactive(false);

        printJobSettings = new PrintJobSettings();
        printJobSettings.format(PrintFormat::PDF_EMBED_FONTS);
        printJobSettings.setTarget(PrintMedium::File);
        printJobSettings.warnIfFileExists(false);
        printJobSettings.suppressScalingMessage(true);
        printJobSettings.preferredFileFormat(PrintFormat::PDF_EMBED_FONTS);
        fileName = strfmt('\\\\Test-Server\\Transfer\\Test2.pdf');
        printJobSettings.fileName(fileName);

        reportRun.printJobSettings(printJobSettings.packPrintJobSettings());
        reportRun.init();
        reportRun.run();

        // send created PDF as byte stream
        // Grant clrinterop permission.
        new InteropPermission(InteropKind::ClrInterop).assert();
        //Load the file
        fi_pdfDoc = new System.IO.FileInfo(fileName);
        //Initiallize the byte array by setting the length of the file
        pdfDocBuffer= new System.Byte[int642int(fi_pdfDoc.get_Length())]();
        // Stream the file
        fs= new System.IO.FileStream(fi_pdfDoc.get_FullName(), System.IO.FileMode::Open, System.IO.FileAccess::Read);
        fs.Read(pdfDocBuffer, 0, pdfDocBuffer.get_Length());
        // Convert the file into a base64 string
        content = System.Convert::ToBase64String(pdfDocBuffer, 0, pdfDocBuffer.get_Length());
        //Revert the access
        CodeAccessPermission::revertAssert();
        return content;

We want to print old reports - this code works pretty well on AX 2009 - with old reports.

If Iam trying to print a SSRS-Report everything is fine. For some reson the old reposts wont work on 2012.

The following error is shoing up:

SoapFault exception: [s:Client] ClassFactory Objekt ist nicht initialisiert.

Stack-Trace

(S)\Classes\LedgerCache\getValue - line 3
(S)\Data Dictionary\Tables\Ledger\Methods\current - line 13
(S)\Data Dictionary\Tables\Currency\Methods\mstAmount - line 13
(S)\Classes\TaxInvoiceSpec\taxSpec - line 399
(S)\Reports\VendInvoiceSpec\Methods\fetch - line 33
(S)\Classes\ReportRun\Run
(S)\Jobs\

Are there any ideas? I tried different reports - I dont think the probem is the report itself.

If I run the code serverside (not via AIF) the report is printed without any problems.

Thank you very much.

Naming conventions for extension objects in Dynamics 365

$
0
0

Hi,

There are some rules to name a new object when we need to develop or customize for a company.  As we know the concept of extension has been introduced in Dynamics 365 version, I would like to know what the naming conventions should be for an extension?

For e.g. If we need to create an extension of CustTable, it creates the object as CustTable.Extension by default. But this is a new object in AOT that will be created in VAR later or any specific layer. If I have created this extension object for company XXX, should we name it as CustTable.XXXExtension? Or any other convention is already there? 

Thanks in advance.

Value was either too large or too small for an Int32, AIF.

$
0
0

Hi, i made a node.js application which communicates with AX through AIF(http service hosted on iis). The application is clocking in and out workers, and also starts and stops jobs. I am using the buildt-in jmgshopfloorservice for this. 

My problem is, when i try to send a 'clock-out' request to the server, i get in response 'Value was either too large or too small for an Int32', and this message isn't telling me much about the problem. Is it the request that is too large/small or is it the response? 

This is the XMLbody i am sending: 

<s:Envelope xmlns:s="schemas.xmlsoap.org/.../envelope"><s:Header><h:CallContext xmlns:h="schemas.microsoft.com/.../datacontracts" xmlns:i="www.w3.org/.../XMLSchema-instance"><h:Company>INT</h:Company><h:Language i:nil="true"/><h:LogonAsUser i:nil="true"/><h:MessageId i:nil="true"/><h:PartitionKey i:nil="true"/><h:PropertyBag i:nil="true" xmlns:a="schemas.microsoft.com/.../Arrays"/></h:CallContext></s:Header><s:Body><ShopFloorServiceClockOutRequest xmlns="schemas.microsoft.com/.../routing"><_clockOutData xmlns:a="schemas.datacontract.org/.../Dynamics.Ax.Application" xmlns:i="www.w3.org/.../XMLSchema-instance"><a:AbsenceCodeId i:nil="true"/><a:ClientDateTime>0001-01-01T00:00:00</a:ClientDateTime><a:Login>000005</a:Login></_clockOutData></ShopFloorServiceClockOutRequest></s:Body></s:Envelope>

The request-headers looks like this: 

'Content-Type': 'text/xml; charset=utf-8','Authorization': 'Basic ' + new Buffer('domain\\user:pass').toString('base64'),'SOAPAction': 'schemas.microsoft.com/.../clockOut'


In AIF history in AX i can see that jmgShopFloorService.clockout got called, and the AIF exception log shows nothing. 
I do not know if this error comes from AX or IIS. I would appreciated some help on this.

EDIT: I did some more testing and found out that this error appears when i have started a job and then tries to clock out, so it is an AX error as of my understanding. Either way this error still does not make any sense.

Count number of letters in string var?

$
0
0

How can I count the numbers of digits in string var?

For example if the number of digits is more than 14 digits it will throw an error?

Read XML through X++ (Unable to cast object of type)

$
0
0

Hi All,

I got this XML format to read into AX and following is the code I wrote to read it but it is failing when code runs in CIL.

XML to read

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>

<ns2:return xmlns:ns2='URL'>

    <status>1 to 1 of 1    </status>

    <ns2:messageresponses>

        <ns2:response>

            <from>

                <email></email>

                <mobile>61417387807</mobile>

                <mri>61417387807</mri>

                <name>61417387807</name>

                <voice></voice>

            </from>

            <responseCategory>notmatched</responseCategory>

            <responseMessage channel='SMS'>

                <acknowledged>21/02/17 10:38</acknowledged>

                <content>Y</content>

            </responseMessage>

        </ns2:response>

    </ns2:messageresponses>

</ns2:return>

X++ Code

// Define XML Document and its nodes
XmlDocument doc;
XmlNodeList xmlScriptList;
XmlNodeList xmlMessageResponseList;
XmlNodeList xmlResponseList;
XmlNodeList xmlContentList;

XmlElement nodeScript;
XmlElement nodeMessageResponses;
XmlElement nodeResponse;
XmlElement nodecontent;

XMLParseError xmlError;

// Define temporary variables
int i, j, k, l;

// Create the XML Document
doc = new XmlDocument();
doc.loadXml(_xmlMsg);

// Verify XML Document Structure
xmlError = doc.parseError();
if(xmlError && xmlError.errorCode() != 0)
{
      throw error(strFmt("XML Error: %1", xmlError.reason()));
}


// Get the root element and its child nodes
nodeScript = doc.getNamedElement("ns2:return");
xmlScriptList = nodeScript.childNodes();

for(i=0; i < xmlScriptList.length(); i++)
{
       nodeMessageResponses = xmlScriptList.item(i);
      xmlMessageResponseList = nodeMessageResponses.childNodes();

for (j=0; j < xmlMessageResponseList.length(); j++)
{
    nodeResponse = xmlMessageResponseList.item(j);
    xmlContentList = nodeResponse.childNodes();

    for (k=0; k < xmlContentList.length(); k++)
    {
       nodecontent = xmlContentList.item(k);

if (nodecontent.selectSingleNode("mobile"))
        mobile = nodecontent.selectSingleNode("mobile").text();

if (nodecontent.selectSingleNode("acknowledged"))
        acknowledgedTime = nodecontent.selectSingleNode("acknowledged").text();

if (nodecontent.selectSingleNode("content"))
       content = nodecontent.selectSingleNode("content").text();

   }

}

        }

The code fails at red highlighted line when executes in CIL with following error message.

System.InvalidCastException: Unable to cast object of type 'Dynamics.Ax.Application.XmlText' to type 'Dynamics.Ax.Application.XmlElement'

 

 

Debugging extended form

$
0
0

Dear all, 

In D365 , I have extended a salesform.  Now i want to debug the form right from the beginning. I want to see the flow of the form while in debug mode and step over every line of code.

 Is there a way to debug the Microsoft standard code while extending a form. 

I have check in Overlaying and it is working. But i am looking for in extension . 

Please help 

Thanks 


Import customer addresses

$
0
0

Hi,

If I would like to import customer addresses, which data entity I should use in AX 7?

Thanks,

Run Base Batch call c#

$
0
0

hi,

i  have a class that  calls  c# class.  i have  dll reference in ax .   it  shows error  and  is not completing successfully;

Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.
   at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 42
   at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13
   at BatchRun::runJobStatic(Object[] )
   at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
   at BatchIL.taskThreadEntry(Object threadArg)

do you know  if it is possible to call  c#  code from  run base batch class ?  it works  if i don't call that method.

c#  method is ok too. it works without run base batch.

X++ select group by date

$
0
0

Hi,

It seems a stupid question but I tried multiple combination and failed.

In table A, I have thousands of records and I want to get all the different dates in this record.

In SQL, I know I can do it simply by

select date from TableA group by date

But now for X++ in AX

I tried

while select   A group by A.Date
{

}

without success. In MS doc, the examples are for number or counting no dates. I don't quite understand how to achieve my requirement.  Any help is grateful! Thanks!

Error consume webservices AX 2009 from VisualStudio 2008

$
0
0

Hello!

I have the following exception (attached image), the user is AX administrator. It will have to configure the App.Config ?.

AX 2009.

VS 2008.


Thanks for your support.

 

Count() in AOT query

$
0
0

Hi,

Could you help me to get the count of the Custom tables created in AOT ?

Is there any query available ?

Thanks,

Karthick.M

How to find customized code in AOT??

$
0
0

what is best way to find the code customized?

I have to modify code on Retrunorder process(Sales Order-Pick and pack- packing slip journal)

then, When user cancel the order from the form, there is some of code that insert record into customized table A. 

but I have no idea where is code to insert record into Table A. 

I tried to find code from Cancel button. It seem that calling to SalesFormLetter Class.

So, I want to know if there is any way to find the customized code.

maybe Cross-Reference is useful for this situation?

SQL to AX query

$
0
0

Hi all,

i want to create the following SQL query in AX as a query!

Have anybody a idea how to do this? I tried a lot but i didn't get it.

SELECT *

  FROM (  SELECT DH.[RECID]                                     AS RECID_DIMENSIONHIERARCHY

                          ,DH.[NAME]                            AS NAME__DIMENSIONHIERARCHY

                          ,DH.[DESCRIPTION]                     AS DESC__DIMENSIONHIERARCHY

                          ,DH.[PARTITION]                       AS PARTITION_DIMENSIONHIERARCHY

                          ,DL.[DIMENSIONATTRIBUTE]               AS RECID_DIMENSIONATTRIBUTE

                          ,DA.[NAME]                            AS NAME_DIMENSIONATTRIBUTE

--                        ,DA.[REPORTCOLUMNNAME]

                          ,DN.[RECID]                           AS RECID_DIMENSIONCONSTRAINTNODE

--                        ,DN.[DIMENSIONHIERARCHYLEVEL] AS DL0

--                        ,DNC.[WILDCARDSTRING]                 AS W1

--                        ,DNC.[ORDINAL]                        AS O2

                          ,DNC.[RECID]                                 AS RECID_DIMENSIONCONSTRAINTNODECRITERIA

                          ,DNC.[RANGETO]                        AS #Owner

--                        ,DNC.[RANGEFROM]                      AS RANGEFROM

                          ,DNCR.[WILDCARDSTRING]                 AS #Agreement

                 FROM (SELECT *

                              FROM [dbo].[DIMENSIONHIERARCHY]

                              WHERE [STRUCTURETYPE] = 1    AND [NAME] LIKE 'AG-OW%'

                          )                                                                          AS DH

          INNER JOIN [dbo].[DIMENSIONHIERARCHYLEVEL]                         AS DL

                        ON DH.[RECID]       = DL.[DIMENSIONHIERARCHY]

                    AND DH.[PARTITION]      = DL.[PARTITION]

          INNER JOIN [dbo].[DIMENSIONATTRIBUTE]                              AS DA

                        ON DL.[DIMENSIONATTRIBUTE]        = DA.[RECID]

                    AND DL.[PARTITION]                          = DA.[PARTITION]

          INNER JOIN [dbo].[DIMENSIONCONSTRAINTNODE]                         AS DN

                        ON DL.[RECID]                           = DN.[DIMENSIONHIERARCHYLEVEL]

                    AND DL.[PARTITION]                          = DN.[PARTITION]

          INNER JOIN [dbo].[DIMENSIONCONSTRAINTNODECRITERIA]           AS DNC

                        ON DN.[RECID]                           = DNC.[DIMENSIONCONSTRAINTNODE]

                    AND DN.[PARTITION]                          = DNC.[PARTITION]

          INNER JOIN [dbo].[DIMENSIONCONSTRAINTNODECRITERIA]           AS DNCR

                        ON DN.[PARENTCONSTRAINTNODE]      = DNCR.[DIMENSIONCONSTRAINTNODE]

                    AND DN.[PARTITION]                          = DNCR.[PARTITION]

                    ) as sub  

Application SID does not match Conductor SID..

$
0
0

Following Warning occur when i am running the AX Steup as an a Administrator...i am trying to install AOS

To open and edit existing SSRS report using Power BI

$
0
0

Hi,

We have upgraded from AX 2012 to AX 7. We have some existing RDP SSRS report in Ax 7 which we want to open or modify using Power BI . How do we achieve it..

Regards,

Sourav

displaying multiple fields from multiple table in the form

$
0
0

hi,

 consider this scenario if i m having 5 tables ..and m adding all these as datasource to a form.

selecting one field from each table under the design/grid in the form

in the grid properties there will be datasource property ...here we can select only one table among 5

how can i include all the 5 in that..

bcz each fields are taken from each field 

how to resolve this

How to call a method in a method

$
0
0

Hi,

I'm doing a calculation of withholding tax. I placed the withholding tax computation in a separate method like this:

display real disptax()
{
return CustTrans.AmountMST * 0.02;
}

Then I want to call this method in  a new method, calculating for

total amount = CustTrans.AmountMST  - (answer in disptax).

Please help me find a basic solutions for this 

Thank you.

Managing Multiple System Integrator

$
0
0

Dear Expert,

We have 3 AX vendors to roll out AX 2012 R3 in parallel on 3 separate tracks. What is the best practice to manage code deployment/synchronization between these 3 vendors and at the same time how do we ensure the changes made by one vendor doesn't impact the changes made by another vendor? Currently we have one UAT evironment, one staging and one production.

Thanks and Regards,

DKGarden 

Viewing all 17532 articles
Browse latest View live


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