Access to Table "Object Metadata" (or provide alternatives)
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
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.
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.
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?
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).
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.
@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.
@dennisfrostlander: if possible it would be perfect to access the metadata of the extension objects as well.
@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.
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?
@dennisfrostlander: for me the blocking issue would already be solved if access to the object metadata were available
@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.
@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?
This table is still under discussion between various stakeholders. Will keep you posted on the decisions.
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 What information do you need to read from the lookup page?
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.
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 Codeunit 700 may help you
Thanks, for the info. That will help us.
@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.