Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to retreive the number of order releases that a sales agreement has?

Posted on by 70

I am trying to retreive this data in order to populate a custom field in the sales order table.

but I am having a hard time finding how a sales agreement count its order releases

  • JairoJs Profile Picture
    JairoJs 70 on at
    RE: How to retreive the number of order releases that a sales agreement has?

    Thanks a lot my friend it is in fact very helpfull

  • Verified answer
    HenryXie Profile Picture
    HenryXie on at
    RE: How to retreive the number of order releases that a sales agreement has?

    hope it is useful

    select distinct

    alr.SALESLINEDATAAREAID

    ,alr.SALESLINEINVENTTRANSID as SalesOrder

    ,ah.SALESNUMBERSEQUENCE as SalesAgreement

    ,ah.CUSTACCOUNT as CustAccount

    from AgreementLineReleasedLine as alr

    inner join AGREEMENTLINE as al on alr.AGREEMENTLINE = al.RECID

    inner join AGREEMENTHEADER as ah on al.AGREEMENT = ah.RECID

    where alr.REFERENCERELATIONTYPE = 359

  • JairoJs Profile Picture
    JairoJs 70 on at
    RE: How to retreive the number of order releases that a sales agreement has?

    I understand. but ultimateley can you help me on retreiving that specific data? how many releases does a an agreement have?

  • HenryXie Profile Picture
    HenryXie on at
    RE: How to retreive the number of order releases that a sales agreement has?

    I was involved a project has similar request.

    unfortunately we did lots of customization to automatically generate the sales order base on sales agreement.

  • JairoJs Profile Picture
    JairoJs 70 on at
    RE: How to retreive the number of order releases that a sales agreement has?

    they need just for tracing but on printed sales orders. this is my complete scenario:

    I have a custom field that should hold the Sales agrement number plus a serial sub-number eg: if I have  a Sales Agreement : 100 .... the first release order would be 100-1.  that "100-1" Is what I need, I need to retreive how many releases has an specific SA in order to calculate the number after the dash

  • HenryXie Profile Picture
    HenryXie on at
    RE: How to retreive the number of order releases that a sales agreement has?

    for end user there is a button, and what's your end user requirements? they need a report or just trace by SO contract 

    pastedimage1584000251205v1.png

  • JairoJs Profile Picture
    JairoJs 70 on at
    RE: How to retreive the number of order releases that a sales agreement has?

    Hello and thank you for replying but I dont follow. what Does this query supouse to bring? a table with all SA and their respective qty of releases?on the other hand where can I excecute such? isnt ax forcing developers to acces DB throug code only?

  • HenryXie Profile Picture
    HenryXie on at
    RE: How to retreive the number of order releases that a sales agreement has?

    Hi JairoJs,

    please reference below table relation.

    select * from AgreementLineReleasedLine as alr
    inner join AGREEMENTLINE as al on alr.AGREEMENTLINE = al.RECID
    where alr.REFERENCERELATIONTYPE = 359

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans