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

QueryRun.next() taking too long to be completed

$
0
0

Hello,

Yesterday , i build batch that export data to excel using query with x++(the query is based on TaxTrans and TaxTrans_In  tables).It worked fine i can export 60000 line on 10minute.

Today, i run the export and ax client freeze and take a long time. when i debug the system blo on the ling QueryRun.next() 

I do not why QueryRun.next()  take too long to be completed.

Any regard in this point.

Thank you in advance


Adding two datasources for different tables to same query object for a SysQueryForm

$
0
0

Hi

A sysQueryForm is not filtering by a field correctly. This field is from a different table that has been joined after modifying the sysquery.

How to add two different tables as a data source of a query object and filter by the field of the joined table on a sys query form?

Services: Authenticating a native client app

$
0
0

I have registered an app in Azure

Below is the code and specified the configurations

Below is the code for main operation been performed

But when I am testing the connection it is giving the below error

Please suggest

Consuming web service in d365

$
0
0

I have written the c# code to consume web service using OAuth2 . The code is taken from the d365 cookbook (authenticating native client app pg 380).

Instead of console app to call the getauthentictaionheader() function, i am trying to call it in x++, which is throwing the error that this method is not found on the namespace.classname.

Code:

public static void main (Args _args)

{

 namespace.classname authobj = new

 namespace.classname();

 authobj.GetAuthenticationHeader(); - (this line shows error)

}

Service error on DocuActionArchive.add()

$
0
0
Hello everyone,
I have a working code in AX but when invoked through a service from outside it throws an exception.
I am using DocuActionArchive class in my code for file attachment.
I have following lines of code that refer to this class.
DocuActionArchive archive;
archive = new DocuActionArchive();
archive.add(docuRef, filePath);
The service throw following exception:
System.ServiceModel.FaultException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.InvalidRemoteCallException' was thrown.
It errors out on line: archive.add(docuRef, filePath);
Looks like it cannot call the add method in the DocuActionArchive class. I changed the property of this class from Run on Client to Run on Server but still get this error.

SSRS Report: The Loading Time is Too Long and Then It Shows an Error Lost Connection

$
0
0

Hello awesome community! :)

I'm still a newbie in AX so please bear with me explaining haha.

I've created a report that shows the expired items.

My query is :

InventTrans > InventDim > InventBatch

So, I want to check all the transaction of the items to look for expired items that is still remaining.

The data is big so it takes a long time in Loading screen and then it gives me an error saying that "connection is lost"

But If I used a filter like for example: item number, it will work fine. So my problem is when I want to get all the data.

I used a query Object in AOT with a DP Class.

Here is my prcoessReport method code:

 qr = new QueryRun(query);

    while(qr.next()){
        invTrans    = qr.get(tableNum(InventTrans));
        InvDim      = qr.get(tableNum(InventDim));
        InvBatch    = qr.get(tableNum(InventBatch));

        if(InvBatch.expDate < today() || InvBatch.expDate - InventTable::find(invTrans.ItemId).NearExpiry < today()){
                reportLine.ItemId           = invTrans.ItemId;
                reportLine.ItemName         = invTrans.itemName();
                reportLine.Qty              = invTrans.Qty;
                reportLine.inventBatchId    = InvDim.inventBatchId;
                reportLine.InventLocationId = InvDim.InventLocationId;
                reportLine.expDate          = InvBatch.expDate;
                reportLine.insert();
        }
}

Please, if you can advice it would be appreciated :)

Maybe using a select and a while select is faster and better than using a "query object"?

NOTE*: I check if the items still remaining or not in the design. If the Sum of quantity in the batch id is "0 Zero" that means no items are remaining so I will hide the records from the table. Maybe there is a better work around? since it will fetch un-needed data.

Thanks in advance!

legal entity, timezones

$
0
0

I have single AOS.

One Legal entity is running with one time zone. When I create another legal entity and set time zone for it which is different from existing LE then system throws following message

"The company time zone can only be changed by an administrator who is connected to a single Application Object Server (AOS) instance. No other client connections or AOS instances can be running."

Can anyone suggest how can I define two different time zones for two LEs in single AOS.

regards

How post data in web service


How to retrieve system date (CreatedDateTime) in API?

