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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Equivalent of tablenum() in Visual studio/Enterprise portal

(0) ShareShare
ReportReport
Posted on by

Hi,

On enteprise portal form, i want to write a logic if user comes from certain table , he should see certain part of UI. It has nothing to do with Roles or Security. I want to write a logic in Visual Studio C# which is equivalent to tablenum() method of X++. Let me know if it can be done or not.

 

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    syed baber Profile Picture
    11,633 on at

    Hi VDY,

    The tablenum() method in X++ also require you to provide the table name and then returns the table ID.  Can you please further elaborate your requirement?

    You can access X++ objects in C# code using .NET business connector. Here is the link which may help you to achieve what you want:

    msdn.microsoft.com/.../aa851743.aspx

    Thanks,

    Baber.

  • Community Member Profile Picture
    on at

    i want to do like this ...

    if(tablenum(myCustomizedTable))

    {

    do something..

    }

    else

    {

    do something

    }

    Basically, i want to filter out document type drop down values if a person is coming from a specific table. and show only required type of documents while doing attachment on enterprise portal.

    I am in EPDocuInfoAdd webcontrol and it has TypeId_lookup method which actually shows all the document types from DocuType Table. But i want to show limited document types which are configured in my separate customized table.

  • Suggested answer
    Iulian Cordobin Profile Picture
    8,201 on at

    using Microsoft.Dynamics.AX.Framework.Services.Client;

    private ISession AxSession

       {

           get

           {

               AxBaseWebPart webpart = AxBaseWebPart.GetWebpart(this);

               return webpart == null ? null : webpart.Session;

           }

       }

    private void your_method()

    {

    ...

    if (TableMetadata.TableNum(this.AxSession, replace_your_table_name))

    {

    action a;

    }

    .....

    }

  • Verified answer
    Community Member Profile Picture
    on at

    I just added 'if' condition with 1 line in 'next' method of DocuTypeSearch class and it worked. Thanks guys anyways.

    do

       {

           next docuType;

           if (docuType)

           {

               if(tableId == tableNum(myCustomizedTable) &&  myDocumentTypesTable::find(docuType.TypeId).RecId<=0)

               {

                   ok = !ok;

               }

               else

               {

                   // all standard ax existing code goes here.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans