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)

Add extra column in view with default value

(0) ShareShare
ReportReport
Posted on by

Hey,

Is it possible to add an extra column to a view with a default falue like 'Alternative trade'. I want that each record had the string Alternative trade in the extra column?

Thank you

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,101 Most Valuable Professional on at

    Yes, you could create a computed column with a static value.

    But I wonder what's the point of doing it.

  • Community Member Profile Picture
    on at

    I want to do a union with an other table but this table has more column dan this so my idea was to add extra columns with empty or default values, so that I can do the union.

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi Nikita551!

    This is an example how to use union query:

        QueryBuildDataSource    qbds_1,
                                qbds_2,
                                qbds_3;
        QueryBuildRange         qbr_1,
                                qbr_2,
                                qbr_3;
        super();
    
        this.query().queryType(QueryType::Union);
    
        qbds_1 = this.query().dataSourceTable(tableNum(UNC_InventBatchTypes));
        qbds_1.unionType(UnionType::Union);
        qbds_1.fields().dynamic(false);
        qbds_1.fields().clearFieldList();
        qbds_1.fields().addField(fieldNum(UNC_InventBatchTypes, Name));
        qbds_1.fields().addField(fieldNum(UNC_InventBatchTypes, Code));
    
        qbr_1 = qbds_1.addRange(fieldNum(UNC_InventBatchTypes, Code));
        qbr_1.value("П17300000000100");
        qbr_1 = qbds_1.addRange(fieldNum(UNC_InventBatchTypes, VendAccount));
        qbr_1.value(vendAccount);
    
        qbds_2 = this.query().addDataSource(tableNum(UNC_InventBatchTypes));
        qbds_2.unionType(UnionType::Union);
        qbds_2.fields().dynamic(false);
        qbds_2.fields().clearFieldList();
        qbds_2.fields().addField(fieldNum(UNC_InventBatchTypes, Name));
        qbds_2.fields().addField(fieldNum(UNC_InventBatchTypes, Code));
    
        qbds_3 = qbds_2.addDataSource(tableNum(UNC_MaxWinding));
        qbds_3.addLink(fieldNum(UNC_InventBatchTypes, Code), fieldNum(UNC_MaxWinding, TareCode));
        qbds_3.addLink(fieldNum(UNC_InventBatchTypes, VendAccount), fieldNum(UNC_MaxWinding, VendAccount));
    
        qbr_3 = qbds_3.addRange(fieldNum(UNC_MaxWinding, ItemId));
        qbr_3.value(itemId);
        qbr_3 = qbds_3.addRange(fieldNum(UNC_MaxWinding, VendAccount));
        qbr_3.value(vendAccount);


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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans