Dynamic arrays in Navision 3.7B

qngoqngo Member Posts: 58
Is there a way to create a dynamic array using report writer. We have limited license usage. We do not have a developer's access under object designer. Is there a way to create a dynamic array based on the count from the filters being applied. We don't want to create a static value for the array, just in case the count is more than our limit.

Also is there a way for report writer to print out a dynamic array?

Any help would be greatly appreciated.

Thanks ](*,)

Comments

  • bbrownbbrown Member Posts: 3,268
    I am not sure exactly what you want to do, but you might be able to use the integer table. See the Sales Order report for an example
    There are no bugs - only undocumented features.
  • krikikriki Member, Moderator Posts: 9,118
    And instead of using an array to put your data in, you can use a temptable.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • qngoqngo Member Posts: 58
    Ok, just to make things clearer, I want to pull data from different tables, such as the item table, BOM Components, and Sales line table. I won't be able to use temptable for this idea. That's why I wanted to create a dynamic array that would be dependent on the number of BOM Components for any BOM item.

    The reason this is required is because we need to list for our sales order a list of components for the BOM item, without having to explode it. We previously had a customization from our former Navision provider on the explosion function. Our customization would bring in all the components for the BOM but leave the parent unit cost alone, while zeroing out all component items. This caused a lot of headaches for our costing department.

    We decided to resort to out of the box BOM journal. We were never explained how to use this, until our current Navision provider demonstrated to us. We soon came to realize that this most likely will resolve our costing issues.

    What they need me to do, is to customize our sales order and invoice to display the components on a sales order without having to explode it. I need to bring in the components and print it out on the sales order. I can't use a blob variable nor can I use a static array to store all the information. I need to store BOM component item, Description, Description 2, Quantity*quantity ordered, Shelf Location, and Unit of Measure Code.

    That about sums it up.


    [-o< So please, any help would be greatly appreciated.

    Thanks in advance =D>
  • krikikriki Member, Moderator Posts: 9,118
    Dynamic arrays are not possible in Navision, but temptables can that job easily.
    Especially: You can create a table in the database with the fields and indexes you need (E.g. all the "* Buffer"-tables). The beautifull thing is:if you use a table ONLY as a temptable, you don't need to put it in the license!
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • qngoqngo Member Posts: 58
    I not sure what you mean by "table ONLY as a temptable". I understand that I can create a table, but it will be permanent in our license table group. Can you please ellaborate on this.

    Thanks =D>
  • krikikriki Member, Moderator Posts: 9,118
    qngo wrote:
    I not sure what you mean by "table ONLY as a temptable". I understand that I can create a table, but it will be permanent in our license table group. Can you please ellaborate on this.

    Thanks =D>
    "table ONLY as temptable" means you will never store data in the DB. But you use it only in memory to store data. (record-variable with property Temporary=Yes)
    It means that you defined the structure of the table in the DB, but there will NEVER be data in it (in the DB). If you use the table as a temptable, it (almost) behaves like a real table, but ONLY for the program where you defined the variable. In this case you don't need the table in the license.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • qngoqngo Member Posts: 58
    How do I define the proper fields that is needed in a temptable? Do I define it in the report?

    ](*,) Thanks.
  • krikikriki Member, Moderator Posts: 9,118
    You define a temptable in the DB like a normal table with the fields and indexes you need.
    In the report, you create a variable on the table with property "Temptable"=Yes.
    How to use in in the report : http://www.mibuso.com/howtoinfo.asp?FileID=6
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • qngoqngo Member Posts: 58
    Ok, I think I got it. I need to create an empty table with the required fields, and use this table as a temptable in the report. Is this correct?

    Thanks.
  • dahon716dahon716 Member Posts: 5
    Look for a table that closely match what you need in terms of table definition. Then you create a var of record type and set the Temporary property to Yes. Then you can insert record into this var as you would do with an ordinary table, the thing is it will not be written to the DB, it will only reside in the memory. Once it gets out of your scope, then the contents of this var will be gone.
  • krikikriki Member, Moderator Posts: 9,118
    dahon716 wrote:
    Look for a table that closely match what you need in terms of table definition. Then you create a var of record type and set the Temporary property to Yes. Then you can insert record into this var as you would do with an ordinary table, the thing is it will not be written to the DB, it will only reside in the memory. Once it gets out of your scope, then the contents of this var will be gone.
    If you have an existing table that is closely what you need, you can also use dahon716's suggestion (but avoid creating new keys on that table!), otherwise create a new table with the fields/indexes you need.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • qngoqngo Member Posts: 58
    Thanks everyone for your feedback. I successfully did it with a new table.

    \:D/

    Everyone has been a great help.
Sign In or Register to comment.