How to show array's records in a Form

matias_jaurematias_jaure Member Posts: 157
Hi everyone!... We have an issue here, we are storing some records in an array. Now, we want to show all the records in a form, we try to do the following:

CurrForm.Diary.FORM.SETTABLEVIEW(g_arrayDiary);

But Navision gave error "the dimension have to be equal" or something similar. So, we are stuck here. Any idea?

Thanks for your time people!

Comments

  • bbrownbbrown Member Posts: 3,268
    Can you explain what you mean by "storing some records in an array"? Since Navision tables do not support arrays.
    There are no bugs - only undocumented features.
  • matias_jaurematias_jaure Member Posts: 157
    bbrown wrote:
    Can you explain what you mean by "storing some records in an array"? Since Navision tables do not support arrays.

    I create an array of type record of some table. So, array is a record. That's what I mean
  • bbrownbbrown Member Posts: 3,268
    Each dimension of the array behaves as a separate record variable. You must issue commands like Array[1].SETRANGE and not Array.SETRANGE.
    There are no bugs - only undocumented features.
  • matias_jaurematias_jaure Member Posts: 157
    bbrown wrote:
    Each dimension of the array behaves as a separate record variable. You must issue commands like Array[1].SETRANGE and not Array.SETRANGE.

    Yes, I do so. But the problem is that I want to show all records in a form, all togheter.. Is there a way?
  • AsallaiAsallai Member Posts: 141
    In NAV you cannot create TextBox dynamically with your arrays (source) :wink: Or if I don't have right please disprove it and tell me how anybody can, because sometimes it will be a clear compromise. O:)

    http://www.mibuso.com/forum/viewtopic.php?t=21312
  • kinekine Member Posts: 12,562
    You need something like:
      for i:=0 to MaxItems do begin
        RecVar := Array[i];
        RecVar.FIND('=');
        RecVar.MARK := True;
      end;
      RecVar.MarkedOnly := True;
    

    And pass the RecVar as the source...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ashishaashisha Member Posts: 60
    kine wrote:
    You need something like:
      for i:=0 to MaxItems do begin
        RecVar := Array[i];
        RecVar.FIND('=');
        RecVar.MARK := True;
      end;
      RecVar.MarkedOnly := True;
    

    And pass the RecVar as the source...


    In a function define array of length array[8] .now i want to change the length of array.please tell me process how i can define array size at time of declaration.please help me as soon as possible.
  • kinekine Member Posts: 12,562
    see Properties of the variable...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ashishaashisha Member Posts: 60
    kine wrote:
    see Properties of the variable...

    Actually in a function which is defined in code unit 365 .
    variable is addarray array[8] of text[80].
    i want to change and make it array[10].how i can do that please help me as soon as possible.
  • kinekine Member Posts: 12,562
    Once again: see the variable properties. I mean "open the properties window when you are standing on the variable (on the definition)".
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.