web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

find() and exist() both need to add in Add Ins:

(0) ShareShare
ReportReport
Posted on by 30

Dear All,

I have one requirement. I am creating a new table. Customer wants to add find() and exist() bothin Add Ins:

5707.table.png

Please give me more shed on this.

Thanks!

Arpan Sen

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: find() and exist() both need to add in Add Ins:

    Hi!

    msdn.microsoft.com/.../aa884843.aspx

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: find() and exist() both need to add in Add Ins:

    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.

  • @rp@n Profile Picture
    30 on at
    RE: find() and exist() both need to add in Add Ins:

    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

  • Vilmos Kintera Profile Picture
    46,149 on at
    RE: find() and exist() both need to add in Add Ins:

    We still do not understand what the functionality should do from a clickable menu item.

  • @rp@n Profile Picture
    30 on at
    RE: find() and exist() both need to add in Add Ins:

    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

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: find() and exist() both need to add in Add Ins:

    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.

  • Community Member Profile Picture
    on at
    RE: find() and exist() both need to add in Add Ins:

    "Is't possible?"

    It is possible. I see same thing

  • @rp@n Profile Picture
    30 on at
    RE: find() and exist() both need to add in Add Ins:

    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

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: find() and exist() both need to add in Add Ins:

    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');
    }
  • Community Member Profile Picture
    on at
    RE: find() and exist() both need to add in Add Ins:

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans