Table of Contents

Page "Check Credit Limit"

ID 343
Namespace: Microsoft.Sales.Customer

Displays a confirmation dialog when customer credit limits or overdue balances are exceeded.

Properties

Name Value
Caption Check Credit Limit
DataCaptionExpression ''
DeleteAllowed False
Editable True
InsertAllowed False
InstructionalText An action is requested regarding the Credit Limit check.
LinksAllowed False
ModifyAllowed False
PageType ConfirmationDialog
SourceTable Table Microsoft.Sales.Customer.Customer

Methods

SalesHeaderShowWarning

Checks if a credit limit warning should be shown for a sales header.

procedure SalesHeaderShowWarning(SalesHeader: Record "Sales Header"): Boolean

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header to check.

Returns

Type Description
Boolean

True if a warning should be shown, otherwise false.

SalesHeaderShowWarningAndGetCause

Checks if a credit limit warning should be shown for a sales header and returns the notification cause.

procedure SalesHeaderShowWarningAndGetCause(SalesHeader: Record "Sales Header"; var NotificationContextGuidOut: Guid): Boolean

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header to check.

NotificationContextGuidOut Guid

Returns the GUID identifying the notification cause.

Returns

Type Description
Boolean

True if a warning should be shown, otherwise false.

SalesLineShowWarning

Checks if a credit limit warning should be shown for a sales line.

procedure SalesLineShowWarning(SalesLine: Record "Sales Line"): Boolean

Parameters

Name Type Description
SalesLine Table Microsoft.Sales.Document."Sales Line"

The sales line to check.

Returns

Type Description
Boolean

True if a warning should be shown, otherwise false.

ShowWarning

Evaluates credit limit and overdue balance and determines if a warning should be displayed.

procedure ShowWarning(NewCustNo: Code[20]; NewOrderAmountLCY2: Decimal; OldOrderAmountLCY2: Decimal; CheckOverDueBalance: Boolean): Boolean

Parameters

Name Type Description
NewCustNo Code[20]

The customer number to check.

NewOrderAmountLCY2 Decimal

The new order amount in local currency.

OldOrderAmountLCY2 Decimal

The old order amount in local currency.

CheckOverDueBalance Boolean

Indicates whether to also check the overdue balance.

Returns

Type Description
Boolean

True if a warning should be shown, otherwise false.

SetHideMessageVisible

Sets the visibility of the hide message checkbox.

procedure SetHideMessageVisible(HideMsgVisible: Boolean)

Parameters

Name Type Description
HideMsgVisible Boolean

True to show the hide message checkbox, otherwise false.

SetHideMessage

Sets the hide message state for the credit limit dialog.

procedure SetHideMessage(HideMsg: Boolean)

Parameters

Name Type Description
HideMsg Boolean

True to hide future messages, otherwise false.

GetHideMessage

Gets whether the user has opted to hide the credit limit message.

procedure GetHideMessage(): Boolean

Returns

Type Description
Boolean

True if the user chose to hide the message, otherwise false.

GetHeading

Gets the primary heading text for the credit limit notification.

procedure GetHeading(): Text[250]

Returns

Type Description
Text[250]

The heading text for the notification.

GetSecondHeading

Gets the secondary heading text for the overdue balance notification.

procedure GetSecondHeading(): Text[250]

Returns

Type Description
Text[250]

The secondary heading text for the notification.

GetNotificationId

Gets the notification identifier for the current credit limit or overdue balance warning.

procedure GetNotificationId(): Guid

Returns

Type Description
Guid

The GUID identifier for the notification.

PopulateDataOnNotification

Populates the credit limit notification with data from the current customer record.

procedure PopulateDataOnNotification(CreditLimitNotification: Notification)

Parameters

Name Type Description
CreditLimitNotification Notification

The notification object to populate with data.

Events

OnBeforeCalcTotalOutstandingAmt

Raised before calculating the total outstanding amount for the customer.

[IntegrationEvent(False,False)]
local procedure OnBeforeCalcTotalOutstandingAmt(var Customer: Record Customer; var IsHandled: Boolean; var Result: Decimal)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

IsHandled Boolean

Set to true to skip the default calculation.

Result Decimal

Set to the result to override the calculation.

OnBeforeCalcCreditLimitLCY

Raised before calculating the credit limit amounts in local currency.

[IntegrationEvent(True,False)]
local procedure OnBeforeCalcCreditLimitLCY(var Customer: Record Customer; var OutstandingRetOrdersLCY: Decimal; var RcdNotInvdRetOrdersLCY: Decimal; var NewOrderAmountLCY: Decimal; var OrderAmountTotalLCY: Decimal; var OrderAmountThisOrderLCY: Decimal; var ShippedRetRcdNotIndLCY: Decimal; var CustCreditAmountLCY: Decimal; var CustNo: Code[20]; var ExtensionAmountsDic: Dictionary of [Guid, Decimal]; var IsHandled: Boolean; DeltaAmount: Decimal; var CustomerRec: Record Customer)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

OutstandingRetOrdersLCY Decimal