$
0
0

How retrieve the System date in API?

I had enable the created Date time

but there is no field name as created date time

my query, did we need to create a custom field for it?

while select TAXITEMGROUP
from  purchLine
join OrderStatus, CreatedDateTime, ValidatedDateTime from inventQualityOrdeTable
where inventQualityOrdeTable.ItemId == purchLine.ItemId

{

//retrieve

CMSReturnContainer    returnContainer = new CMSReturnContainer();;

returnContainer.CreatedDateTime(inventQualityOrdeTable.CreatedDateTime); //hit undefined

}

Wrong argument types in variable assignment.

$
0
0

Hi...

I am getting error 'wrong argument types in variable assignment' in main method of a controller class.

Need your help.

Thanks.

Data entity Ranges node does nothing in D365

$
0
0

Hi;

Testing the Range functionality provided on Data Entities in D365

Scenario: I'm trying to apply a date range to my custom data entity in order to export only the records that were modified yesterday. This will be a recurring export job to daily export only modified records.

Problem: There is a Ranges property that is on Entity level where you can apply ranges to fields in your data entity but seems like it is not working as even a numeric field value range added on it does not filter the results. I am aware of filters available on a functional level as well as ranges available on the datasource level but I want to test out the Ranges on the data entity itself. I also do not see the range applied on SQL level when I see the script of the view for the entity; however they are visible ranges applied on a datasource level.

Question: What is this Ranges node for if not for applying a range to the resultant data set?

Branching in VSTS

$
0
0

So, we are trying to set up VSTS for our development team, and watching the recent tech conference videos, it suggests using branches.... A Development branch, a Main Branch (essentially your QA) and a Release Branch.  After many internal discussions we are still at a loss as to what is the best way to use Branching within our team. So my question to the community is... "How are you using Branching with VSTS within your D365 for Ops projects and why have you chosen to implement in this way?"

Unidentifiable substring 'iif' in expression. The parser reported error message: Unrecognized identifier

$
0
0

Hi Community, 

does anybody ever faced this error: 

Severity Code Description Project File Line Suppression State
Error Path: [AxReport/ABCFreeTextInvoice1/Designs/Report/Expression]:Report: Unidentifiable substring 'iif' in expression. The parser reported error message: Unrecognized identifier. Report_experiment (CUS) [ABC_ApplicationSuiteExtension] C:\AOSService\PackagesLocalDirectory\ABC_ApplicationSuiteExtension\ABC_ApplicationSuiteExtension\AxReportABCFreeTextInvoice1.xml 0

 

I have added a new textBox and put in this expression: =First(Fields!ABCPeriodOfPerformance.Value, "FreeTextInvoiceDS")

 

Any recommendations on how to solve this error ?

Difference between Model store deployment and XPO deployment

$
0
0

Hi All,

Please explain the difference between Model store deployment and XPO deployment technically,

Regards,

Akbar

Calling an AX AIF/Web Service using the url

$
0
0

So I have created an AIF/Web service in AX 2009 called QRCode, and if i try to call it from C# it works.

Now in the service i have a method called getVersion, and i would like to be able to call it directly using an URL in a browser instead of using the c# program, but I can seem to figure out what the url is supposed to be.

The Url for the service is http://localhost/MicrosoftDynamicsAXAif50/qrcode.svc

This article about calling a webservice directly from an url (Not AX) did not seem to work (link)

I tried with http://localhost/MicrosoftDynamicsAXAif50/qrcode/getVersion and also http://localhost/MicrosoftDynamicsAXAif50/qrcode.svc/getVersion

Does anyone have any tips?


How to include a double quote in XML using .setattribute?

$
0
0

I'm trying to use the setattribute function to create a "noNamespaceschemalocation" attribute in an XML document but can't figure out the syntax for a get a double quote rather than it being converted to '&quote;', below is the code I am using; does anyone one what I should be doing?

