Temporary Table Usage

Hey, I am new to Navision and finding it very difficult to work with temporary tables.
Here is a specific problem:
As I go to the edit dimension set entry page, I have created a field there called 'Attribute ID'.
There is a dropdown in that field:

t2zdvoelub69.png

And as I go to the advanced option, a "Select" window pops up like this:

6uuq3bomo81e.png

Now, as I have pointed in the second image that there is no option for "About this page" in the corner but I want to select a record right here in this page and auto populate the rest of the fields in the first image(I can't use the traditional method for auto populating because I don't have all the primary key fields to do that).

I was advised to use temporary table to first dump the selected record in the 'select' window to the temporary table and then use the temporary table to auto populate fields in the first image but I am confused as to how to get started.
Any suggestions would be highly appreciated.
Thanks in advance:)

Answers

  • TallyHoTallyHo Posts: 223Member
    CTRL + ALT + F1 isn't working either? It should bring you to about this page.
  • Neelam_AryaNeelam_Arya Posts: 9Member
    Nope, it's not working.
  • vaprogvaprog Posts: 877Member
    Hey, I am new to Navision and finding it very difficult to work with temporary tables.

    I don't see why you'd want to mess with temporary tables here at all.

    Working with temporary tables is really not much different from working with real database tables. Main differences beeing:
    • You need to populate the table first yourself
    • the data is restricted to that record var (and any RecordRefs pointing to it as well as other temporary record variables you copied from it with the share option)
    • you need to be careful when executing any code on it (triggers, record functions), because those might change real data in the database

    Now, as I have pointed in the second image that there is no option for "About this page" in the corner
    Check the page Object properties. This should be a page of PageType List. To find out, which page it is, in case you don't know, Check the LookupPageID in the related table object.

    but I want to select a record right here in this page and auto populate the rest of the fields in the first image(I can't use the traditional method for auto populating because I don't have all the primary key fields to do that).
    Do you try to do this in the lookup page? Don't! You should do it in the OnValidate trigger of the Attribute Value ID field in the Dimension Set Entry table. There you have all you need.

    I was advised to use temporary table to first dump the selected record in the 'select' window to the temporary table and then use the temporary table to auto populate fields in the first image
    I can't see how this would help you to get the "missing" primary key fields

    but I am confused as to how to get started.
    You seem to be confused about what exactly you need to do.
    I suggest you draw some kind of diagram, depicting where your data is and where it needs to go so you can process it. Then figure out how it needs to flow, and how you can implement that data flow.

    In case your "Dimension Value_Wise Attribute"-Table has a complex key, and more than one filed is not already determined by the record you call the lookup from, (i.e. is filtered to a distinct value in the lookup page when you call it) you need to do the lookup in code, using a page variable, then use the GETRECORD function to retrieve the record selected in the lookup page.
  • Neelam_AryaNeelam_Arya Posts: 9Member
    @Vaprog Thank you for replying, yes I have a complex primary key and that's why the struggle.
    Just see it as I am selecting some record on a lookup page and I want to fetch that current selected record without being able to identify that record by applying any filters on the lookup table.
    My question is how to do that and also will SetSelectionFilter() function work here? If yes, then how?
    Couldn't find a decent instance of SetSelectionFilter().
  • vaprogvaprog Posts: 877Member
    Hi,

    Do you need to select multiple records in your lookup page? If Yes, things change slightly. If you need to select just one, you don't need SETSELECTIONFILTER, otherwise you do.
    Couldn't find a decent instance of SetSelectionFilter().
    You probably don't need an instance, but the documentation. Nevertheless, see Page 40 "Item Journal", Action "Save as Standard Journal" for an example on a record with complex key (as you can see, it does not matter at all). For an example how to get the selection into your OnLookup trigger look at Page 18 "G/L Account List", PROCEDURE SetSelection. See Codeunit 8 AccSchedManagement, PROCEDURE InsertGLAccounts for an example of it's use.

    To get a single selected record (actually, the focused record), call the lookup page from the target page (Edit Dimension Set Entries) in lookup mode. If your call returns ACTION::LookupOK then in case you used PAGE.RUNMODAL(ID,RecVar), RecVar is the selected one. In case you used a page variable, you retrieve the selected record by calling GETRECORD(RevVar).

    For examples see PROCEDURE LookUpDimFilter in Page 113 Budget and trigger OnLookup for field "Business Contact No." (SourceExpr=ContactNo) in Page 344 Navigate.


  • krikikriki Posts: 8,726Member, Moderator
    [Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
    NAV TechDays 2019: 21 & 22 November 2019, Antwerp (Belgium)
Sign In or Register to comment.