Tuesday, 11 August 2015
Friday, 24 July 2015
EP AX 2012: Using display method in dataSetLookup
Issue
dataSetLookup method uses sysDataSetLookup for is query purpose on EP front.
But when you compare with SysTableLookup it has a method addLookupMethod to add a display method if needed. So how to add a displaymethod is a big question ?
Resolution
Find below code to do it
void dataSetLookup(SysDataSetLookup sysDataSetLookup)
{
container recids;
str recidstr;
List list;
Query queryHcmPosition = new query();
list = new List(Types::String);
SysTableLookup s
list.addEnd(fieldStr(HcmPosition, PositionId));
// Add a display method from HcmPosition
list.addEnd(tablemethodstr(HcmPosition,description) + '**');
//Creating datasetlookup
sysDataSetLookup.parmHideSelectField(false);
sysDataSetLookup.parmAllowPaging(true);
sysDataSetLookup.parmLookupFields(list);
sysDataSetLookup.parmSelectField(fieldStr(HcmPosition, PositionId));
recid+=5215444646;
// creating query for all position recids queryHcmPosition.addDataSource(tableNum(HcmPosition)).addRange(fieldNum(HcmPosition,RecId)).value(con2Str(recids,","));
sysDataSetLookup.parmQuery(queryHcmPosition);
}
dataSetLookup method uses sysDataSetLookup for is query purpose on EP front.
But when you compare with SysTableLookup it has a method addLookupMethod to add a display method if needed. So how to add a displaymethod is a big question ?
Resolution
Find below code to do it
void dataSetLookup(SysDataSetLookup sysDataSetLookup)
{
container recids;
str recidstr;
List list;
Query queryHcmPosition = new query();
list = new List(Types::String);
SysTableLookup s
list.addEnd(fieldStr(HcmPosition, PositionId));
// Add a display method from HcmPosition
list.addEnd(tablemethodstr(HcmPosition,description) + '**');
//Creating datasetlookup
sysDataSetLookup.parmHideSelectField(false);
sysDataSetLookup.parmAllowPaging(true);
sysDataSetLookup.parmLookupFields(list);
sysDataSetLookup.parmSelectField(fieldStr(HcmPosition, PositionId));
recid+=5215444646;
// creating query for all position recids queryHcmPosition.addDataSource(tableNum(HcmPosition)).addRange(fieldNum(HcmPosition,RecId)).value(con2Str(recids,","));
sysDataSetLookup.parmQuery(queryHcmPosition);
}
Friday, 17 July 2015
AX2012 EP error : DataSource XXXX in DataSet XXXX has an unknown field XXXX
Cause of the issue: Change in table level field elements.(Adding a new field )
Resolution:
Any change happen at table or dataset level must be reflected to VS EP project. Best way to do is
Resolution:
Any change happen at table or dataset level must be reflected to VS EP project. Best way to do is
- Try to refresh caches in Development workspace go to
- Tools > Caches > Refresh dictionary
- Tools > Caches > Refresh data
- Tools > Caches > Refresh elements
- If it doesn't solve your problem try to close and reopen visual studio after you clear the caches.
- Final try close all window and restart AOS.
Monday, 13 July 2015
AX 2012 TFS issue - Unable to check in. (Label file)
I was facing an issue while check-in label file.
Cause of issue
- MS Product bug.
- TFS Multiple check out option is set to false(This issue won't arise when this option is true).
Reason
When multiple check out option is set to false. TFS will lock (first instance of lock) the object so that any other developer will not be able to check-out the same. And while checkin the object AX code(Only for label files) will lock the object (second instance of lock) and do the checkin. But two locks cannot be performed on same object so system will throw issue.
Resolution
I have debug the code and found that while check-in the
label object, SysLabelFile.allowLockDuringCheckIn() method returns true but it
must be implemented in the way SysTreeNode.allowLockDuringCheckIn() class
is implemented. We need to change allowLockDuringCheckIn method in SysLabelFile
class to return “false” instead of “true”. Please find screen shot below
Checklist for TFS object management - AX 2012
- While check-in the object make sure it is in the correct MODEL.
- All the object which are created or modified newly has to be add to version control.
- All the developers must do a synch (don’t perform a Force synch it take more time) every morning when they arrive office.
- Any EP development done with visual studio project must checked in properly.
- When a developer make use of label file, he/she has to check-in the same along with the object where they used the label file else it will have improper labels.
- I have seen people checking-out object for long time. Don’t check-out object for long time. Try to check-in an object ASAP after the development. If label file is used with the object then make sure it must be checked-in along with it.
- If an object is added to version controls and it is renamed/deleted at later stage. Then same has to be deleted from TFS. And a mail has to send to developer so that object conflict will not occur while renaming it. Avoid renaming after check-in to TFS.
- There must be a build server(Auto build configured). That will help developers to identify issue with build.
- If possible make use of tfs branching.
- Make sure multiple check-out option is false.
Friday, 10 July 2015
Enterprise Portal AX 2012: Unable to obtain exclusive access to the session cache
When i was opening newly developed enterprise portal page i was not able to render it for around 15-20 Mins and it was loading state. I haven't found any solution over internet. The error was
Resolution
Please write your comments :)
- Check your SQL database drive have enough space. Mine was just 2.2 GB.(Might be not true it was in my case).
- Restart Sql Server services.
Please write your comments :)
Thursday, 14 May 2015
Configuring and opening Visual Studio which has multiple standalone AOS instance on same server
Steps to open a Visual studio pointing to a specific AOS environment
1. Go to client configuration and create a .axc file (For the instance to which AOS must be connected).
2. On the client computer that is running Visual Studio, open the Start menu, right-click Visual Studio 2010, and select Properties.
3. Update the Target field and add the /AxConfig switch as shown below
1. Go to client configuration and create a .axc file (For the instance to which AOS must be connected).
2. On the client computer that is running Visual Studio, open the Start menu, right-click Visual Studio 2010, and select Properties.
3. Update the Target field and add the /AxConfig switch as shown below
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /AxConfig "C:\AXConfig\AOS1AX.axc"
Subscribe to:
Posts (Atom)