The outstanding return orders amount in local currency.

RcdNotInvdRetOrdersLCY Decimal

The received not invoiced return orders amount in local currency.

NewOrderAmountLCY Decimal

The new order amount in local currency.

OrderAmountTotalLCY Decimal

The total order amount in local currency.

OrderAmountThisOrderLCY Decimal

The amount for this order in local currency.

ShippedRetRcdNotIndLCY Decimal

The shipped/returned received not invoiced amount in local currency.

CustCreditAmountLCY Decimal

The customer credit amount in local currency.

CustNo Code[20]

The customer number.

ExtensionAmountsDic Dictionary of [Guid, Decimal]

Dictionary of extension amounts by GUID.

IsHandled Boolean

Set to true to skip the default calculation.

DeltaAmount Decimal

The delta amount for the calculation.

CustomerRec Table Microsoft.Sales.Customer.Customer

The customer record reference.

OnBeforeCalcSalesHeaderNewOrderAmountLCY

Raised before calculating the new order amount in local currency for a sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeCalcSalesHeaderNewOrderAmountLCY(var Customer: Record Customer; SalesHeader: Record "Sales Header"; var NewOrderAmountLCY: Decimal; var IsHandled: Boolean)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

SalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header to calculate the amount for.

NewOrderAmountLCY Decimal

The new order amount in local currency to override.

IsHandled Boolean

Set to true to skip the default calculation.

OnBeforeCalcSalesLineOrderAmountsLCY

Raised before calculating the order amounts in local currency for a sales line.

[IntegrationEvent(False,False)]
local procedure OnBeforeCalcSalesLineOrderAmountsLCY(var Customer: Record Customer; SalesLine: Record "Sales Line"; var NewOrderAmountLCY: Decimal; var OldOrderAmountLCY: Decimal; var IsHandled: Boolean)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

SalesLine Table Microsoft.Sales.Document."Sales Line"

The sales line to calculate the amounts for.

NewOrderAmountLCY Decimal

The new order amount in local currency to override.

OldOrderAmountLCY Decimal

The old order amount in local currency to override.

IsHandled Boolean

Set to true to skip the default calculation.

OnBeforeGenJnlLineShowWarning

Raised before showing the credit limit warning for a general journal line.

[IntegrationEvent(False,False)]
local procedure OnBeforeGenJnlLineShowWarning(GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean; var Result: Boolean; var Customer: Record Customer)

Parameters

Name Type Description
GenJournalLine Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line"

The general journal line to check.

IsHandled Boolean

Set to true to skip the default warning logic.

Result Boolean

Set to the result to override the warning.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

OnBeforeSalesHeaderShowWarning

Raised before showing the credit limit warning for a sales header.

[IntegrationEvent(True,False)]
local procedure OnBeforeSalesHeaderShowWarning(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean; var Customer: Record Customer; var DeltaAmount: Decimal)

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header to check.

Result Boolean

Set to the result to override the warning.

IsHandled Boolean

Set to true to skip the default warning logic.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

DeltaAmount Decimal

The delta amount for the calculation.

OnBeforeSalesLineShowWarning

Raised before showing the credit limit warning for a sales line.

[IntegrationEvent(True,False)]
local procedure OnBeforeSalesLineShowWarning(var SalesLine: Record "Sales Line"; var Result: Boolean; var IsHandled: Boolean; var Customer: Record Customer; var DeltaAmount: Decimal)

Parameters

Name Type Description
SalesLine Table Microsoft.Sales.Document."Sales Line"

The sales line to check.

Result Boolean

Set to the result to override the warning.

IsHandled Boolean

Set to true to skip the default warning logic.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

DeltaAmount Decimal

The delta amount for the calculation.

OnBeforeSalesLineAmount

Raised before calculating the sales line amount.

[IntegrationEvent(False,False)]
local procedure OnBeforeSalesLineAmount(var Customer: Record Customer; DocType: Enum "Sales Document Type"; DocNo: Code[20]; var Result: Decimal; var IsHandled: Boolean)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

DocType Enum Microsoft.Sales.Document."Sales Document Type"

The document type.

DocNo Code[20]

The document number.

Result Decimal

Set to the result to override the calculation.

IsHandled Boolean

Set to true to skip the default calculation.

OnBeforeShowWarning

Raised before showing the credit limit warning dialog.

[IntegrationEvent(False,False)]
local procedure OnBeforeShowWarning(var Customer: Record Customer; var NewOrderAmountLCY: Decimal; OldOrderAmountLCY: Decimal; OrderAmountTotalLCY: Decimal; ShippedRetRcdNotIndLCY: Decimal; CustCreditAmountLCY: Decimal; DeltaAmount: Decimal; CheckOverDueBalance: Boolean; var Heading: Text[250]; var Result: Boolean; var IsHandled: Boolean; var NotificationId: Guid; var NewCustNo: Code[20]; NewOrderAmountLCY2: Decimal; OldOrderAmountLCY2: Decimal; OrderAmountThisOrderLCY: Decimal)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

NewOrderAmountLCY Decimal

The new order amount in local currency.

OldOrderAmountLCY Decimal

The old order amount in local currency.

OrderAmountTotalLCY Decimal

The total order amount in local currency.

ShippedRetRcdNotIndLCY Decimal

The shipped/returned received not invoiced amount in local currency.

CustCreditAmountLCY Decimal

The customer credit amount in local currency.

DeltaAmount Decimal

The delta amount for the calculation.

CheckOverDueBalance Boolean

Indicates whether to check overdue balance.

Heading Text[250]

The heading text for the warning.

Result Boolean

Set to the result to override the warning.

IsHandled Boolean

Set to true to skip the default warning logic.

NotificationId Guid

The notification identifier.

NewCustNo Code[20]

The customer number.

NewOrderAmountLCY2 Decimal

The new order amount in local currency (alternative).

OldOrderAmountLCY2 Decimal

The old order amount in local currency (alternative).

OrderAmountThisOrderLCY Decimal

The amount for this order in local currency.

OnCalcOverdueBalanceLCYAfterSetFilter

Raised after setting the date filter when calculating the overdue balance.

[IntegrationEvent(False,False)]
local procedure OnCalcOverdueBalanceLCYAfterSetFilter(var Customer: Record Customer)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record with the date filter applied.

OnShowWarningOnAfterCalcCreditLimitLCYExitValue

Raised after calculating the credit limit and determining the exit value.

[IntegrationEvent(False,False)]
local procedure OnShowWarningOnAfterCalcCreditLimitLCYExitValue(var Customer: Record Customer; var CustCreditAmountLCY: Decimal; var ExitValue: Integer)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

CustCreditAmountLCY Decimal

The customer credit amount in local currency.

ExitValue Integer

The exit value indicating the warning type.

OnShowWarningOnAfterCalcDueBalanceExitValue

Raised after calculating the due balance and determining the exit value.

[IntegrationEvent(True,False)]
local procedure OnShowWarningOnAfterCalcDueBalanceExitValue(var Customer: Record Customer; var ExitValue: Integer)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

ExitValue Integer

The exit value indicating the warning type.

OnShowWarningOnBeforeExitValue

Raised before returning the exit value from ShowWarning.

[IntegrationEvent(True,False)]
local procedure OnShowWarningOnBeforeExitValue(var Customer: Record Customer; ExitValue: Integer; var Result: Boolean; var IsHandled: Boolean; var Heading: Text[250]; var SecondHeading: Text[250]; var NotificationID: Guid)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

ExitValue Integer

The calculated exit value.

Result Boolean

Set to the result to override the return value.

IsHandled Boolean

Set to true to skip the default return logic.

Heading Text[250]

The heading text to modify.

SecondHeading Text[250]

The secondary heading text to modify.

NotificationID Guid

The notification identifier to modify.

OnAfterCalcOverdueBalanceLCY

Raised after calculating the overdue balance in local currency.

[IntegrationEvent(True,False)]
local procedure OnAfterCalcOverdueBalanceLCY(var Customer: Record Customer)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record with calculated overdue balance.

OnAfterCalcTotalOutstandingAmt

Raised after calculating the total outstanding amount.

[IntegrationEvent(False,False)]
local procedure OnAfterCalcTotalOutstandingAmt(var Customer: Record Customer; var Result: Decimal)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

Result Decimal

The calculated result that can be modified.

OnAfterCalcCreditLimitLCYProcedure

Raised after the credit limit calculation procedure completes.

[IntegrationEvent(True,False)]
local procedure OnAfterCalcCreditLimitLCYProcedure(var Customer: Record Customer; var CustCreditAmountLCY: Decimal; var ExtensionAmountsDic: Dictionary of [Guid, Decimal])

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

CustCreditAmountLCY Decimal

The calculated customer credit amount in local currency.

ExtensionAmountsDic Dictionary of [Guid, Decimal]

Dictionary for extension amounts by GUID.

OnSalesHeaderShowWarningOnAfterAssingNewOrderAmountLCY

Raised after assigning the new order amount for a sales header warning.

[IntegrationEvent(False,False)]
local procedure OnSalesHeaderShowWarningOnAfterAssingNewOrderAmountLCY(var SalesHeader: Record "Sales Header"; var NewOrderAmountLCY: Decimal)

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header being processed.

NewOrderAmountLCY Decimal

The new order amount that can be modified.

OnCalcCreditLimitLCYOnAfterCalcAmounts

Raised after calculating amounts during credit limit calculation.

[IntegrationEvent(False,False)]
local procedure OnCalcCreditLimitLCYOnAfterCalcAmounts(var Customer: Record Customer; var ShippedRetRcdNotIndLCY: Decimal; var CustCreditAmountLCY: Decimal)

Parameters

Name Type Description
Customer Table Microsoft.Sales.Customer.Customer

The customer record.

ShippedRetRcdNotIndLCY Decimal

The shipped/returned received not invoiced amount.

CustCreditAmountLCY Decimal

The customer credit amount in local currency.

See also