Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Select statments in SysComputedColumn

Posted on by 43

Dear community hope you are doing well ,

I am having issue while select statment from diffrent datasources and apply operations between them .

Example : select LINEVALUE,CONTRACTLINENUM,* from PSACONTRACTLINEITEMS where CONTRACTLINENUM = 'PJB-0001'  -
select INVOICEDAMOUNT,* from AXPCONTRACTLINEINVOICEDAMOUNT where CONTRACTLINENUM = 'PJB-0001'

I want to subtract both query outputs and show in my computedColumn field .

I am working on AX2012 

  • Martin Dráb Profile Picture
    Martin Dráb 225,526 Super User on at
    RE: Select statments in SysComputedColumn in AX2012

    A computed column method is used to generate a piece of T-SQL code, therefore you should begin by designing the T-SQL code you want to generate.

    If you don't know how to write the T-SQL code, please tell us what exactly you're struggling with.

    If you've written your T-SQL code but you don't know how to generate it in a computed column method, please show us your T-SQL and explain what you're unable to do. Note that the code you shared before wouldn't do the job - there are two separate queries, each of them returning a list of fields, but you need a single query returning a single value (the value of your computed column).

  • Wajahat wasti Profile Picture
    Wajahat wasti 43 on at
    RE: Select statments in SysComputedColumn in AX2012

    Basically i am replacing work from display method to field in AX2012 using query and view ,For that purpose i have created query and create view where i want to calculate subtraction between two fields which are coming from two different datasources .One of the datasource is accessable on my view another is the table from where i have to select that field and perform subtraction .I am looking for help to select field from any table and perform calculation in  Computed column .

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,835 Super User on at
    RE: Select statments in SysComputedColumn in AX2012

    Moved to the Dynamics AX forum.

    Hi Wajahat,

    You mention that you have an issue. What is your own current attempt? Where exactly do you need help? Do you need this on a view or maybe a display method on a form? Can you explain where exactly you need this?

  • Wajahat wasti Profile Picture
    Wajahat wasti 43 on at
    RE: Select statments in SysComputedColumn in AX2012

    I really appreciate for your help but this link is working on same datasource i have to fetch from other datasource which is not in my query .Means i want to subtract both fields from diffrent datasources.

    thank you  

  • Verified answer
    GirishS Profile Picture
    GirishS 27,803 Super User on at
    RE: Select statments in SysComputedColumn in AX2012

    Hi Wajahat Wasti,

    Please go through the below link for adding computed columns in a view.

    https://community.dynamics.com/ax/b/yasirsmicrosoftdynamicsaxworkshop/posts/computed-column-in-dynamics-ax-views

    Thanks,

    Girish S.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,835 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans