Table of Contents

Codeunit "Privacy Notice"

ID 1563
Namespace: System.Privacy

This codeunit provides an interface for creating, showing and approving Privacy Notices

Properties

Name Value
Access Public

Methods

CreatePrivacyNotice

Creates a privacy notice.

procedure CreatePrivacyNotice(Id: Code[50], IntegrationName: Text[250], Link: Text[2048]): Boolean

Parameters

Name Type Description
Id Code[50]

Identification of the privacy notice.

IntegrationName Text[250]

The name of the integration.

Link Text[2048]

Link to the privacy terms.

Returns

Type Description
Boolean

Whether the privacy notice was created.

CreatePrivacyNotice

Creates a privacy notice.

procedure CreatePrivacyNotice(Id: Code[50], IntegrationName: Text[250]): Boolean

Parameters

Name Type Description
Id Code[50]

Identification of the privacy notice.

IntegrationName Text[250]

The name of the integration.

Returns

Type Description
Boolean

Whether the privacy notice was created.

GetDefaultPrivacyAgreementTxt

Gets the default text for the privacy notice.

procedure GetDefaultPrivacyAgreementTxt(): Text

Returns

Type Description
Text

The default text for the privacy notice.

ConfirmPrivacyNoticeApproval

After this the step-through depends on whether the user is admin or normal user (admin means they have the Priv. Notice - Admin permission set): Admin: If admin has agreed that will be returned Privacy Notice will be shown and the response (Agree/Disagree) will be stored and takes precedence for all users. If the Privacy Notice was simply closed, we return false and nothing is stored. User: If admin has agreed or disagreed, that will be returned If user has agreed, that will be returned Privacy Notice will be shown and any agreement will be stored. If the Privacy Notice was simply closed, we return false and nothing is stored.

This function will open a modal dialog to confirm approval and must hence be run outside a write transaction. The privacy notice referenced must exist.

procedure ConfirmPrivacyNoticeApproval(Id: Code[50]): Boolean

Parameters

Name Type Description
Id Code[50]

Identification of an existing privacy notice.

Returns

Type Description
Boolean

Whether the privacy notice was agreed to.

ConfirmPrivacyNoticeApproval

After this the step-through depends on whether the user is admin or normal user (admin means they have the Priv. Notice - Admin permission set): Admin: If admin has agreed that will be returned Privacy Notice will be shown and the response (Agree/Disagree) will be stored and takes precedence for all users. If the Privacy Notice was simply closed, we return false and nothing is stored. User: If admin has agreed or disagreed, that will be returned If user has agreed, that will be returned Privacy Notice will be shown and any agreement will be stored. If the Privacy Notice was simply closed, we return false and nothing is stored.

This function will open a modal dialog to confirm approval and must hence be run outside a write transaction. The privacy notice referenced must exist.

procedure ConfirmPrivacyNoticeApproval(Id: Code[50], SkipCheckInEval: Boolean): Boolean

Parameters

Name Type Description
Id Code[50]

Identification of an existing privacy notice.

SkipCheckInEval Boolean

If the check should return true if it has not been explicitly disagreed.

Returns

Type Description
Boolean

Whether the privacy notice was agreed to.

GetPrivacyNoticeApprovalState

Returns the state of the privacy notice for the current user without showing any privacy notice to the user.

An error is thrown if the privacy notice does not exist.

procedure GetPrivacyNoticeApprovalState(Id: Code[50]): Enum "Privacy Notice Approval State"

Parameters

Name Type Description
Id Code[50]

Identification of an existing privacy notice.

Returns

Type Description
Enum System.Privacy."Privacy Notice Approval State"

The state of the privacy notice for the current user.

GetPrivacyNoticeApprovalState

Returns the state of the privacy notice for the current user without showing any privacy notice to the user.

An error is thrown if the privacy notice does not exist.

