Codeunit 5505369 M365 Media Management

Codeunit 5505369 M365 Media Management

Methods

AllFilesFilter

procedure AllFilesFilter(): Text

Returns an all files filter text for XmlPort import/export operations.

Parameters / Return Value

  • Returns Text

    Text


HasMediaSet

procedure HasMediaSet(mediaSetId: Guid; mediaId: Guid): Boolean

Returns true if a MediaSet with the provided mediaSetId and mediaId exists.

Parameters / Return Value

  • mediaSetId Guid

    Guid

  • mediaId Guid

    Guid

  • Returns Boolean

    Boolean


HasMediaSet

procedure HasMediaSet(mediaSetId: Guid): Boolean

Returns true if a MediaSet with the provided mediaSetId exists.

Parameters / Return Value

  • mediaSetId Guid

    Guid

  • Returns Boolean

    Boolean


HasMedia

procedure HasMedia(mediaId: Guid): Boolean

Returns true if Media with the provided mediaId exists.

Parameters / Return Value

  • mediaId Guid

    Guid

  • Returns Boolean

    Boolean


MediaSetId

procedure MediaSetId(): Guid

Returns the Media Set ID.

Parameters / Return Value

  • Returns Guid

    Guid


MediaId

procedure MediaId(): Guid

Returns the Media ID.

Parameters / Return Value

  • Returns Guid

    Guid


DuplicateMedia

procedure DuplicateMedia(var sourceMediaMgt: Codeunit "M365 Media Management")

Created a deep copy of Media by duplicating the content and creating a new media Guid.

Parameters / Return Value

  • sourceMediaMgt Codeunit "M365 Media Management"

    Codeunit “M365 Media Management”


Set

procedure Set(newMediaSetId: Guid; newMediaId: Guid)

Sets new Media Set ID and Media ID.

Parameters / Return Value

  • newMediaSetId Guid

    Guid

  • newMediaId Guid

    Guid


Set

procedure Set(newMediaId: Guid)

Sets a new Media ID.

Parameters / Return Value

  • newMediaId Guid

    Guid


Import

procedure Import(var tempBlob: Codeunit "Temp Blob"; description: Text[250]; mimeType: Text[100]; filename: Text[250]): Guid

Import media from a Temp Blob Codeunit and sets the provided values.

Parameters / Return Value

  • tempBlob Codeunit "Temp Blob"

    Codeunit “Temp Blob”

  • description Text[250]

    Text: The new description to use

  • mimeType Text[100]

    Text: The new Mime Type to use

  • filename Text[250]

    Text: The new filename to use

  • Returns Guid


Import

procedure Import(var tempBlob: Codeunit "Temp Blob"; description: Text[250]; mimeType: Text[100]): Guid

Import media from a Temp Blob Codeunit and sets the provided values.

Parameters / Return Value

  • tempBlob Codeunit "Temp Blob"

    Codeunit “Temp Blob”

  • description Text[250]

    Text: The new description to use

  • mimeType Text[100]

    Text: The new Mime Type to use

  • Returns Guid


Import

procedure Import(filename: Text[250]; var tempBlob: Codeunit "Temp Blob"; mimeType: Text[100]): Guid

Import media from a Temp Blob Codeunit and sets the provided values.

Parameters / Return Value

  • filename Text[250]

    Text: The new filename to use

  • tempBlob Codeunit "Temp Blob"

    Codeunit “Temp Blob”

  • mimeType Text[100]

    Text: The new Mime Type to use

  • Returns Guid


Import

procedure Import(base64Text: Text; description: Text[250]; mimeType: Text[100]; filename: Text[250]): Guid

Import media from a base64 encoded string and sets the provided values.

Parameters / Return Value

  • base64Text Text

    Text

  • description Text[250]

    Text: The new description to use

  • mimeType Text[100]

    Text: The new Mime Type to use

  • filename Text[250]

    Text: The new filename to use

  • Returns Guid


Import

procedure Import(base64Text: Text; description: Text[250]; mimeType: Text[100]): Guid

Import media from a base64 encoded string and sets the provided values.

Parameters / Return Value

  • base64Text Text

    Text

  • description Text[250]

    Text: The new description to use

  • mimeType Text[100]

    Text: The new Mime Type to use

  • Returns Guid


Import

procedure Import(importFilter: Text): Guid

Import media from a base64 encoded string and sets the provided values.

Parameters / Return Value

  • importFilter Text

    Text: Filter string

  • Returns Guid


InsertIntoMediaSet

procedure InsertIntoMediaSet(newMediaId: Guid): Boolean

Adds a media object that already exists in the database to a MediaSet of a record.

Parameters / Return Value

  • newMediaId Guid

    Guid

  • Returns Boolean


RemoveFromMediaSet

procedure RemoveFromMediaSet(mediaId: Guid): Boolean

Removes a media object from a MediaSet of a record.

Parameters / Return Value

  • mediaId Guid

    Guid

  • Returns Boolean


GetMediaProperties

procedure GetMediaProperties(mediaId: Guid; var returnDescription: Text[250]; var returnFilename: Text[250]; var returnMimeType: Text[100]): Boolean

Returns the properties like description, filename, mime type for the passed mediaId.

Parameters / Return Value

  • mediaId Guid

    Guid

  • returnDescription Text[250]

    Description Text

  • returnFilename Text[250]

    File Name Text

  • returnMimeType Text[100]

    Mite Type Text

  • Returns Boolean

    Boolean


GetMediaProperties

procedure GetMediaProperties(mediaId: Guid; var returnFilename: Text[250]; var returnMimeType: Text[100]): Boolean

Returns the properties like description, filename, mime type for the passed mediaId.

Parameters / Return Value

  • mediaId Guid

    Guid

  • returnFilename Text[250]

    File Name Text

  • returnMimeType Text[100]

    Mite Type Text

  • Returns Boolean

    Boolean


GetMediaFilename

procedure GetMediaFilename(mediaId: Guid): Text[250]

Returns the filename for the passed mediaId.

Parameters / Return Value

  • mediaId Guid

    Guid

  • Returns Text[250]

    Text File Name


procedure GetAppLogo(forAppId: Guid; height: Integer; var returnMediaResource: Record "Media Resources"): Boolean

Gets the logo of an extension.

Parameters / Return Value

  • forAppId Guid

    The App ID of the extension.

  • height Integer

    The new requested height of the logo.

  • returnMediaResource Record "Media Resources"

    Out parameter holding the logo of the extension.

  • Returns Boolean


GetMedia

procedure GetMedia(name: Text[250]; forDisplayTarget: ClientType; var returnMediaResource: Record "Media Resources"): Boolean

Get the named media from either “Media Resources” or “Media Repository”, depending on the availability and based on the requested display target. If media cannot be found using the requested display target, Web is used as a fallback. NOTE: “Media Resources” cannot be written.

Parameters / Return Value

  • name Text[250]

    The name of the Media to read.

  • forDisplayTarget ClientType

    The client type for which the media is to be retrieved.

  • returnMediaResource Record "Media Resources"

    Is successful, contains a properly filled “Media Reference”.

  • Returns Boolean

    true on success and if the media is available, false otherwise.


GetMedia

procedure GetMedia(name: Text[250]; var returnMediaResource: Record "Media Resources"): Boolean

Get the named media from either “Media Resources” or “Media Repository”, depending on the availability and based on the current display target/client type. NOTE: “Media Resources” cannot be written.

Parameters / Return Value

  • name Text[250]

    The name of the Media to read.

  • returnMediaResource Record "Media Resources"

    Is successful, contains a properly filled “Media Reference”.

  • Returns Boolean

    true on success and if the media is available, false otherwise.


InsertMedia

procedure InsertMedia(newName: Text[250]; newDisplayTarget: ClientType; var newMediaTempBlob: Codeunit "Temp Blob"): Boolean

Adds a new entry with a media binary to “Media Repository” for later use. The entry is stored for the specified display target. If displayTarget is Default or Current, the actual client type is used.

Parameters / Return Value

  • newName Text[250]

    The name of the Media to store.

  • newDisplayTarget ClientType

    The client type for which the media is to be stored.

  • newMediaTempBlob Codeunit "Temp Blob"

    A “Temp Blob” containing the binary data of the media.

  • Returns Boolean

    true on success if the media could be saved, false otherwise.


InsertMedia

procedure InsertMedia(newName: Text[250]; newDisplayTarget: ClientType; newBase64Media: Text): Boolean

Adds a new entry from a base64 encoded media to “Media Repository” for later use. The entry is stored for the specified display target. If displayTarget is Default or Current, the actual client type is used.

Parameters / Return Value

  • newName Text[250]

    The name of the Media to store.

  • newDisplayTarget ClientType

    The client type for which the media is to be stored.

  • newBase64Media Text

    Base64 encoded binary data of the media.

  • Returns Boolean

    true on success if the media could be saved, false otherwise.


ResizeImage

procedure ResizeImage(var logo: Codeunit "Temp Blob"; newWidth: Integer; newHeight: Integer): Boolean

Resize a given image contained in a “Temp Blob” to the requested new width and height. If one of the new dimentions is lower than 0, the resizing is done keeping the aspect ratio.

Parameters / Return Value

  • logo Codeunit "Temp Blob"

    The binary logo.

  • newWidth Integer

    The new width of the image.

  • newHeight Integer

    The new height of the image.

  • Returns Boolean

    True if resizing was successful, false otherwise.


ResizeImage

procedure ResizeImage(var logo: Codeunit "Temp Blob"; newWidth: Integer): Boolean

Resize a given image contained in a “Temp Blob” to the requested new width keeping the aspect ratio.

Parameters / Return Value

  • logo Codeunit "Temp Blob"

    The binary logo.

  • newWidth Integer

    The new width of the image.

  • Returns Boolean

    True if resizing was successful, false otherwise.


ResizeImage

procedure ResizeImage(newHeight: Integer; var logo: Codeunit "Temp Blob"): Boolean

Resize a given image contained in a “Temp Blob” to the requested new width keeping the aspect ratio.

Parameters / Return Value

  • newHeight Integer

    The new height of the image.

  • logo Codeunit "Temp Blob"

    The binary logo.

  • Returns Boolean

    True if resizing was successful, false otherwise.



EOS Labs -