Showing posts with label datasource. Show all posts
Showing posts with label datasource. Show all posts

Monday, March 6, 2023

How to open multiple Purchase orders in new browser tabs

static public void initFromPurchTable(FormDataSource _formDS)
{​
	PurchTable      currentPurchTable;
	Browser         browser = new Browser();
	for (currentPurchTable = _formDS.getFirst(true) ? _formDS.getFirst(true): _formDS.cursor();
	currentPurchTable;
	currentPurchTable= _formDS.getnext())
	{​
		var generator     = new Microsoft.Dynamics.AX.Framework.Utilities.UrlHelper.UrlGenerator();
		var currentHost   = new System.Uri(UrlUtility::getUrl());
		generator.HostUrl = currentHost.GetLeftPart(System.UriPartial::Authority);
		generator.Company = curext();
		generator.MenuItemName = 'PurchTableListPage';
		generator.Partition = getCurrentPartition();
		// repeat this segment for each datasource to filter
		var requestQueryParameterCollection = generator.RequestQueryParameterCollection;
		requestQueryParameterCollection.AddRequestQueryParameter(
																'PurchTable',
																'PurchId', currentPurchTable.PurchId
																);
		System.Uri fullURI = generator.GenerateFullUrl();
		browser.navigate(fullURI.AbsoluteUri, true);
	}​
}​

Friday, May 7, 2010

Vania Kashperuk's Tutorial: refresh, reread, research, executeQuery

First of all, I have to admit that this subject was a little vague for me. This is why I read with a huge interest this new Vania's tutorial about how to use efficiently and correctly these four data source methods.

In fact, it is always much easier to acquire new knowledge on real examples, and luckily this is the case! Not only explained he step-by-step the difference between the methods but also provided us with a ready-to-use project  for Dynamics AX 2009, which can help a lot to them who have just started working with the system.

So, I highly recommend his blog to every AX developer. 

To whom it may be useful, I adapted this xpo-project to Dynamics AX 4.0. 

Didn't get it right? Just reread() it and refresh() your knowledge!