AL icon indicating copy to clipboard operation
AL copied to clipboard

Access to Table "Object Metadata" (or provide alternatives)

Open julianwissel opened this issue 9 years ago • 27 comments

I am working with the November Preview and I need to read from the virtual table "Object Metadata".

This table however is blocked: ObjectMetadata : Record "Object Metadata"; [AL] The type or method 'Object Metadata' cannot be used for 'Extension' development.

Could you unblock it (at least for read-purposes)?

Thanks and best regards, Julian

julianwissel avatar Nov 10 '17 10:11 julianwissel

Hi, what information do you rely on form that table? Can you use the AllObjWithCaption table instead? Or individual metadata tables: Table Metadata, Page Metadata etc.

StanislawStempin avatar Nov 10 '17 13:11 StanislawStempin

Hi Stan,

I am parsing the object metadata XML to identfy all fields that are available on a page and whether a field is editable or not (based on editable/enabled-property on table and/or page).

I have not thought about page and table metadata. Could that work?

Best regards, Julian


Von: Stanislaw Stempin [email protected] Gesendet: Freitag, 10. November 2017 14:32:34 An: Microsoft/AL Cc: Julian Wissel; Author Betreff: Re: [Microsoft/AL] Access to Table "Object Metadata" (#912)

Hi, what information do you rely on form that table? Can you use the AllObjWithCaption table instead? Or individual metadata tables: Table Metadata, Page Metadata etc.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/AL/issues/912#issuecomment-343474068, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Af_b9I1X07YBFLDJczAyWcLa-0iHxBORks5s1FBygaJpZM4QZZHw.

julianwissel avatar Nov 10 '17 13:11 julianwissel

Page Field information doesn't seem to be available in any other system tables. May I ask what is the scenario that you're trying to achieve? The Editable/Enabled properties can be expressions that only get evaluated at runtime. How do you statically decide if the are true/false?

StanislawStempin avatar Nov 10 '17 15:11 StanislawStempin

We are "solving" the issue that editable/enabled-property allow expressions that only the static value TRUE is understood by us as editable. The general scenario is a search and replace app that only allows searching and replacing on fields that are editable from the page (without any conditional editability).

julianwissel avatar Nov 13 '17 10:11 julianwissel

We also have a case where we need access to the table "Object Metadata". Specifically, we need these to read the RequestPage for the existing reports. Unfortunately, we have no other option than to go over the metadata, because the XML returned by the report tells us nothing about the request page structure. We then build the request XML from the metadata and pass it to the report. So far, however, there is no other way. For this we would only need read-only access to the object metadata table.

FSharpCSharp avatar Nov 13 '17 11:11 FSharpCSharp

@julianwissel @FSharpCSharp What about objects added through extensions? Do you also need to include those objects in your solutions? The problem is that metadata for extension objects is not stored in Object Metadata table, but in Nav App Object Metadata table instead.

defr0std avatar Nov 15 '17 10:11 defr0std

@dennisfrostlander: if possible it would be perfect to access the metadata of the extension objects as well.

julianwissel avatar Nov 15 '17 12:11 julianwissel

@dennisfrostlander It would indeed be very good if you had access to both metadata. Would it be possible to offer a virtual table of metadata that connects the two? This means that you could not make any changes to the existing real tables.

FSharpCSharp avatar Nov 15 '17 12:11 FSharpCSharp

Yes, I was thinking along the same line. To set the right priority though, I assume that at this point the absence of access to Nav App Object Metadata is not a blocking issue for you (to convert the existing solutions). Am I right?

defr0std avatar Nov 15 '17 12:11 defr0std

@dennisfrostlander: for me the blocking issue would already be solved if access to the object metadata were available

julianwissel avatar Nov 15 '17 13:11 julianwissel

@dennisfrostlander I also think that it would be sufficient for the first if access to the normal object metadata table were possible. Of course, it would be nice to be able to access the extension metadata via a virtual table. In my view, however, this can only happen later.

FSharpCSharp avatar Nov 16 '17 06:11 FSharpCSharp

@dennisfrostlander Any news on this? For the implementation of our previous module we still need access to this table. So far, this issue has only been marked as a "question". Is implementation no longer planned?

FSharpCSharp avatar Nov 29 '17 09:11 FSharpCSharp

This table is still under discussion between various stakeholders. Will keep you posted on the decisions.

defr0std avatar Nov 29 '17 09:11 defr0std

We need acccess to the Object Metadata as well. We need to know the Lookup Page for tables. for Standard objects and for extensions.

MaKnauer avatar Nov 29 '17 11:11 MaKnauer

@MaKnauer What information do you need to read from the lookup page?

defr0std avatar Nov 29 '17 12:11 defr0std

We want to get the lookup page from a table . For example Lookup Page of Table 18 is Page 22. We use this in a generic way to generate page link URLs.

MaKnauer avatar Nov 29 '17 12:11 MaKnauer

In our workflow granule, we track changes on tables. If some fields have been set, for example the item description on item table, we send an email to a user which contains a direct link to the item card. Therefore we need to know the lookup page from a table. But we are able to track changes on every table in NAV so we need a generic solution.

MaKnauer avatar Nov 29 '17 12:11 MaKnauer

@MaKnauer Codeunit 700 may help you

danielrodgers avatar Nov 29 '17 14:11 danielrodgers

Thanks, for the info. That will help us.

MaKnauer avatar Nov 29 '17 16:11 MaKnauer

@FSharpCSharp Opening the entire Object Metadata table for extension development might not be the most desirable option. The better alternative for us would be to provide the exact API that you need for your scenarios. But for that we need to understand in more details, why you need to extract request page metadata from XML? What type of changes are you making in the XML and what for?

If you already have an idea of the suitable API, we could work towards submitting a pull request to Microsoft C/AL Open Library and then it will be included in the next base app update.

defr0std avatar Dec 06 '17 13:12 defr0std