# MediaSet.Remove(Guid) Method
> Version: _Available or changed with runtime version 1.0._
Removes a media object from a MediaSet of a record.
## Syntax
```al
[Result := ]  MediaSet.Remove(MediaId: Guid)
```
## Parameters
MediaSet
Type: mediaset-data-type
An instance of the mediaset-data-type data type.
MediaId
Type: ../guid/guid-data-type
Specifies the unique ID that is assigned to the media object that you want to remove from the MediaSet. Existing media objects are stored in the system table 2000000184 Tenant Media of the application database. There are different ways of obtaining the GUID of a media object. You could identify the media object ID by looking in the table. Or programmatically, you can use either the Item function on a MediaSet data type field of a record or the MEDIAID function on Media data type field of a record.
## Return Value
*[Optional] Result*
Type: ../boolean/boolean-data-type
true if the object was removed or false if a media object with the given ID was not present in the set. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.
## Remarks
The Remove method disassociates the media object from the MediaSet. It does not delete the media object from the database.
## Example
This example uses the REMOVE method and mediaset-item-method to remove a media object from the MediaSet for record '1000' in the table called TableA. This example assumes the following about TableA:
 It has a MediaSet data type field called Images
 It contains the record number '1000'.
 Record '1000' has at least 1 media object in the MediaSet.
  ```al
  var
     recA: Record TableA;
     mediasetId: GUID;
     Text000: Label 'Media %1 was removed from MediaSet %2.';
     Text001: Label 'The media was not removed from MediaSet %1.';
  begin
     // Retrieves the GUID of the first media object (index number 1) in the MediaSet of record 1000 in TableA
     recA.Get('1000');
     mediaId := recA.Images.Item(1);

     // Removes the media object from the MediaSet of record 1000
     if recA.Images.Remove(mediaId) then begin
         recA.Modify;
         Message(Text000, mediaId, recA.Images.MediaId);
     end else begin
         Message(Text001);
     end;
  end;
  ```
## Related information
mediaset-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

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-remove-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. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/mediaset/mediaset-remove-method/
