Page with data from 2 tables?

Hi,

If we have data from another table (eg Description from the Gen. Product Posting Group) that we do want to show for example on a listing of G/L Entries, how do we have this happen in a single page.

So my scenario is that I want to basically show the Description field from the Gen. Product Posting Group table on General Ledger Entries page (Page 20) WITHOUT adding the description to the G/L Entry table as a flowfield.

The reason is that I want to be able to expose the page as a webservice and want the description field.

Any ideas?

Regards

Do one thing. do create a field in gl entry table which is gen product posting group description. The codeunit that you will going to create for webservice, write code to fill temporary instance of gl entry to fill data from regular instance of gl entry and same time fill data for description too from gen posting group table to the temp instance of gl entry.

Finally call the general ledger entries page associated with temp gl entry.

Is that good?

Thanks

Hi,

Thanks for the suggestion. I can see how this will work, however I do not want to be forced to add fields to the G/L entry table - not as you suggest nor via a flowfield as I thought would be possible.

This is really an arbitrary example, but imagine we had a large number of similar fields from many tables which we required (usually description type fields I suppose) - I’d like to be able to define them on my page rather than in the tables. Think of this in the same way as we ‘lookup’ fields for a report…

Thanks

Well i am not sure what are you doing exactly but i did understood what you are trying to do. And i thought you are willing to create a new field but you dont want to use flowfield so thats why i suggest above solution. I am sorry i cant suggest you any other solution , i could if i was sitting on your computer. :slight_smile:

Best of luck

IF you don’t want to add flowfields to the G/L entry table, you must get the data you need were they actually are.

I. e. - for GL Account description, define a global variable RecGLAccount (type record, subtype 15) and in OnAfterGetRecord trigger add the code:

RecGLAccount.GET(“G/L Account No.”);

Then you can use “G/L Account”.Description as the source expression of a textbox control which you may add to the form/report.

I hope this may help.

Ooops, now that I read you question better, I see you are talking about NAV 2009 RTC pages, so the way I suggested may not be the right one.

Sorry, but I guees there should be a quite similar way.

Hi Anna,

Thanks for the suggestion - it does actually apply - I found it last night. We can do a similar thing on the PAGE in the OnAfterGetRecord trigger.

Basically at that point we go off and get the required data - I’m just now investigating the performance which seems to be rather slow in comparison to .NET apps accessing the data directly.

Regards

Ryan