Skip to main content What is Dynamics 365? Guided tours Customer stories Try our products Build your own agents CRM ERP Sales Service Sales Customer Insights Customer Service Contact Center Field Service Supply Chain Management Commerce Finance Project Operations Human Resources Business Central Pricing Business application topics Training & certifications Documentation Migrate to the cloud Private equity Migrate to Dynamics 365 Events Dynamics 365 Blog Product updates Onboarding and implementation Community Find a partner Software Development Companies Partner resources Microsoft Marketplace Product documentation Technical support On-premises product support Contact us Try for free Sign in
1 min read

Research method on X++ forms


In AX2009 if you call the research() method on a form passing true, the cursor position within a grid should be retained.  However, this is true only if the query created by the form uses inner joins.  Any outer joins, aggregations, temp tables, etc. cause the cursor to go to either the first or last record (depending upon the StartPosition property for that data source).  In 2009 if you want to keep the cursor position and use joins other than inner joins you have to keep track of the cursor position.  Code like the following will do this:

int pos;

    super();

    pos = salesQuotationTable_ds.getPosition();
    salesQuotationTable_ds.research();
    salesQuotationTable_ds.setPosition(pos);

Get started with Dynamics 365

Drive more efficiency, reduce costs, and create a hyperconnected business that links people, data, and processes across your organization—enabling every team to quickly adapt and innovate.