Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Unanswered

Query on Sales Header (filter by customer)

Posted on by 265

Hi all,

I created a simple query calculating for all customers the items and quantity bought.

Expanded Type Data Source Name Method Type Method Group By
1 DataItem Item Ledger Entry <Item_Ledger_Entry> No
0 Column Item No. <Item_No> None Yes
0 Column Source No. <Source_No> None Yes
0 Column Quantity <Sum_Quantity> Totals Sum No

Then created a page to list the query

Expanded Type SubType SourceExpr Name Caption
1 Container ContentArea <Control1000000000> <Control1000000000>
1 Group Repeater General <General>
0 Field Number <Number> <Number>
0 Field ProdutosCliente.Item_No Nº Produto <Nº Produto>
0 Field ProdutosCliente.Source_No Nº Cliente <Nº Cliente>
0 Field ProdutosCliente.Sum_Quantity Quantidade <Quantidade>

OnOpenPage()

ProdutosCliente.OPEN;

WHILE ProdutosCliente.READ DO
NoOfrows:=NoOfrows+1;

ProdutosCliente.CLOSE;

SETRANGE(Number,1,NoOfrows);

CLEAR(ProdutosCliente);
ProdutosCliente.OPEN;

OnClosePage()

ProdutosCliente.CLOSE;

OnFindRecord(Which : Text) : Boolean

OnNextRecord(Steps : Integer) : Integer

OnAfterGetRecord()
IF NOT ProdutosCliente.READ THEN
EXIT;

After that my goal is to create an action button on the Sales Order Form, with this code, but only to list the products of the sales header sell to customer no.

How can i filter that?

Categories:

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans