Hello Every One,
I am working in Ax2009. I am trying to pull all the customization done in usr layer . How to pull using x++ job, for table and classes I am able to differentiate usr or sys layer.
But where as in case of Forms like form methods / data sources i couldn't differentiate either method is newly created or sys level modified one.
Kindly help me.
Thanks,
Phani
at 2009 ax, the forms is copied to the layer collectively, not in fragments. When you change a method of the form, the whole form will be copied to the relevant layer.
In short, it will not be possible to determine which method of the form has changed with the code. (By comparing the layers, you can detect them.)
The situation is a little different in table and class methods. It is possible to detect method-based layers in these objects.
But one thing I do agree with Martin. If your goal is code upgrades, don't bother with these. Else If your goal is to simply create a list, I don't think you need to go down to the methods.
There are many methods, if I were you, I would create a project containing the objects of a layer and make a list of the objects in that project with TreeNode (so you don't have to check the layer).
Apart from all this information, we can help you if you explain your "purpose" more clearly. Share with us what you do and the problems you encounter.
Well, how can you design a suitable solution if you don't know what problem you should address? A list of hundred thousand methods doesn't look very useful, therefore it sounds likely that you shouldn't be generating it all. You should forget code for a moment and ask about the business goal.
As I said, there are already tools for code uprade that can do a much better job. Instead of listing all modified methods, for example, the system can detect actual code conflicts (places where you overlayered code which has changed in lower layers). You'll then know which places need yout attention, you'll be able to track your progress and so on. And you can ignore most methods, because those without conflicts aren't interesting.
If you really insist, look at TreeNode and TreeNodeIterator classes (example: StackOverflow: How can I get, by code, a list of all the methods within a specific form?).
Hi Ergün Şahin,
But I was able to do it Ax2012 using sysmodel element table. do you mean to say that it is not possible in ax2009?
Thanks,
Phani
Hi Martin,
If you can give I need all layers if not we can at least restrict to usr layer only.
Might be for code upgrade but not pretty sure.
Thanks,
Phani
Apart from the utilElements element, you can also loop AOT to get layer values.(The sample code below only travels one level, but it is possible to navigate the tree.)
daxtechies.blogspot.com/.../ax-2012-ax-2009-layers-object.html
But it is not possible to take the layer of form methods in this way too. Form methods (different from table methods) are not based on layers anyway.
I simply wrote a small job for testing purposes.
The two methods of the two objects were previously untouched in the (var) layer I was on. I just touched the delete method on both objects but the incoming info (var / sys / var / var)
static void LayerTest(Args _args) { ; info(enum2str(TreeNode::findNode("\\Data Dictionary\\Tables\\Address\\methods\\delete").applObjectLayer())); info(enum2str(TreeNode::findNode("\\Data Dictionary\\Tables\\Address\\methods\\validateWrite").applObjectLayer())); info(enum2str(TreeNode::findNode("\\Forms\\Address\\Data Sources\\Address\\Methods\\delete").applObjectLayer())); info(enum2str(TreeNode::findNode("\\Forms\\Address\\Data Sources\\Address\\Methods\\validateWrite").applObjectLayer())); }
Hmm, are you saying that you want list of all changes in all layers, not just in USR layer?
What did you say it's the business requirement? Knowing the context would help us a lot...
Hi Martin,
For form methods I am not able to get this.
How to know particular form method is exist in usr and sys layer.
Thanks,
Phani
It would help if you explained your business scenario, rather then mentioning a single implementation detail (the file format). Then we could possibly suggest other solutions than the one you've designed by yourself. For example, you might want this information for upgrade purpose, not realizing that there are already tools for this purpose.
Anyway, if you want to get this information in X , query UtilElements table. For example:
while select utilElements where utilElements.utilLevel == UtilEntryLevel::usr { // Check out Name, RecordTuype, ParentId }
Hi Martin,
I am trying to collect the information and put it into one csv file. So I need to write some code that pulls the information instead of selecting project.
Thanks,
Phani
What exactly are you trying to achieve? Maybe you don't need to write any code at all.
If you want the list of objects, you can easily generate a project just with objects existing in USR layer (see Create a project from a specific layer).
If you want just code defined in USR layer, you can choose a layer when exporting to .xpo (see How to: Export Application Objects by Using the AOT > To export all application objects in a layer).
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156