procedure GetPrivacyNoticeApprovalState(Id: Code[50], SkipCheckInEval: Boolean): Enum "Privacy Notice Approval State"

Parameters

Name Type Description
Id Code[50]

Identification of an existing privacy notice.

SkipCheckInEval Boolean

If the check should return true if it has not been explicitly disagreed.

Returns

Type Description
Enum System.Privacy."Privacy Notice Approval State"

The state of the privacy notice for the current user.

ShowOneTimePrivacyNotice

Shows a Privacy Notice for the specified integration name. This call does not require any Privacy Notice to exist, nor will it create one or store the content. This function is purely to show a privacy notice and let the caller handle the consent flow.

procedure ShowOneTimePrivacyNotice(IntegrationName: Text[250]): Enum "Privacy Notice Approval State"

Parameters

Name Type Description
IntegrationName Text[250]

The name of the integration.

Returns

Type Description
Enum System.Privacy."Privacy Notice Approval State"

The state of the privacy notice for the current user.

ShowOneTimePrivacyNotice

Shows a Privacy Notice for the specified integration name. This call does not require any Privacy Notice to exist, nor will it create one or store the content. This function is purely to show a privacy notice and let the caller handle the consent flow.

procedure ShowOneTimePrivacyNotice(IntegrationName: Text[250], Link: Text[2048]): Enum "Privacy Notice Approval State"

Parameters

Name Type Description
IntegrationName Text[250]

The name of the integration.

Link Text[2048]

The name of the integration.

Returns

Type Description
Enum System.Privacy."Privacy Notice Approval State"

The state of the privacy notice for the current user.

IsApprovalStateDisagreed

Determines whether the admin or user has disagreed with the Privacy Notice.

procedure IsApprovalStateDisagreed(Id: Code[50]): Boolean

Parameters

Name Type Description
Id Code[50]

Identification of an existing privacy notice.

Returns

Type Description
Boolean

Whether the Privacy Notice was disagreed to.

IsApprovalStateDisagreed

Determines whether the admin or user has disagreed with the Privacy Notice.

procedure IsApprovalStateDisagreed(State: Enum "Privacy Notice Approval State"): Boolean

Parameters

Name Type Description
State Enum System.Privacy."Privacy Notice Approval State"

The approval state.

Returns

Type Description
Boolean

Whether the Privacy Notice was disagreed to.

SetApprovalState

Sets the approval state for the specified Privacy Notice. If the user is an admin, the approval will be set for the entire organization otherwise it will only be set for the current user.

procedure SetApprovalState(PrivacyNoticeId: Code[50], PrivacyNoticeApprovalState: Enum "Privacy Notice Approval State")

Parameters

Name Type Description
PrivacyNoticeId Code[50]

Id of the privacy notice.

PrivacyNoticeApprovalState Enum System.Privacy."Privacy Notice Approval State"

Id of the privacy notice.

CanCurrentUserApproveForOrganization

Checks whether the current user can approve for the entire organization. This function basically returns whether the user has the permissions of the Priv. Notice - Admin.

procedure CanCurrentUserApproveForOrganization(): Boolean

Returns

Type Description
Boolean

Whether the current user can approve for the entire organization.

CreateDefaultPrivacyNotices

Adds all Privacy Notices from extensions using the event OnAddPrivacyNotices.

procedure CreateDefaultPrivacyNotices()

Events

OnBeforeShowPrivacyNotice

[IntegrationEvent(False,False)]
internal procedure OnBeforeShowPrivacyNotice(PrivacyNotice: __MissingTypeSymbol__, var Handled: Boolean)

Parameters

Name Type Description
PrivacyNotice __MissingTypeSymbol__
Handled Boolean

OnRegisterPrivacyNotices

[IntegrationEvent(False,False)]
internal procedure OnRegisterPrivacyNotices(TempPrivacyNotice: __MissingTypeSymbol__)

Parameters

Name Type Description
TempPrivacyNotice __MissingTypeSymbol__

See also