Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Add Company Info to Sales Invoice Query. NAV 2016

Posted on by 2,983

I've created a Query in NAV 2016, where I have added Posted Sales Invoice Header and Lines.

As i'm using this to publish an Invoice ODATA Web Service, I just need to add my Company Information to the query, but there is no actual relation to the Invoice Header.

I really want to avoid having an aditional web service just to publish the Company Information.

Any ideas on how to add this?

I also want to avoid adding a flowfield to the Sales Invoice Table, but this is what I will do if there is no other way to directly do this in the Query.

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Add Company Info to Sales Invoice Query. NAV 2016

    Hello Ghetz,

    When you don't have obvious relation between your DataItems, you can go with "DataItemLinkType" = "SQL Advanced Options" and "SQLJoinType" = "Cross Join". In other words, create your query like the following:

    CrossJoinExample.jpg

    The result from my Cronus, as you dreamed of it, no flowfields, no additional web service :)(:

    CrossJoinExample.jpg

    Of course, perfectionists will say that it is not optimized because you will get your company name as many time as lines you have in your query... So for perfectionists: please optimize it :p

  • Suggested answer
    TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: Add Company Info to Sales Invoice Query. NAV 2016

    I think you need to go with a flowfield or as Mohana said, you can get the Company name from URL.

    Other solution is to go for another web service which expose company info. (No modification to existing system and can expose all the related info you want)

  • Suggested answer
    Yogesh Kulkarni_ Profile Picture
    Yogesh Kulkarni_ 1,762 on at
    RE: Add Company Info to Sales Invoice Query. NAV 2016

    Yes, probably you will need to go with the Flowfield.

    -Yogesh Kulkarni

    Please verify, if you find answer helpful.

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Add Company Info to Sales Invoice Query. NAV 2016

    I think you need to go with flowfield

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Add Company Info to Sales Invoice Query. NAV 2016

    the webservice URL will contain company name as well. if possible, get it from URL or you have to create a flowfield

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

Featured topics

Product updates

Dynamics 365 release plans