see the total number of elements

sarto76sarto76 Member Posts: 21
Hallo, it should be a very basic functionnality but, if there is, I cannot see it.
Is there a wa to see the total number of a selection?
For example, when I select the customer list, is it possible to see the total number of customers? Is there another way to do that?
Than you
Max

Comments

  • pawanppawanp Member Posts: 90
    Form.SETSELECTIONFILTER(CustomerRec);
    CustomerRec.COUNT;
  • sarto76sarto76 Member Posts: 21
    Sorry but it is only my first week with Navision...
    Where should I put this code?
    I tryied to create a new label and put it in the c/ on the onPush() function but the variable won't work
    Thank you very much.
    Max
  • pawanppawanp Member Posts: 90
    1. Go to customer list form
    2. Add a new button and go to push action trigger
    3. Add a local record variable "Cust" Customer subtype
    4. Add below code
    Cust.RESET;
    CurrForm.SETSELECTIONFILTER(Cust);
    MESSAGE(FORMAT(Cust.COUNT));
    
  • sarto76sarto76 Member Posts: 21
    Thank you very much!! :lol:

    without:
    CurrForm.SETSELECTIONFILTER(Cust);

    it will give me all the records,otherwise I have to select alla to have the count
    Tanks Max
  • SavatageSavatage Member Posts: 7,142
    It's even easier than that.

    On the List add a textbox at the bottom with sourceexp = COUNT

    Set your glues to bottom & left

    Save-Compile->Enjoy
  • pawanppawanp Member Posts: 90
    sarto76 wrote:
    Is there a wa to see the total number of a selection?
    Max
    I assume you need count for only selected records. Maybe I misinterpreted
  • SavatageSavatage Member Posts: 7,142
    sarto76 wrote:
    For example, when I select the customer list, is it possible to see the total number of customers? Is there another way to do that?

    I was going by this question.

    And if by selection he means filter then the Count would work too.

    Say he filters on a specific salesperson code.
    The list will show just that salesperson and the "count" of that salespersons accounts.

    That's what I'm thinking. If he want's to select a few, he could "mark" them & on View->Marked - the count will still be correct. No buttons needed.
  • pawanppawanp Member Posts: 90
    Savatage wrote:
    sarto76 wrote:
    For example, when I select the customer list, is it possible to see the total number of customers? Is there another way to do that?

    I was going by this question.

    And if by selection he means filter then the Count would work too.

    Say he filters on a specific salesperson code.
    The list will show just that salesperson and the "count" of that salespersons accounts.

    That's what I'm thinking. If he want's to select a few, he could "mark" them & on View->Marked - the count will still be correct. No buttons needed.
    The purpose was just the show the use of SETSELECTIONFILTER. Button could be the easiest trigger.
  • SavatageSavatage Member Posts: 7,142
    Here's a vid (I don't know what youtube did it's kinda screwy) but you'll get the idea how it works for us.

    As i filter on different salespeople the list changes, therefore the count changes.

    http://www.youtube.com/watch?v=E15JL_rq ... e=youtu.be
  • SavatageSavatage Member Posts: 7,142
    edited 2013-03-12
    It works for selection also.

    Make a selelection - Hit CTL-F1 (now those records are marked)
    goto View-> Marked Only

    now your count is showing the number of selected accounts.

    So it has multiple uses :lol:
Sign In or Register to comment.