Dear All,
I have one requirement. I am creating a new table. Customer wants to add find() and exist() bothin Add Ins:
Please give me more shed on this.
Thanks!
Arpan Sen
*This post is locked for comments
Thanks Vilmos and Grigory
I am sorry but I haven't link (I saw it at the consulting company) But it is not difficult
+-
stackoverflow.com/.../add-a-method-dynamically-in-ax-2012-component
So this is what I would do on such request.The logic can easily be changed to also filter by name of the table, in case you still want to add it in Add-ins menu, using Grigory's link.
static void WIK_findTableWithoutFindExist(Args _args) { SysModelElement modelElement; SysModelElement modelElementMethod; SysModelElementData modelElementData; SysModelManifest modelManifest; void doFind(MethodName _methodName) { int i = 0; while select modelElement order by Name where modelElement.ElementType == UtilElementType::Table notexists join modelElementMethod where modelElementMethod.ElementType == UtilElementType::TableStaticMethod && modelElementMethod.Name == _methodName && modelElementMethod.ParentId == modelElement.AxId // --> if you want to filter it by layer, i.e. standard SYS is Foundation exists join modelElementData where modelElementData.ModelElement == modelElement.RecId exists join modelManifest where modelElementData.ModelId == modelManifest.Model && modelManifest.Name == 'Foundation' // <-- { info(strFmt('%1 missing %2', modelElement.Name, _methodName)); i++; // Early interrupt, not to loop whole SYS layer, for example's sake if (i==10) { break; } } } doFind('exist'); doFind('find'); }
Thanks Vilmos and Grigory.
I asked with customer also. they told the same thing the purpose of those methods in Add Ins that those methods are available in Table level or not.
If yes, they want to open from there.
@ Grigory : Could you please send me the link. How to add find() and exist() in Add Ins.
Thanks!
Arpan Sen
"Is't possible?"
It is possible. I see same thing
What is the difference of going to the table in the AOT, expanding the table, then the Methods node to see if two methods are there or not, compared to implementing the check in the Add-ins menu - isn't it the same amount of clicks?
If they want to verify whether find or exist method is present on a table, why not just do it as a select statement on the ModelElement and ModelElementData tables?! I would do it that way. You could even filter it out to only care for tables that are on a specific layer, and so on.
Vilmos
for example when we need to check find() in table then we generally navigate table \ method \ find()
The same thing they want to use from Add Ins. They want find() and exist() there .
If required they open find() or exist() from Add ins instead of Table \ method \ find() or exist().
Is't possible?
Thanks!
Arpan Sen
We still do not understand what the functionality should do from a clickable menu item.
Thanks Vilmos,
I go through the above link.
Actually customer requirement is they want to show find() and exist() both in Add Ins in Table level.
In table level method node both methods are there but they want to use those method from Add Ins not from method node form table level.
Is't possible? I think it's not possible as i understood.
please confirm.
Thanks!
Arpan Sen
Your requirement is unclear.
If you are on table, you have to add the find and exist methods yourself under the Methods treenode for record manipulation.
Adding something to the Add-ins menu is a different story, that can be done as per the link above, but what would be the purpose of a find, and exist there? If you want a code template, that could done instead in the EditorScripts class.
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,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156