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

Notifications

Announcements

No record found.

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
    237,965 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

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans