{"title":"MediaSet.MediaId() Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/mediaset/mediaset-mediaid-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/mediaset/mediaset-mediaid-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/mediaset/mediaset-mediaid-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Gets the unique identifier that is assigned to a MediaSet of a record.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Syntax","slug":"syntax","at":242,"chars":118},{"level":2,"title":"Parameters","slug":"parameters","at":360,"chars":97},{"level":2,"title":"Return Value","slug":"return-value","at":457,"chars":89},{"level":2,"title":"Remarks","slug":"remarks","at":546,"chars":451},{"level":2,"title":"Example","slug":"example","at":997,"chars":407},{"level":2,"title":"Related information","slug":"related-information","at":1404,"chars":136}],"text":"> Version: _Available or changed with runtime version 1.0._\nGets the unique identifier that is assigned to a MediaSet of a record. The MediaSet is a collection of media objects that are used on the record that can be displayed in the client.\n## Syntax\n```al\nMediaId :=   MediaSet.MediaId()\n```\n> NOTE\n> This method can be invoked using property access syntax.\n## Parameters\nMediaSet\nType: mediaset-data-type\nAn instance of the mediaset-data-type data type.\n## Return Value\nMediaId\nType: ../guid/guid-data-type\nThe GUID of MediaSet on the record.\n## Remarks\nWhen you import media on a table record by using either the mediaset-importfile-method or mediaset-importstream-method, the media is assigned to a MediaSet GUID in the system table 2000000183 Tenant Media Set of the application database. You can use the MediaId method to retrieve the MediaSet GUID. Note that the imported media object is also assigned a GUID. To get the media object's GUID, you can use the ../media/media-mediaid-method.\n## Example\nThis example is gets the GUID of the MediaSet that is used on item No. 1000 in the Item table. The field in the Item table that is used for the MediaSet data type is Picture.\n```al\n var\n    item: Record Item;\n    mediasetId: GUID;\n    Text000: Label 'The GUID of the MediaSet is: %1';\nbegin\n    item.Get('1000');\n    mediasetId := item.Picture.MediaId;\n    Message(Text000, mediasetId);\nend;\n```\n## Related information\nmediaset-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}