Hi,
When importing CSV file by X++ code in Dynamics AX we may encounter a situation when we need to eliminate extra string from master data . That string may be in form of an extra comma or | or speech mark or any other symbol. To achieve this goal and clean maser data i have written a job. Good Luck
static void Job669(Args _args)
{
str _text,note,cleanText;
int charpos,s1,s2,i,more;
int x;
char RepChar = ',';
char RepCharWith = ' ';
str text(str text)
{
s1 = strFind(text,'"',1,strlen(text));
s2 = strFind(text,'"',s1,strlen(text));
for (i=s1;i<s2+4;i++)
{
charpos = strScan(text,',',s1,s2);
text = strpoke(text,' ',charpos);
s1 = strFind(text,'"',1,strlen(text));
s2 = strFind(text,'"',s1+1,strlen(text));
charpos = strScan(text,',',s1,s2);
if (charpos > s2)
{
break;
}
}
if (s1 || s2)
{
text = strdel(text,s1,1);
text = strdel(text,s2-1,1);
}
return text;
}
;
more = 1;
_text = 'AXT001,"House,42,ENF",Enfield,"U,K"';
while( more !=0)
{
_text = text(_text);
more = strFind(_Text,'"',1,strlen(_Text));
}
info(_text);
}
Saturday, 4 May 2013
Sunday, 24 February 2013
Dilip's blog on DYNAMICS AX: Dynamics AX Salary Report (Detailed Analysis from ...
Dilip's blog on DYNAMICS AX: Dynamics AX Salary Report (Detailed Analysis from ...: 1 - Introduction This global salary survey is the largest completed to date that focuses specifically on the Microsoft Dynamics communit...
Thursday, 3 January 2013
Creating a View in Dynamics AX
Hello Everyone,
In this blog i gonna show you how to create a simple view in Dynamics AX that consists of ItemID, Name, Sales ID, Customer Group and Customer Name using the following steps:
1. Right-click on the Views node and select New View. A new view will be created. You can open its properties by right-clicking and selecting Properties.
2. Change the name of the view to InventSalesCust and give it a label that describes the contents of the view.
3. The views can actually use queries that have already been created as a base for the data selection. This is done in the Properties of the view by choosing the query from the Query property. However, in our example, we will create the view from scratch.
4. Under the Metadata node, right-click on the Data Sources node and select New Data Source
5. Select the newly created data source and enter InventTable in the table property. The name of the data source will automatically change to InventTable_1, which is normal.
6. Under the InventTable data source, find the Data Sources node, right-click on it, and select New Data Source. This time, we want to use the SalesLine table so change the table property to SalesLine. Also change the relations property to Yes in order to get the link between the two tables active in the view.
7. Do the same to add the CustTable as a child data source to the SalesLine.
8. The next step is to define the fields that should be made available when this query is executed. Simply drag fields you need to use in the view from the InventTable_1,SalesLine_1, and CustTable_1 data source and drop them onto the Fields node.
9. You should now have a view that looks like the following screenshot:
1. Right-click on the Views node and select New View. A new view will be created. You can open its properties by right-clicking and selecting Properties.
2. Change the name of the view to InventSalesCust and give it a label that describes the contents of the view.
3. The views can actually use queries that have already been created as a base for the data selection. This is done in the Properties of the view by choosing the query from the Query property. However, in our example, we will create the view from scratch.
4. Under the Metadata node, right-click on the Data Sources node and select New Data Source
5. Select the newly created data source and enter InventTable in the table property. The name of the data source will automatically change to InventTable_1, which is normal.
6. Under the InventTable data source, find the Data Sources node, right-click on it, and select New Data Source. This time, we want to use the SalesLine table so change the table property to SalesLine. Also change the relations property to Yes in order to get the link between the two tables active in the view.
7. Do the same to add the CustTable as a child data source to the SalesLine.
8. The next step is to define the fields that should be made available when this query is executed. Simply drag fields you need to use in the view from the InventTable_1,SalesLine_1, and CustTable_1 data source and drop them onto the Fields node.
9. You should now have a view that looks like the following screenshot:
Subscribe to:
Posts (Atom)