Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the .toString() varient in X++ or Dynamics AX?

Is there something similar to the famous toString() method of C# in Axapta?

I try to run underlying code:

info(this.dataSource());

But it gives me this error message: "Argument 'txt' is incompatible with the required type."

like image 535
Tassisto Avatar asked Mar 07 '12 13:03

Tassisto


1 Answers

The toString is available on all objects but usually not of much value:

info(this.dataSource().toString())

This gives this output:

Class FormDataSource Address

Probably you knew that already! However the query datasource does give something useful:

FormDataSource fds = this.dataSource();
;
info(fds.query().dataSourceTable(tableNum(Address)).toString());

gives the corresponding SQL query:

SELECT FIRSTFAST * FROM Address
like image 90
Jan B. Kjeldsen Avatar answered Oct 07 '22 07:10

Jan B. Kjeldsen