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 :
Finance | Project Operations, Human Resources, ...
Suggested answer

how to get field Name from fieldNum?

(0) ShareShare
ReportReport
Posted on by 932

Hello,

I have this tabel that contains TableNum and fienNum :  

pastedimage1683540397142v1.png

I want to get the field Name But I don't which table that contains the fieldId and the fieldName

Have you any idea how to get the field name?

Thanks

I have the same question (0)
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    RE: how to get field Name from fieldNum?

    You can use the Find labels from extensions and then paste the table label and give a find reference on that. It will give the field name.

    Another way is to navigate to that tablenum means you can get table name and then you can search the fields with that labels.

  • BASMA Profile Picture
    932 on at
    RE: how to get field Name from fieldNum?

    inventTable contains many fields ,

    I see it's not practical to go through all the fields one by one to check

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: how to get field Name from fieldNum?

    Then there is no way you need to check each of the field from the InventTable and add select statement based on that.

     while select mandatoryFieldsTable where mandatoryFieldsTable.StateId == productLifeCycleState.StateId
            {
                switch(mandatoryFieldsTable.TableNum)
                {
                    case tableNum(InventTable):
                        DictTable       dictTable;
                        DictField       dictField;
                        int             i, cnt;
                        InventTable  inventFieldTable;
                         dictTable = new DictTable(tableNum(InventTable));
                         cnt = dictTable.fieldCnt();
                         for (i= 1; i<=cnt;i  )
                         {
                            dictField = new DictField(tableNum(InventTable),dictTable.fieldCnt2Id(i));
                            if(dictField.label() == mandatoryFieldsTable.FieldLabel))
                            {
                                fieldName = fieldId2Name(mandatoryFieldsTable.TableNum,dictField.Id());
                            }
                         }
                         if(fieldName == "ABCTieUp)
                         {
                            if(invnetFieldTable.ABCTieUp != 0)
                            {
                            }
                         }
                         //smilarly for all the fields you need to write.
                         if(fieldName == "Field2")
                         {
                            if(invnentFieldTable.Field2 != 0_
                            {
                            }
                         }
                        
                    break;
                    case tableNum(InventModelGroupItem):
                        InventModelGroupItem inventModelGroupItem;
    
                    break;
                    case tableNum(EcoResStorageDimensionGroupItem):
                        EcoResStorageDimensionGroupItem storageDimensionGroupItem;
    
                    break;
                    case tableNum(EcoResTrackingDimensionGroupItem):
                        EcoResTrackingDimensionGroupItem trackingDimensionGroupItem;
                }
            }

    Thanks,

    Girish S,

  • BASMA Profile Picture
    932 on at
    RE: how to get field Name from fieldNum?

    I debug the code, I get only the name of field :  

    pastedimage1683560693139v1.png

    I want to check if this field is empty or no like this : 

    pastedimage1683560752225v2.png

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: how to get field Name from fieldNum?

    Yes, try the code i have given in my previous reply and let us know if it meets your scenario. 

    Thanks,

    Girish S.

  • BASMA Profile Picture
    932 on at
    RE: how to get field Name from fieldNum?

    ok, 

    for example  I select this field  : 

    pastedimage1683559431201v1.png

    I want to serach in inventTable if this  field is filled or not I means that I find a value in the field"ABC-Code Carring Cost" 

    ...

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: how to get field Name from fieldNum?

    What do you mean by field found in invent Table is empty or not?

    Can you elaborate?

    Thanks,

    Girish S.

  • BASMA Profile Picture
    932 on at
    RE: how to get field Name from fieldNum?

    yes I understand this part,

    But I want to check if this field found in inventTable is empty or no

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: how to get field Name from fieldNum?

    Code I have given will loop through all the fields in the InventTable and compare with fields given in your custom table which is MandatoryFieldTable.

    So, the DictTable used DictField to loop through all the field in the InventTable.

    Thanks,

    Girish S.

  • BASMA Profile Picture
    932 on at
    RE: how to get field Name from fieldNum?

    you probably don't understand me,

    I search if the field in the table inventTable has a value or empty

    not if the table has this field or no

    I want to add select from inventTable where this field != null

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 844 User Group Leader

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 752 Super User 2025 Season 2

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 553

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans