I recently did find this usefull tip on how to use buffers from the old technet, and I did find it so usefull because sometimes there can be saved a lot of manual work using this tip, and it does also eliminate some confusion related to use of buffers.
zipCode buffer1;
zipCode buffer2;
Assigning by reference:
buffer1 = buffer2;
Buffer1 becomes a reference to buffer 2. Referencing buffer1 will have the exact same effect as referencing buffer2. The following example will print an X on the screen.:
buffer1 = buffer2;
buffer2.city = "X";
print buffer1.city;
pause;
Reinitializing with data:
buffer1 = buffer2.data();
Buffer1 is reinitialized to the initial state of the tablebuffer and all data are transferred from buffer2. The example below will insert a record in the zipCode table despite the fact that we start out by setting tmp on buffer1. Stateinformation as lockSelect, current company and a running select statement will be reset on the tablebuffer.
buffer1.setTmp();
select * from buffer2 where buffer2.zipCode == '4100'
buffer1 = buffer2.data();
buffer1.zipCode = "CopyOf" + buffer1.Zipcode;
buffer1.insert();buffer1.data(buffer2.data());
Transferring data only:
buffer1.data(buffer2.data())
All data are transferred from buffer2 to buffer1. The effect is exactly the same as setting all fields in buffer1 equal to all fields in buffer2. No state information changes on buffer1. To make the above example insert records into a temporary copy of the zipcode table we need to change the code from
buffer1 = buffer2.data() to
buffer1.date(buffer2.data())
Thursday, September 6, 2007
Thursday, August 16, 2007
Task Recorder Dynamics AX 4.01
Microsoft Business solutions Dynamics AX productivity team have released a cool tool to use related with Dynamics AX 4.01
It is called 'Task Recorder' and can record work inside Dynamics AX and paste the result with screen shots into a word ducument. That way the days of using snagit is over.
This is just a cool tool for documenting procedures and assisting writing specifications for Dynamics AX projects.
The tool can be downloaded from partnersource and is for use at own risk.
It is called 'Task Recorder' and can record work inside Dynamics AX and paste the result with screen shots into a word ducument. That way the days of using snagit is over.
This is just a cool tool for documenting procedures and assisting writing specifications for Dynamics AX projects.
The tool can be downloaded from partnersource and is for use at own risk.
Tuesday, August 14, 2007
AX blog the beginning
Hi and welcome to my Blog
Apparently you have some kind of interest in Dynamics AX and somehow did find my Blog.
The overall purpose of this blog is to post Dynamics AX related information. The information that I will post here have possible been posted elsewhere or somehow documented, but I want to create a common dashboard where any Dynamics AX interested person can look and possible learn from.
So this blog will not be limited to ‘new discoveries’ but also already know facts, where the person just introduced to Dynamics AX also should be able to find some helpful information.
So look in on a regurlar basis (before it is sold out)
FYI
I might not be able to resist the urge to once in a while post a Harley Davidson praising story.
Regards
Per Jakobsen
Apparently you have some kind of interest in Dynamics AX and somehow did find my Blog.
The overall purpose of this blog is to post Dynamics AX related information. The information that I will post here have possible been posted elsewhere or somehow documented, but I want to create a common dashboard where any Dynamics AX interested person can look and possible learn from.
So this blog will not be limited to ‘new discoveries’ but also already know facts, where the person just introduced to Dynamics AX also should be able to find some helpful information.
So look in on a regurlar basis (before it is sold out)
FYI
I might not be able to resist the urge to once in a while post a Harley Davidson praising story.
Regards
Per Jakobsen
Monday, August 13, 2007
Import and Export of elements to Dynamics AX
These are best practises that I have used when exporting and importing modificatyions across AX environments. They definetly will make things easyer
o Export with ID’S and later on, Import with ID’S
o Export with Label and later on, Import with Label
o Remember to click Appl. And Label, to show details
o Any time when you are unsure if your import would overwrite something or
not, then please use Compare Function in the Details view
o Export with ID’S and later on, Import with ID’S
o Export with Label and later on, Import with Label
o Remember to click Appl. And Label, to show details
o Any time when you are unsure if your import would overwrite something or
not, then please use Compare Function in the Details view
Build your own form query, Dynamics AX 4.01 forms
lately I have been doing alot of modifications related to queries on forms, and I have also been assisting some colleages and in short I want to share the some situations I have been facing and how to deal with them.
Modify a standard query on a form, adding a ranges.
This excersize is pretty straight forward and has been done serveral places in std Dynamics AX. One common place to look for the implementation is custTrans where it is possible to switch view on the form to view either closed or open transactions.
Here there are declared a varable on the form method classdeclaration called criteriaOpen

Modify a standard query on a form, adding a ranges.
This excersize is pretty straight forward and has been done serveral places in std Dynamics AX. One common place to look for the implementation is custTrans where it is possible to switch view on the form to view either closed or open transactions.
Here there are declared a varable on the form method classdeclaration called criteriaOpen

Next the method init and executeQuery method on the datasourse Custtrans have been overwritten with the following relevant code
Init after call to super();
criteriaOpen = this.query().dataSourceNo(1).addRange(fieldnum(CustTrans,Closed));
one common error I have seen made related to this piece of code here is the use of addDataSource() instead of dataSourceNo(), or DataSourceTable(). What would actually happen is that the table would be added as a second Datasource producing a result that could be unpredictable.
ExecuteQuery before call to super();
criteriaOpen.value('value as string');
As mentioned before this is all pretty straight forward and many Dynamics AX developers have seen this design many times.
But what if the situation suddenly became a little bit more complicated and we actually needed to clear already autocreated ranges or we had to actually Add a table related to the datasource already in the query.
Well here is my suggestion
I would create a new query and use instead of the already existing query. That would make me in control over what happend in the Query and the order of the related tables. The code would look like this
Before super(); in the dataSource init
public void init() // of the datasource
{
Query query;
;
query = new Query();
tablename_ds.autoQuery(false); // we do not want to have the original query build
// and we build our own
queryBuildRange.addDatasource(tablenum('tablename');
queryBuildRange.value(sysquery::value('ány value'));
tablename_ds.query(query);// we use our own query
}
Happy querying
PerBiker per_biker@hotmail.com
Subscribe to:
Posts (Atom)