{

XmlDocument xmlDoc;

XmlElement  xmlTransaction;

;

xmlDoc = XmlDocument::newBlank();
xmlTransaction = xmlDoc.createElement('transaction');
xmlTransaction.setAttribute('xmlns:xsi', 'www.w3.org/.../XMLSchema-instance" xsi:noNamespaceSchemaLocation="import_spec.xsd');

The following is created from the above code:


<transaction xmlns:xsi="www.w3.org/.../XMLSchema-instance&amp;quot; xsi:noNamespaceSchemaLocation=&quot;import_spec.xsd">

I want to create the following:


<transaction xmlns:xsi="www.w3.org/.../XMLSchema-instance" xsi:noNamespaceSchemaLocation="import_spec.xsd">

How to fetch records between two date fields in X++ query on refereceFieldLookup?

$
0
0

Hi All,

I'm facing difficulty while fetching records between two utcdatetime fields by using X++ query on refereceFieldLookup.

I've querying a View which has the ValidFrom and ValidTo fields.

the data source for the view is HcmPositionWorkerAssignment table and the View has ValidtimeStateProperty set to NO.

I'm aware of the below solution, to fetch from ValidtimeStateTable , but in my scenario I've wanted it ValidtimeStateProperty as NO.

 query.validTimeStateDateTimeRange(rangeStart, rangeEnd);

Below expression I've tried  but its not filtering based on the query value .I can see the ranges has been added to the query using query.Tostring() method, but it not shows any records in the refereceFieldLookup , not between the given date range

 utcDateTime             rangeStart, rangeEnd;
 date                    startDate, endDate;
 TimeOfDay               startTime, endTime;
 QueryBuildDataSource    qbdsHcmPositionWorkerAssignment;
 QueryBuildRange         qbrWorker,qbrPosition;
   
 // set range variables
  startDate   = 07\01\2018;       // day\month\year
  endDate     =30\06\2019;       // day\month\year

  startTime   = str2time('12:00:00 am');     //GMT, NOT user time zone - this is how stored in the table
  endTime     = str2time('12:00:00 am');     //GMT, NOT user time zone - this is how stored in the table

  rangeStart = DateTimeUtil::newDateTime(startDate,startTime);
  rangeEnd   = DateTimeUtil::newDateTime(endDate,endTime);

  qbdsHcmPositionWorkerAssignment          = query.addDataSource(tableNum(HcmPositionWorkerAssignmentView));
  qbrPosition = qbdsHcmPositionWorkerAssignment.addRange(fieldNum(HcmPositionWorkerAssignmentView, DataAreaId));

  qbrPosition.value(strFmt('(( %1.%2 >= "%3") && (%1.%4 <= "%5"))',
            qbdsHcmPositionWorkerAssignment.name(),
            fieldStr(HcmPositionWorkerAssignmentView, ValidFrom),datetime2Str(rangeStart),
            fieldStr(HcmPositionWorkerAssignmentView, ValidTo),datetime2Str(rangeEnd)));

//below is the sql querystring generated

SELECT * FROM HcmPositionWorkerAssignmentView(HcmPositionWorkerAssignmentView_1)
WHERE (((( HcmPositionWorkerAssignmentView_1.ValidFrom>= "7/1/2018 12:00:00 am") && (HcmPositionWorkerAssignmentView_1.ValidTo <= "6/30/2019 12:00:00 am"))))
AND ((Worker = 68719484600)) AND ((Position = 68719480329))

Cache clear

$
0
0

Hi Experts,

I am using this code for looping (inheritance), once the condition loops and fetch the value it should be clear the cache However its not clearing it in table 2, please check and give me an idea in how to clear the table2 cache, thanks in advance.

table  table1,table2;

select * from table1

where table1.field1== "001";
do
{
    if (table1)
   {
       info(strFmt("%1",table1.field1));
   }

   select * from table2
   where table2.field2== table1.field1;

   table1.clear();
   if (table2)
  {
     table1= table2;
  }

  } while (table1);
}

How to get folder path when select file by FileUpload control

$
0
0

Hello,

Is it possible to get the path of the folder from where the file is being selected from fileUpload control?

I want to access the folder whenever a file is selected from file upload. Can anyone please guide me on this.

Thanks.

Document Routing Agent Versions list

$
0
0

Hi,

I am new here and new to Dynamics. Is there a way to get the list of all the version of DRA. 

Help will be greatly appreciated.

Thanks and Regards,

Tushar

Viewing all 17532 articles
Browse latest View live


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