Table of Contents

Table "Sales Header"

ID 36
Namespace: Microsoft.Sales.Document

Stores document-level information for sales quotes, orders, invoices, credit memos, blanket orders, and return orders.

Properties

Name Value
Caption Sales Header
DataCaptionFields 3,79
LookupPageID Page Microsoft.Sales.Document."Sales List"
Permissions tabledata "Assemble-to-Order Link" = rmid, tabledata "Assembly Header" = m
DataClassification CustomerContent

Fields

Name Type Description
"Document Type" Enum Microsoft.Sales.Document."Sales Document Type"

Specifies the type of sales document such as quote, order, invoice, or credit memo.

"Sell-to Customer No." Code[20]

Specifies the customer number to whom the goods or services are sold.

"No." Code[20]

Specifies the unique document number that identifies the sales document.

"Bill-to Customer No." Code[20]

Specifies the customer number to whom the invoice is sent for payment.

"Bill-to Name" Text[100]

Specifies the name of the customer to whom the invoice is sent.

"Bill-to Name 2" Text[50]

Specifies an additional part of the bill-to customer name.

"Bill-to Address" Text[100]

Specifies the street address of the customer to whom the invoice is sent.

"Bill-to Address 2" Text[50]

Specifies additional street address information for the bill-to customer.

"Bill-to City" Text[30]

Specifies the city of the customer to whom the invoice is sent.

"Bill-to Contact" Text[100]

Specifies the name of the contact person at the bill-to customer's address.

"Your Reference" Text[35]

Specifies the customer's own reference number for tracking purposes.

"Ship-to Code" Code[10]

Specifies a code for an alternate shipping address different from the customer's default address.

"Ship-to Name" Text[100]

Specifies the name of the customer at the shipping address.

"Ship-to Name 2" Text[50]

Specifies an additional part of the ship-to customer name.

"Ship-to Address" Text[100]

Specifies the street address where items are shipped to.

"Ship-to Address 2" Text[50]

Specifies additional street address information for the shipping address.

"Ship-to City" Text[30]

Specifies the city of the shipping address.

"Ship-to Contact" Text[100]

Specifies the name of the contact person at the shipping address.

"Order Date" Date

Specifies the date when the order was created.

"Posting Date" Date

Specifies the date when the document is posted to the general ledger.

"Shipment Date" Date

Specifies the date when items on the sales document should be shipped.

"Posting Description" Text[100]

Specifies the text that appears in ledger entries when the document is posted.

"Payment Terms Code" Code[10]

Specifies the payment terms code that determines due date and payment discount calculations.

"Due Date" Date

Specifies the date when payment for the sales document is due.

"Payment Discount %" Decimal

Specifies the discount percentage granted for early payment.

"Pmt. Discount Date" Date

Specifies the last date when payment discount is available.

"Shipment Method Code" Code[10]

Specifies the delivery conditions such as FOB or CIF for the shipment.

"Location Code" Code[10]

Specifies the default warehouse location from which items are shipped.

"Shortcut Dimension 1 Code" Code[20]

Specifies the code for the first global dimension used for analysis and reporting.

"Shortcut Dimension 2 Code" Code[20]

Specifies the code for the second global dimension used for analysis and reporting.

"Customer Posting Group" Code[20]

Specifies the customer posting group that determines which receivables account is used.

"Currency Code" Code[10]

Specifies the currency code for amounts on the sales document.

"Currency Factor" Decimal

Specifies the exchange rate factor used to convert amounts to the local currency.

"Customer Price Group" Code[10]

Specifies the customer price group for determining sales prices.

"Prices Including VAT" Boolean

Indicates whether the unit prices on the lines include VAT.

"Invoice Disc. Code" Code[20]

Specifies the code that determines invoice discount calculations for this customer.

"Customer Disc. Group" Code[20]

Specifies the customer discount group for determining line discounts.

"Language Code" Code[10]

Specifies the language code used for printing documents for this customer.

"Format Region" Text[80]

Specifies the regional format used for dates, numbers, and currencies on documents.

"Salesperson Code" Code[20]

Specifies the salesperson responsible for this sales document.

"Order Class" Code[10]

Specifies the order class for categorizing sales documents.

Comment Boolean

Indicates whether comments exist for this sales document.

"No. Printed" Integer

Specifies the number of times the document has been printed.

"On Hold" Code[3]

Specifies a code indicating the document is on hold and should not be processed.

"Applies-to Doc. Type" Enum Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Document Type"

Specifies the type of document to apply this credit memo or payment to.

"Applies-to Doc. No." Code[20]

Specifies the document number to which this document applies for payment or credit.

"Bal. Account No." Code[20]

Specifies the balancing account number for the sales document.

"Recalculate Invoice Disc." Boolean

Indicates whether the invoice discount needs to be recalculated.

Ship Boolean

Indicates whether a shipment should be created when posting.

Invoice Boolean

Indicates whether an invoice should be created when posting.

"Print Posted Documents" Boolean

Indicates whether posted documents should be printed after posting.

Amount Decimal

Contains the total amount of all lines on the sales document excluding VAT.

"Amount Including VAT" Decimal

Contains the total amount of all lines on the sales document including VAT.

"Shipping No." Code[20]

Specifies the number assigned to the next shipment document.

"Posting No." Code[20]

Specifies the number assigned to the next posted invoice or credit memo.

"Last Shipping No." Code[20]

Specifies the number of the last posted shipment document.

"Last Posting No." Code[20]

Specifies the number of the last posted invoice or credit memo.

"Prepayment No." Code[20]

Specifies the number assigned to the next prepayment invoice.

"Last Prepayment No." Code[20]

Specifies the number of the last posted prepayment invoice.

"Prepmt. Cr. Memo No." Code[20]

Specifies the number assigned to the next prepayment credit memo.

"Last Prepmt. Cr. Memo No." Code[20]

Specifies the number of the last posted prepayment credit memo.

"VAT Registration No." Text[20]

Specifies the customer's VAT registration number for tax reporting purposes.

"Combine Shipments" Boolean

Indicates whether multiple shipments for this customer can be combined into one invoice.

"Registration Number" Text[50]

Specifies the company registration number of the customer.

"Reason Code" Code[10]

Specifies the reason code for this sales document.

"Gen. Bus. Posting Group" Code[20]

Specifies the general business posting group for VAT and account determination.

"EU 3-Party Trade" Boolean

Indicates whether this is an EU triangular trade transaction.

"Transaction Type" Code[10]

Specifies the transaction type for Intrastat reporting.

"Transport Method" Code[10]

Specifies the transport method for Intrastat reporting.

"VAT Country/Region Code" Code[10]

Specifies the country/region code for VAT purposes.

"Sell-to Customer Name" Text[100]

Specifies the name of the customer to whom goods or services are sold.

"Sell-to Customer Name 2" Text[50]

Specifies an additional part of the sell-to customer name.

"Sell-to Address" Text[100]

Specifies the street address of the sell-to customer.

"Sell-to Address 2" Text[50]

Specifies additional street address information for the sell-to customer.

"Sell-to City" Text[30]

Specifies the city of the sell-to customer.

"Sell-to Contact" Text[100]

Specifies the name of the contact person at the sell-to customer's address.

"Bill-to Post Code" Code[20]

Specifies the postal code of the bill-to customer's address.

"Bill-to County" Text[30]

Specifies the county or state of the bill-to customer's address.

"Bill-to Country/Region Code" Code[10]

Specifies the country/region code of the bill-to customer's address.

"Sell-to Post Code" Code[20]

Specifies the postal code of the sell-to customer's address.

"Sell-to County" Text[30]

Specifies the county or state of the sell-to customer's address.

"Sell-to Country/Region Code" Code[10]

Specifies the country/region code of the sell-to customer's address.

"Ship-to Post Code" Code[20]

Specifies the postal code of the shipping address.

"Ship-to County" Text[30]

Specifies the county or state of the shipping address.

"Ship-to Country/Region Code" Code[10]

Specifies the country/region code of the shipping address.

"Bal. Account Type" Enum Microsoft.Bank.Payment."Payment Balance Account Type"

Specifies the type of balancing account used with the sales document.

"Exit Point" Code[10]

Specifies the point of exit for Intrastat reporting.

Correction Boolean

Indicates whether this is a correction document that reverses a previous posting.

"Document Date" Date

Specifies the date when the document was created.

"External Document No." Code[35]

Specifies the customer's purchase order number or other external reference.

"Area" Code[10]

Specifies the area code for Intrastat reporting.

"Transaction Specification" Code[10]

Specifies additional transaction details for Intrastat reporting.

"Payment Method Code" Code[10]

Specifies the payment method code that determines how payment is received.

"Shipping Agent Code" Code[10]

Specifies the shipping agent responsible for transporting the items.

"Package Tracking No." Text[50]

Specifies the package tracking number from the shipping agent.

"No. Series" Code[20]

Specifies the number series used to assign the document number.

"Posting No. Series" Code[20]

Specifies the number series used for the posted document number.

"Shipping No. Series" Code[20]

Specifies the number series used for the posted shipment document number.

"Tax Area Code" Code[20]

Specifies the tax area code for sales tax calculation.

"Tax Liable" Boolean

Indicates whether the customer is liable for sales tax.

"VAT Bus. Posting Group" Code[20]

Specifies the VAT business posting group for VAT calculation.

Reserve Enum Microsoft.Inventory.Tracking."Reserve Method"

Specifies the default reservation method for items on the sales document.

"Applies-to ID" Code[50]

Specifies the ID used to link this document to customer ledger entries for application.

"VAT Base Discount %" Decimal

Specifies the discount percentage applied to the VAT base amount.

Status Enum Microsoft.Sales.Document."Sales Document Status"

Specifies the current processing status of the sales document.

"Invoice Discount Calculation" Option

Specifies how the invoice discount is calculated.

"Invoice Discount Value" Decimal

Specifies the invoice discount value as a percentage or amount.

"Send IC Document" Boolean

Indicates whether an intercompany document should be sent to the IC partner.

"IC Status" Enum Microsoft.Intercompany.Setup."Sales Document IC Status"

Specifies the intercompany processing status of the document.

"Sell-to IC Partner Code" Code[20]

Specifies the intercompany partner code of the sell-to customer.

"Bill-to IC Partner Code" Code[20]

Specifies the intercompany partner code of the bill-to customer.

"IC Reference Document No." Code[20]

Specifies the document number from the intercompany partner.

"IC Direction" Enum Microsoft.Intercompany.Setup."IC Direction Type"

Specifies whether this is an outgoing or incoming intercompany document.

"Prepayment %" Decimal

Specifies the prepayment percentage required before delivery.

"Prepayment No. Series" Code[20]

Specifies the number series for prepayment invoices.

"Compress Prepayment" Boolean

Indicates whether prepayment invoice lines should be combined.

"Prepayment Due Date" Date

Specifies the date when the prepayment is due.

"Prepmt. Cr. Memo No. Series" Code[20]

Specifies the number series for prepayment credit memos.

"Prepmt. Posting Description" Text[100]

Specifies the description for prepayment postings.

"Prepmt. Pmt. Discount Date" Date

Specifies the last date for prepayment payment discount.

"Prepmt. Payment Terms Code" Code[10]

Specifies the payment terms code for prepayment invoices.

"Prepmt. Payment Discount %" Decimal

Specifies the payment discount percentage for prepayment invoices.

"Quote No." Code[20]

Specifies the quote number from which the order was created.

"Quote Valid Until Date" Date

Specifies the date until which the sales quote is valid.

"Quote Sent to Customer" DateTime

Specifies when the quote was sent to the customer.

"Quote Accepted" Boolean

Indicates whether the customer has accepted the quote.

"Quote Accepted Date" Date

Specifies the date when the customer accepted the quote.

"Job Queue Status" Enum System.Threading."Document Job Queue Status"

Specifies the status of background posting via the job queue.

"Job Queue Entry ID" Guid

Specifies the unique identifier of the job queue entry for background posting.

"Company Bank Account Code" Code[20]

Specifies the company bank account code for payment information on documents.

"Incoming Document Entry No." Integer

Specifies the entry number of the incoming document that created this sales document.

"Alt. VAT Registration No." Boolean

Indicates whether an alternative VAT registration number is used.

"Alt. Gen. Bus Posting Group" Boolean

Indicates whether an alternative general business posting group is used.

"Alt. VAT Bus Posting Group" Boolean

Indicates whether an alternative VAT business posting group is used.

IsTest Boolean

Indicates whether this is a test document.

"Sell-to Phone No." Text[30]

Specifies the phone number of the sell-to customer.

"Sell-to E-Mail" Text[80]

Specifies the email address of the sell-to customer.

"Journal Templ. Name" Code[10]

Specifies the journal template name used for posting.

"VAT Reporting Date" Date

Specifies the date used for VAT reporting purposes.

"Rcvd.-from Count./Region Code" Code[10]

Specifies the country/region code from which the goods were received.

"Last Email Sent Time" DateTime

Contains the timestamp of when the last email was sent for this document.

"Last Email Sent Message Id" Guid

Contains the message ID of the last email sent for this document.

"Work Description" Blob

Contains a description of the work to be performed for this sales document.

"Ship-to Phone No." Text[30]

Specifies the phone number at the shipping address.

"Amt. Ship. Not Inv. (LCY)" Decimal

Contains the total amount shipped but not invoiced in local currency including VAT.

"Amt. Ship. Not Inv. (LCY) Base" Decimal

Contains the total amount shipped but not invoiced in local currency excluding VAT.

"Dimension Set ID" Integer

Specifies the identifier for the combination of dimensions applied to the document.

"Payment Service Set ID" Integer

Specifies the payment service set identifier for online payment services.

"Coupled to CRM" Boolean
"Coupled to Dataverse" Boolean

Indicates whether this document is coupled to Dynamics 365 Sales.

"Direct Debit Mandate ID" Code[35]

Specifies the direct debit mandate used for collecting payments.

"Invoice Discount Amount" Decimal

Contains the total invoice discount amount for the sales document.

"No. of Archived Versions" Integer

Specifies the number of archived versions of this document.

"Doc. No. Occurrence" Integer

Specifies the occurrence number when the same document number is reused.

"Campaign No." Code[20]

Specifies the marketing campaign number linked to this sales document.

"Sell-to Contact No." Code[20]

Specifies the contact number at the sell-to customer.

"Bill-to Contact No." Code[20]

Specifies the contact number at the bill-to customer.

"Opportunity No." Code[20]

Specifies the sales opportunity linked to this document.

"Sell-to Customer Templ. Code" Code[20]

Specifies the customer template used for quotes without a customer.

"Bill-to Customer Templ. Code" Code[20]

Specifies the bill-to customer template used for quotes without a customer.

"Responsibility Center" Code[10]

Specifies the responsibility center associated with this sales document.

"Shipping Advice" Enum Microsoft.Foundation.Shipping."Sales Header Shipping Advice"

Specifies whether the customer accepts partial shipment of orders.

"Shipped Not Invoiced" Boolean

Indicates whether there are shipped quantities that have not yet been invoiced.

"Completely Shipped" Boolean

Indicates whether all items on the order have been completely shipped.

"Posting from Whse. Ref." Integer

Contains an internal reference used when posting from warehouse documents.

"Location Filter" Code[10]

Specifies the location filter for calculating flow fields.

Shipped Boolean

Indicates whether any items on the order have been shipped.

"Last Shipment Date" Date

Contains the shipment date of the last posted shipment.

"Requested Delivery Date" Date

Specifies the date the customer requested for delivery.

"Promised Delivery Date" Date

Specifies the date the company promised to deliver the order.

"Shipping Time" DateFormula

Specifies the time required for shipping from the location to the customer.

"Outbound Whse. Handling Time" DateFormula

Specifies the time required for outbound warehouse handling before shipment.

"Shipping Agent Service Code" Code[10]

Specifies the shipping agent service code for delivery terms.

"Late Order Shipping" Boolean

Indicates whether there are lines with outstanding quantities past their shipment date.

"Date Filter" Date

Specifies the date filter used for calculating flow fields.

Receive Boolean
"Return Receipt No." Code[20]
"Return Receipt No. Series" Code[20]
"Last Return Receipt No." Code[20]
"Price Calculation Method" Enum Microsoft.Pricing.Calculation."Price Calculation Method"
"Allow Line Disc." Boolean
"Get Shipment Used" Boolean
"Assigned User ID" Code[50]

Specifies the ID of the user who is responsible for the document.

SystemId Guid
SystemCreatedAt DateTime
SystemCreatedBy Guid
SystemModifiedAt DateTime
SystemModifiedBy Guid
SystemCreatedByUserName Text[50]
SystemCreatedByFullName Text[80]
SystemModifiedByUserName Text[50]
SystemModifiedByFullName Text[80]
SystemRowVersion BigInteger

Methods

InitInsert

Initializes a new sales header with a new document number from the number series.

procedure InitInsert()

InitRecord

Initializes a new sales header with default values.

procedure InitRecord()

InitPostingDescription

Initializes the posting description with formatted document type and number text for the sales header.

procedure InitPostingDescription()

SetStandardCodesMgt

Sets global StandardCodesMgtGlobal codeunit to a new instance.

procedure SetStandardCodesMgt(var StandardCodesMgtNew: Codeunit "Standard Codes Mgt.")

Parameters

Name Type Description
StandardCodesMgtNew Codeunit Microsoft.Utilities."Standard Codes Mgt."

The new codeunit instance to set.

Remarks

StandardCodesMgtGlobal codeunit is used to check whether sales recurring lines should be applied for sales document, if necessary, creates a sales line on insert sales header.

AssistEdit

Opens a page to select related number series for the sales header and updates the document number with the selected number series.

procedure AssistEdit(OldSalesHeader: Record "Sales Header"): Boolean

Parameters

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

Sales header record before the change. The no series code from this record will be highlighted by default on the open page.

Returns

Type Description
Boolean

True if the document number has changed, otherwise false.

TestNoSeries

Checks if the number series for different types of sales documents are filled in the sales setup.

procedure TestNoSeries()

GetNoSeriesCode

Returns the number series code from the sales setup based on the document type of the sales header.

procedure GetNoSeriesCode(): Code[20]

Returns

Type Description
Code[20]

Number series code.

TestNoSeriesDate

Checks if the number series has to be assigned chronologically after various documents are already posted.

procedure TestNoSeriesDate(No: Code[20]; NoSeriesCode: Code[20]; NoCapt: Text[1024]; NoSeriesCapt: Text[1024])

Parameters

Name Type Description
No Code[20]

Posted document number.

NoSeriesCode Code[20]

Number series code to check.

NoCapt Text[1024]

Posted document number field caption.

NoSeriesCapt Text[1024]

Number series field caption.

ConfirmDeletion

Opens a confirmation dialog to confirm the deletion of the sales header. This check is to confirm with the user that gaps will happen in the posted documents if the document is deleted.

procedure ConfirmDeletion(): Boolean

Returns

Type Description
Boolean

True if sales header should be deleted, otherwise false.

GetCust

Updates the global Customer record. Record will not be retrieved if document type is quote and provided customer no is blank.

procedure GetCust(CustNo: Code[20]): Record Customer

Parameters

Name Type Description
CustNo Code[20]

Customer number to retrieve the record for.

Returns

Type Description
Table Microsoft.Sales.Customer.Customer

Retrieved customer record.

SalesLinesExist

Checks if any sales lines exists for sales header.

procedure SalesLinesExist(): Boolean

Returns

Type Description
Boolean

True if sales lines exists, otherwise false.

RecreateSalesLines

Recreates sales lines for a sales document when the provided field in the sales header is changed.

procedure RecreateSalesLines(ChangedFieldName: Text[100])

Parameters

Name Type Description
ChangedFieldName Text[100]

Name of the field that is changed. This name is used only in error messages and confirmation dialogs.

Remarks

Opens confirmation dialog to confirm the deletion of existing sales lines and then recreates the sales lines based on the new information in the sales header. It also handles item charge assignments and extended text lines.

StoreSalesCommentLineToTemp

Inserts existing sales comment lines into a temporary record.

procedure StoreSalesCommentLineToTemp(var TempSalesCommentLine: Record "Sales Comment Line" temporary)

Parameters

Name Type Description
TempSalesCommentLine Table Microsoft.Sales.Comment."Sales Comment Line"

Return value: Inserted sales comment lines.

RestoreSalesCommentLine

Inserts sales comment lines for the sales line of the document. Lines are inserted from the provided temporary sales comment line record set.

procedure RestoreSalesCommentLine(var TempSalesCommentLine: Record "Sales Comment Line" temporary; OldDocumnetLineNo: Integer; NewDocumentLineNo: Integer)

Parameters

Name Type Description
TempSalesCommentLine Table Microsoft.Sales.Comment."Sales Comment Line"

Temporary sales comment line record set to insert.

OldDocumnetLineNo Integer

Previous sales line number.

NewDocumentLineNo Integer

New sales line number.

MessageIfSalesLinesExist

Displays a message if sales lines exist for the sales header and the changed field was not updated on the lines.

procedure MessageIfSalesLinesExist(ChangedFieldName: Text[100])

Parameters

Name Type Description
ChangedFieldName Text[100]

Changed sales header field caption.

Remarks

Message states that the user must update the existing sales lines manually.

PriceMessageIfSalesLinesExist

Displays a message to the user if there are existing sales lines and a provided field in the sales header has been changed, which might affect the prices and discounts on the sales lines.

procedure PriceMessageIfSalesLinesExist(ChangedFieldName: Text[100])

Parameters

Name Type Description
ChangedFieldName Text[100]

Changed sales header field caption.

UpdateCurrencyFactor

Updates currency factor on the sales header and recreates sales lines if the currency code has changed.

procedure UpdateCurrencyFactor()

ConfirmCurrencyFactorUpdate

Updates currency factor on the sales header if confirmed by the user.

procedure ConfirmCurrencyFactorUpdate()

SetHideValidationDialog

Sets the value of the global flag HideValidationDialog.

procedure SetHideValidationDialog(NewHideValidationDialog: Boolean)

Parameters

Name Type Description
NewHideValidationDialog Boolean

The new value to set.

Remarks

Global flag HideValidationDialog is used to hide various confirmation/message/other dialogs.

GetHideValidationDialog

Returns the value of the global flag HideValidationDialog.

procedure GetHideValidationDialog(): Boolean

Returns

Type Description
Boolean

The value of the global flag HideValidationDialog.

Remarks

Global flag HideValidationDialog is used to hide various confirmation/message/other dialogs.

SetHideCreditCheckDialogue

Sets the value of the global flag HideCreditCheckDialogue.

procedure SetHideCreditCheckDialogue(NewHideCreditCheckDialogue: Boolean)

Parameters

Name Type Description
NewHideCreditCheckDialogue Boolean

The new value to set.

Remarks

Global flag HideCreditCheckDialogue is used to hide exceeded credit limit notification in sales document.

GetHideCreditCheckDialogue

Returns the value of the global flag HideCreditCheckDialogue.

procedure GetHideCreditCheckDialogue(): Boolean

Returns

Type Description
Boolean

The value of the global flag HideCreditCheckDialogue.

Remarks

Global flag HideCreditCheckDialogue is used to hide exceeded credit limit notification in sales document.

UpdateLocationCode

Updates the location code with the specified location code. If it's empty, it takes location code from user setup management.

procedure UpdateLocationCode(LocationCode: Code[10])

Parameters

Name Type Description
LocationCode Code[10]

New location code.

UpdateSalesLines

Updates sales lines to reflect changes in the sales header field. Optionally the confirmation is raised, for the user to confirm the update of lines.

procedure UpdateSalesLines(ChangedFieldName: Text[100]; AskQuestion: Boolean)

Parameters

Name Type Description
ChangedFieldName Text[100]

Changed sales header field caption.

AskQuestion Boolean

If true, a confirmation message is shown to update the lines, otherwise confirmation is not shown.

Remarks

Field captions must not be duplicated in the sales header, otherwise an error will be raised.

UpdateSalesLinesByFieldNo

Updates sales lines based on the provided field number.

procedure UpdateSalesLinesByFieldNo(ChangedFieldNo: Integer; AskQuestion: Boolean)

Parameters

Name Type Description
ChangedFieldNo Integer

Changed field number.

AskQuestion Boolean

If true, confirmation message is shown to update the lines, otherwise confirmation is not shown.

ConfirmReservationDateConflict

Raises a confirmation informing the user that reservations may be canceled if the change in the field causes a date conflict. Confirmation is only raised if reservations exist. If not confirmed, the execution stops.

procedure ConfirmReservationDateConflict()

CreateDim

Creates and assigns dimensions for the sales header based on the provided default dimension sources.

procedure CreateDim(DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])

Parameters

Name Type Description
DefaultDimSource List of [Dictionary of [Integer, Code[20]]]

The list of default dimension sources.

Remarks

If sales lines exist and the dimension set has changed the dimensions are updated on the lines as well.

ValidateShortcutDimCode

Verifies whether the provided shortcut dimension code and value are valid. If valid, assigns it to the sales document.

procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])

Parameters

Name Type Description
FieldNumber Integer

Number of the shortcut dimension.

ShortcutDimCode Code[20]

Value of the shortcut dimension.

Remarks

If sales lines exist, the dimensions are updated on the lines as well.

ShippedSalesLinesExist

Determines if sales lines that are already shipped exist.

procedure ShippedSalesLinesExist(): Boolean

Returns

Type Description
Boolean

True if shipped sales lines exists, otherwise false.

ReturnReceiptExist

Determines if sales lines that are already returned exist.

procedure ReturnReceiptExist(): Boolean

Returns

Type Description
Boolean

True if return receipt exists, otherwise false.

DeleteAllSalesLines

Deletes all sales lines, reservation, and comment lines for the document.

procedure DeleteAllSalesLines()

CheckCustomerCreated

Checks if sell-to and bill-to customer numbers are filled. If not, it creates customers based on the associated contact and customer template, and assigns the new customer number to the document.

procedure CheckCustomerCreated(Prompt: Boolean): Boolean

Parameters

Name Type Description
Prompt Boolean

If set to true, a confirmation dialog to create a customer will be shown, otherwise not.

Returns

Type Description
Boolean

True if sell-to and bill-to customer numbers are filled, otherwise false.

Remarks

The transaction is committed after each customer record is created. Procedure are used in release sales quote or make order from quote processes.

RecreateReqLine

Recreates requisition lines linked to a sales line, either shifting them to a temporary table or back based on the provided ToTemp flag, updating the order promising line ID in the process.

procedure RecreateReqLine(var TempReqLine: Record "Requisition Line" temporary; OldSalesLine: Record "Sales Line"; NewSourceRefNo: Integer; ToTemp: Boolean)

Parameters

Name Type Description
TempReqLine Table Microsoft.Inventory.Requisition."Requisition Line"

Return value Temporary Requisition Line that contains the requisition lines that have been recreated.

OldSalesLine Table Microsoft.Sales.Document."Sales Line"

Sales line that is associated with the requisition lines that need to be recreated.

NewSourceRefNo Integer

New order promising line ID that should be assigned to the requisition lines when they are moved back from the temporary table to the main table.

ToTemp Boolean

If true, the procedure moves the requisition lines to a temporary table, otherwise it moves the requisition lines back from the temporary table to the main table.

Remarks

Temporary requisition line table is defined as a local variable and the caller has no way to pass in / retrieve lines. Old requisition lines after recreation are deleted.

TestPostingDate

Validates that the posting date matches the work date when posting date check is enabled in sales setup.

procedure TestPostingDate(BatchPost: Boolean)

Parameters

Name Type Description
BatchPost Boolean

Specifies whether the validation is called from batch posting. If true, an error is raised; otherwise, a confirmation dialog is shown.

UpdateSellToCont

Updates the sell-to contact details of a sales header based on the provided customer number.

procedure UpdateSellToCont(CustomerNo: Code[20])

Parameters

Name Type Description
CustomerNo Code[20]

Customer number from which details are taken.

Remarks

If the contact linked to a specific business relation is found, sell-to contact information is updated from the contact.

UpdateBillToCont

Updates the bill-to contact details of a sales header based on the provided customer number.

procedure UpdateBillToCont(CustomerNo: Code[20])

Parameters

Name Type Description
CustomerNo Code[20]

Customer number from which details are taken.

Remarks

If the contact linked to a specific business relation is found, bill-to contact information is updated from the contact.

UpdateSellToCust

Updates the sell-to customer details of a sales header based on the provided contact number.

procedure UpdateSellToCust(ContactNo: Code[20])

Parameters

Name Type Description
ContactNo Code[20]

Contact number from which details are taken.

Remarks

If the contact linked to a specific business relation is found, sell-to customer information is updated from the contact.

GetShippingTime

Updates the shipping time on the sales header.

procedure GetShippingTime(CalledByFieldNo: Integer)

Parameters

Name Type Description
CalledByFieldNo Integer

Field number of the field that called this procedure.

Remarks

Checks if the procedure is called by a field other than the current field. If so, the procedure exits. If shipping agent is defined in sales header then shipping time is set from the shipping agent services, otherwise from sell-to customer. If the procedure was not called by the shipping agent code or shipping agent service code fields, it validates the current shipping time value.

GetSellToCustomerFaxNo

Gets sell-to customer fax number.

procedure GetSellToCustomerFaxNo(): Text

Returns

Type Description
Text

Customer fax number.

CheckCreditMaxBeforeInsert

Checks the bill to customer credit limit and if credit limit is exceeded, creates a notification.

procedure CheckCreditMaxBeforeInsert()

Remarks

Notifiction will be created only if credit warnings is not disabled in sales setup.

CreateInvtPutAwayPick

Creates inventory put-away, pick, or movement documents for a released sales document.

procedure CreateInvtPutAwayPick()

CreateTask

Starts the create task wizard with information from the sales header.

procedure CreateTask()

UpdateShipToAddress

Updates the ship-to address information if the sales header has a credit document type.

procedure UpdateShipToAddress()

ShowDocDim

Opens a page for editing dimensions for the sales header. If dimensions are changed, they're updated on the sales lines as well.

procedure ShowDocDim()

UpdateAllLineDim

Updates the dimensions of sales lines in a sales document when the dimensions of the sales header are changed.

procedure UpdateAllLineDim(NewParentDimSetID: Integer; OldParentDimSetID: Integer)

Parameters

Name Type Description
NewParentDimSetID Integer

New dimension set ID.

OldParentDimSetID Integer

Previous dimension set ID.

LookupAdjmtValueEntries

Opens a page with adjustment value entries related to the sales header.

procedure LookupAdjmtValueEntries(QtyType: Option)

Parameters

Name Type Description
QtyType Option

General - filters all related value entries. Invoicing - filters only not invoiced value entries.

GetCustomerVATRegistrationNumber

Returns the VAT registration number from a sales header.

procedure GetCustomerVATRegistrationNumber(): Text

Returns

Type Description
Text

VAT registration number.

GetCustomerVATRegistrationNumberLbl

Returns the VAT registration number field caption from a sales header.

procedure GetCustomerVATRegistrationNumberLbl(): Text

Returns

Type Description
Text

Caption of the VAT registration number field in the sales header.

GetStatusStyleText

Returns customer global location number. Currently defined to return an empty value.

procedure GetStatusStyleText(): Text

Returns

Type Description
Text

Empty text.

GetPstdDocLinesToReverse

Opens a page with posted document lines that can be reversed. After the user selects the lines, they are copied to the current document.

procedure GetPstdDocLinesToReverse()

CalcInvDiscForHeader

Calculates invoice discount for a sales header if calculate invoice discount is enabled in the sales setup.

procedure CalcInvDiscForHeader()

SetSecurityFilterOnRespCenter

Filters the sales header for responsibility center set in the user setup or company information. The filter is set in filter group 2 and is hidden from the user.

procedure SetSecurityFilterOnRespCenter()

Remarks

Responsibility filter is set from user setup sales responsibility control filter field if this field is filled, otherwise it is set from the company information responsibility center field.

SynchronizeForReservations

Updates reservations data if location or bin have changed on the sales line.

procedure SynchronizeForReservations(var NewSalesLine: Record "Sales Line"; OldSalesLine: Record "Sales Line")

Parameters

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

Return value: Updated sales line record.

OldSalesLine Table Microsoft.Sales.Document."Sales Line"

The original sales line record before updates.

Remarks

Procedure is used on sales lines recreation process.

InventoryPickConflict

Determines if there is a conflict between inventory pick and sales line for a given sales document.

procedure InventoryPickConflict(DocType: Enum "Sales Document Type"; DocNo: Code[20]; ShippingAdvice: Enum "Sales Header Shipping Advice"): Boolean

Parameters

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

The type of the sales document.

DocNo Code[20]

The number of the sales document.

ShippingAdvice Enum Microsoft.Foundation.Shipping."Sales Header Shipping Advice"

The shipping advice for the sales document.

Returns

Type Description
Boolean

True if there is a conflict, otherwise false.

WhseShipmentConflict

Determines if there is a conflict between warehouse shipment and sales line for a given sales document.

procedure WhseShipmentConflict(DocType: Enum "Sales Document Type"; DocNo: Code[20]; ShippingAdvice: Enum "Sales Header Shipping Advice"): Boolean

Parameters

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

The type of the sales document.

DocNo Code[20]

The number of the sales document.

ShippingAdvice Enum Microsoft.Foundation.Shipping."Sales Header Shipping Advice"

The shipping advice for the sales document.

Returns

Type Description
Boolean

True if there is a conflict, otherwise false.

CheckItemAvailabilityInLines

Checks if all lines of the document are in stock. If the quantity in stock is too low, a notification is shown.

procedure CheckItemAvailabilityInLines()

Remarks

Notifications will be displayed if stock notifications are not disabled.

QtyToShipIsZero

Determines if the quantity to ship is zero for all sales document lines.

procedure QtyToShipIsZero(): Boolean

Returns

Type Description
Boolean

True if the quantity to ship is zero for all lines, otherwise false.

IsApprovedForPosting

Checks if the sales document can be posted. It checks for status, approvals, payments and prepayments, and throws an error if conditions are not met.

procedure IsApprovedForPosting(): Boolean

Returns

Type Description
Boolean

True if the sales header is approved for posting, otherwise false.

IsApprovedForPostingBatch

Determines if the sales document can be posted. It checks for status, approvals, payments, and prepayments.

procedure IsApprovedForPostingBatch(): Boolean

Returns

Type Description
Boolean

True if the sales header is approved for posting, otherwise false.

Remarks

All the checks are executed in the try function, so no errors will be thrown if they appear.

GetLegalStatement

Returns legal statement from sales setup. Currently defined to return an empty value.

procedure GetLegalStatement(): Text

Returns

Type Description
Text

Empty text.

SendToPosting

Posts a sales document by running the provided codeunit if the document is approved for posting.

procedure SendToPosting(PostingCodeunitID: Integer): Boolean

Parameters

Name Type Description
PostingCodeunitID Integer

Posting codeunit id that is executed.

Returns

Type Description
Boolean

True if the document was successfully posted, otherwise false.

Remarks

The transaction is committed before the posting codeunit is run. After the posting codeunit is executed any errors that occur during the posting operation are shown.

CancelBackgroundPosting

Cancels a background posting job for a sales document.

procedure CancelBackgroundPosting()

EmailRecords

Sends an email with the sales document attached.

[Scope(Cloud)]
procedure EmailRecords(ShowDialog: Boolean)

Parameters

Name Type Description
ShowDialog Boolean

Determines whether to show the email dialog before sending the email.

GetDocTypeTxt

Retrieves the full document type name based on the sales header document type.

procedure GetDocTypeTxt(): Text[50]

Returns

Type Description
Text[50]

Retrieved document type name.

GetFullDocTypeTxt

Retrieves the full sales document type name based on the sales header document type.

procedure GetFullDocTypeTxt(): Text

Returns

Type Description
Text

Retrieved document type name.

LinkSalesDocWithOpportunity

Updates the link between the sales document and an opportunity.

procedure LinkSalesDocWithOpportunity(OldOpportunityNo: Code[20])

Parameters

Name Type Description
OldOpportunityNo Code[20]

The opportunity number before the update.

SynchronizeAsmHeader

Updates the posting date of related assembly headers with the sales header.

procedure SynchronizeAsmHeader()

Remarks

During the update dialog window will be shown for the user.

CheckShippingAdvice

Checks if the sales document can be shipped completely and throws an error if it cannot.

procedure CheckShippingAdvice()

InvoicedLineExists

Determines whether there are invoiced sales lines for the sales header.

procedure InvoicedLineExists(): Boolean

Returns

Type Description
Boolean

True if invoiced sales lines exists, otherwise false.

CreateDimSetForPrepmtAccDefaultDim

Updates dimensions on lines with prepayments.

procedure CreateDimSetForPrepmtAccDefaultDim()

Remarks

Dimensions are updated on temporary sales line table. Temporary sales line table is defined as a local variable and the caller has no way to retrieve lines.

PrepareOpeningDocumentStatistics

Runs checks and prepares data needed to open the document statistics page.

procedure PrepareOpeningDocumentStatistics()

Remarks

It checks the user's permissions, calculates the invoice discount, creates a dimension set for order documents, and commits any changes made.

CheckAvailableCreditLimit

Determines the available credit limit for the customer associated with the sales header.

procedure CheckAvailableCreditLimit(): Decimal

Returns

Type Description
Decimal

Available credit limit.

SetStatus

Sets the status of a sales document.

procedure SetStatus(NewStatus: Option)

Parameters

Name Type Description
NewStatus Option

New status to set.

TransferItemChargeAssgntSalesToTemp

Transfers item charge assignments to the temporary record set and deletes them from the original record.

procedure TransferItemChargeAssgntSalesToTemp(var ItemChargeAssgntSales: Record "Item Charge Assignment (Sales)"; var TempItemChargeAssgntSales: Record "Item Charge Assignment (Sales)" temporary)

Parameters

Name Type Description
ItemChargeAssgntSales Table Microsoft.Sales.Document."Item Charge Assignment (Sales)"

Item charge assignment record set to transfer.

TempItemChargeAssgntSales Table Microsoft.Sales.Document."Item Charge Assignment (Sales)"

Return value: Temporary item charge assignment record set to transfer to.

CheckSalesPostRestrictions

Triggers the OnCheckSalesPostRestrictions event that allows customized restrictions to be added to the sales document post process.

procedure CheckSalesPostRestrictions()

CustomerCreditLimitExceeded

Triggers the OnCustomerCreditLimitExceeded event that allows a custom solution to be added when the calculated credit limit exceeds the customer's credit limit.

procedure CustomerCreditLimitExceeded()

CustomerCreditLimitExceeded

Triggers the OnCustomerCreditLimitExceeded event that allows a custom solution to be added when the calculated credit limit exceeds the customer's credit limit.

procedure CustomerCreditLimitExceeded(NotificationId: Guid)

Parameters

Name Type Description
NotificationId Guid

Remarks

Used on sales lines and sales header check procedures which creates exceeded credit limit notification if needed.

CustomerCreditLimitNotExceeded

Triggers the OnCustomerCreditLimitNotExceeded event that allows a custom solution to be added when the calculated credit limit not exceeds the customer's credit limit.

procedure CustomerCreditLimitNotExceeded()

CheckSalesReleaseRestrictions

Checks the sales document approvals if the status is open.

procedure CheckSalesReleaseRestrictions()

DeferralHeadersExist

Determines whether there are related deferrals.

procedure DeferralHeadersExist(): Boolean

Returns

Type Description
Boolean

True if any related deferal header exists, otherwise false.

SetSellToCustomerFromFilter

Sets the sell-to customer number from the filter applied to the sell-to customer field if the filter is not blank.

procedure SetSellToCustomerFromFilter()

GetSellToCustomerFromFilter

Retrieves the sell-to customer no. of a sales header based on a single-value filter applied to the sell-to customer no. field.

procedure GetSellToCustomerFromFilter(): Code[20]

Returns

Type Description
Code[20]

Sell-to customer number.

Remarks

Single-value filter is retrieved from the current filter group or filter group 2.

CopySellToCustomerFilter

Moves the filter on sell-to customer no. from the current filter group to filter group 2.

procedure CopySellToCustomerFilter()

BatchConfirmUpdateDeferralDate

Raises a confirmation to update the deferral schedules on the lines to reflect the changed dates. If user confirms the update, the sales lines are updated.

procedure BatchConfirmUpdateDeferralDate(var BatchConfirm: Option; ReplacePostingDate: Boolean; PostingDateReq: Date; ReplaceVATDate: Boolean; VATDateReq: Date)

Parameters

Name Type Description
BatchConfirm Option
ReplacePostingDate Boolean

If true, the sales header's posting date will be replaced with the specified PostingDateReq.

PostingDateReq Date

Posting date to replace.

ReplaceVATDate Boolean
VATDateReq Date

Vat reporting date to replace.

BatchConfirmUpdatePostingDate

Updates the posting date, VAT reporting date, and document date on the sales header during batch posting.

procedure BatchConfirmUpdatePostingDate(ReplacePostingDate: Boolean; PostingDateReq: Date; ReplaceVATDate: Boolean; VATDateReq: Date; ReplaceDocDate: Boolean)

Parameters

Name Type Description
ReplacePostingDate Boolean

Specifies whether to replace the posting date.

PostingDateReq Date

Specifies the new posting date to set.

ReplaceVATDate Boolean

Specifies whether to replace the VAT reporting date.

VATDateReq Date

Specifies the new VAT reporting date to set.

ReplaceDocDate Boolean

Specifies whether to replace the document date.

GetSelectedPaymentServicesText

Retrieves the name of the payment service assigned to the document.

procedure GetSelectedPaymentServicesText(): Text

Returns

Type Description
Text

SetDefaultPaymentServices

Updates the payment service on the document with the default payment service from the setup.

procedure SetDefaultPaymentServices()

ChangePaymentServiceSetting

Opens a page to either select an existing payment service or set up a new one if none exists. The payment service is then assigned to the document.

procedure ChangePaymentServiceSetting()

IsCreditDocType

Check if sales header is credit document type. Credit documents are return orders and credit memos.

procedure IsCreditDocType(): Boolean

Returns

Type Description
Boolean

True if the sales header is a credit document, otherwise false.

HasSellToAddress

Determines if sales header has sell-to information.

procedure HasSellToAddress(): Boolean

Returns

Type Description
Boolean

True if sales header has sell-to information, otherwise false.

HasShipToAddress

Determines if sales header has ship-to information.

procedure HasShipToAddress(): Boolean

Returns

Type Description
Boolean

True if sales header has ship-to information, otherwise false.

HasBillToAddress

Determines if sales header has bill-to information.

procedure HasBillToAddress(): Boolean

Returns

Type Description
Boolean

True if sales header has bill-to information, otherwise false.

HasItemChargeAssignment

Determines if the sales header has any item charge assignments.

procedure HasItemChargeAssignment(): Boolean

Returns

Type Description
Boolean

True if item charge assignments exists, otherwise false.

CopyShipToCustomerAddressFieldsFromCust

Updates sales header with data from provided sell-to customer record.

procedure CopyShipToCustomerAddressFieldsFromCust(var SellToCustomer: Record Customer)

Parameters

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

Sell-to customer record to copy data from.

SetShipToCustomerAddressFieldsFromShipToAddr

Updates the document's shipping address from the provided ship-to address.

procedure SetShipToCustomerAddressFieldsFromShipToAddr(ShipToAddr: Record "Ship-to Address")

Parameters

Name Type Description
ShipToAddr Table Microsoft.Sales.Customer."Ship-to Address"

Ship-to address to update the shipping address with.

SetBillToCustomerAddressFieldsFromCustomer

Updates the billing information on the document from the provided bill-to customer.

procedure SetBillToCustomerAddressFieldsFromCustomer(var BillToCustomer: Record Customer)

Parameters

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

Bill-to customer to update the billing infromation from.

SetShipToAddress

Sets the shipping address details for a sales header.

procedure SetShipToAddress(ShipToName: Text[100]; ShipToName2: Text[50]; ShipToAddress: Text[100]; ShipToAddress2: Text[50]; ShipToCity: Text[30]; ShipToPostCode: Code[20]; ShipToCounty: Text[30]; ShipToCountryRegionCode: Code[10])

Parameters

Name Type Description
ShipToName Text[100]

New ship-to name value.

ShipToName2 Text[50]

New ship-to name 2 value.

ShipToAddress Text[100]

New ship-to address value.

ShipToAddress2 Text[50]

New ship-to address 2 value.

ShipToCity Text[30]

New ship-to city value.

ShipToPostCode Code[20]

New ship-to post code value.

ShipToCounty Text[30]

New ship-to county value.

ShipToCountryRegionCode Code[10]

New ship-to country/region code value.

ShipToAddressEqualsSellToAddress

Determines if sell-to address matches the ship-to address.

procedure ShipToAddressEqualsSellToAddress(): Boolean

Returns

Type Description
Boolean

True if the address match, otherwise false.

BillToAddressEqualsSellToAddress

Determines if sell-to address matches the bill-to address.

procedure BillToAddressEqualsSellToAddress(): Boolean

Returns

Type Description
Boolean

True if addresses match, otherwise false.

CopySellToAddressToShipToAddress

Copies the sell-to address to the ship-to address.

procedure CopySellToAddressToShipToAddress()

CopySellToAddressToBillToAddress

Copies the sell-to address to the bill-to address if bill-to and sell-to customer numbers are the same.

procedure CopySellToAddressToBillToAddress()

ConfirmCloseUnposted

Raises a dialog to confirm closing a page if unposted lines exist.

procedure ConfirmCloseUnposted(): Boolean

Returns

Type Description
Boolean

True if page should be closed, otherwise false.

InitFromSalesHeader

Initializes a sales header from the provided sales header.

procedure InitFromSalesHeader(SourceSalesHeader: Record "Sales Header")

Parameters

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

Sales header to copy information from.

SetWorkDescription

Updates current sales header work description with the provided description.

procedure SetWorkDescription(NewWorkDescription: Text)

Parameters

Name Type Description
NewWorkDescription Text

New work description.

GetWorkDescription

Retrieves work description from the sales header.

procedure GetWorkDescription(): Text

Returns

Type Description
Text

Work description.

LookupContact

Filters the contact for the company number that is associated with either the customer or contact number.

procedure LookupContact(CustomerNo: Code[20]; ContactNo: Code[20]; var Contact: Record Contact)

Parameters

Name Type Description
CustomerNo Code[20]

The number of the customer to filter the contact for.

ContactNo Code[20]

The number of the contact to look up.

Contact Table Microsoft.CRM.Contact.Contact

Return value: Filtered contact record set.

Remarks

If no business relations exist within provided customer and contacts and document type is quote, then filters company contact based on provided contact number.

SetAllowSelectNoSeries

Sets the global flag SelectNoSeriesAllowed to true.

procedure SetAllowSelectNoSeries()

Remarks

The global flag is used to determine if the lookup for the number series can been shown.

SetDefaultSalesperson

Sets the default salesperson code for the sales header.

procedure SetDefaultSalesperson()

Remarks

Retrieves default salesperson code from user setup. If retrieved salesperson code privacy is not blocked, sets it for the sales header.

GetUserSetupSalespersonCode

Retrieves the salesperson code of the current user from the user setup.

procedure GetUserSetupSalespersonCode(): Code[20]

Returns

Type Description
Code[20]

Salesperson code of the current user from the user setup.

SelltoCustomerNoOnAfterValidate

Removes the filter on customer number if the customer number has changed.

procedure SelltoCustomerNoOnAfterValidate(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")

Parameters

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

The current sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

Sales header record before the changes.

PerformManualRelease

Releases the sales documents that are not yet released.

procedure PerformManualRelease(var SalesHeader: Record "Sales Header")

Parameters

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

Filtered sales headers to release.

PerformManualRelease

Releases the sales document if it's not already released.

procedure PerformManualRelease()

Remarks

The transaction is committed after release.

PerformManualReopen

Reopens sales documents that are not already open.

procedure PerformManualReopen(var SalesHeader: Record "Sales Header")

Parameters

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

Filtered sales headers to reopen.

SelectSalesHeaderNewCustomerTemplate

Opens a page for selecting a customer template to use for creating a new customer.

procedure SelectSalesHeaderNewCustomerTemplate(): Code[20]

Returns

Type Description
Code[20]

Customer template code.

Remarks

If sell-to contact has no business relations a confirmation for template selection is raised. If the user confirms, it commits any changes and returns the code of the new customer template selected by the user.

RecallModifyAddressNotification

Recalls a sent notification for the provided notification GUID.

procedure RecallModifyAddressNotification(NotificationID: Guid)

Parameters

Name Type Description
NotificationID Guid

GUID of the notification to recall.

Remarks

If it is a credit document or if notification isn't enabled, it won't recall the notification.

GetModifyCustomerAddressNotificationId

Returns a GUID for a notification that warns if the sell-to address on sales documents is different from the customer's existing address.

procedure GetModifyCustomerAddressNotificationId(): Guid

Returns

Type Description
Guid

Notification GUID.

GetModifyBillToCustomerAddressNotificationId

Returns a GUID for a notification that warns if the bill-to address on sales documents is different from the customer's existing address.

procedure GetModifyBillToCustomerAddressNotificationId(): Guid

Returns

Type Description
Guid

Notification GUID.

GetLineInvoiceDiscountResetNotificationId

Returns a GUID for a notification that warns if the invoice discount amount for the sales line record has been reset.

procedure GetLineInvoiceDiscountResetNotificationId(): Guid

Returns

Type Description
Guid

Notification GUID.

GetWarnWhenZeroQuantitySalesLinePosting

Returns a GUID for a notification that warns before posting lines on sales documents where quantity is 0.

procedure GetWarnWhenZeroQuantitySalesLinePosting(): Guid

Returns

Type Description
Guid

Notification GUID.

SetModifyCustomerAddressNotificationDefaultState

Inserts the default notification to warn that sell-to address on sales documents is different from the customer's existing address.

procedure SetModifyCustomerAddressNotificationDefaultState()

Remarks

Notification is enabled by default.

SetModifyBillToCustomerAddressNotificationDefaultState

Inserts the default notification to warn that bill-to address on sales documents is different from the customer's existing address.

procedure SetModifyBillToCustomerAddressNotificationDefaultState()

Remarks

Notification is enabled by default.

SetShowExternalDocAlreadyExistNotificationDefaultState

Sets the default state for the external document already exists notification in My Notifications.

procedure SetShowExternalDocAlreadyExistNotificationDefaultState(DefaultState: Boolean)

Parameters

Name Type Description
DefaultState Boolean

Specifies whether the notification is enabled by default.

DontNotifyCurrentUserAgain

Disables a specified notification for the current user.

procedure DontNotifyCurrentUserAgain(NotificationID: Guid)

Parameters

Name Type Description
NotificationID Guid

GUID of the notification that needs to be disabled.

HasDifferentSellToAddress

Determines if the sell-to address matches the provided customer's address.

procedure HasDifferentSellToAddress(Customer: Record Customer): Boolean

Parameters

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

Customer to compare the sell-to address with.

Returns

Type Description
Boolean

True if sell-to address is different from provided customer's address, otherwise false.

HasDifferentBillToAddress

Determines if the bill-to address matches the provided customer's address.

procedure HasDifferentBillToAddress(Customer: Record Customer): Boolean

Parameters

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

Customer to compare the bill-to address with.

Returns

Type Description
Boolean

True if bill-to address is different from provided customer's address, otherwise false.

HasDifferentShipToAddress

Determines if the ship-to address matches the provided customer's address.

procedure HasDifferentShipToAddress(Customer: Record Customer): Boolean

Parameters

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

Customer to compare the ship-to address with.

Returns

Type Description
Boolean

True if ship-to address is different from provided customer's address, otherwise false.

ShowInteractionLogEntries

Opens the interaction log entries page where entries related to the sales document are displayed.

procedure ShowInteractionLogEntries()

GetBillToNo

Retrieves the bill-to (customer or contact) number for a sales document.

procedure GetBillToNo(): Code[20]

Returns

Type Description
Code[20]

Bill-to number.

Remarks

If sales document type is quote where the bill-to customer number is blank, but the bill-to contact number and bill-to customer template code are specified, it returns the bill-to contact number. For all other cases, it returns the bill-to customer number.

GetCurrencySymbol

Gets the currency symbol for sales document. If currency symbol is not specified returns the currency code.

procedure GetCurrencySymbol(): Text[10]

Returns

Type Description
Text[10]

Currency symbol.

UpdateShipToSalespersonCode

Updates the salesperson code from either the ship-to addresses or bill-to customer's salesperson.

procedure UpdateShipToSalespersonCode(FieldNo: Integer)

Parameters

Name Type Description
FieldNo Integer

Remarks

If neither are set, it uses the default salesperson from the user setup. If salesperson is blocked, it doesn't get assigned.

SetSalespersonCode

Updates salesperson code. If the provided salesperson code privacy is not blocked, returns provided salesperson code, otherwise returns empty value to assign.

procedure SetSalespersonCode(SalesPersonCodeToCheck: Code[20]; var SalesPersonCodeToAssign: Code[20])

Parameters

Name Type Description
SalesPersonCodeToCheck Code[20]

Salesperson code to set.

SalesPersonCodeToAssign Code[20]

Return value: Salesperson code to assign.

Remarks

If the provided salesperson code is empty, it uses the default one from the user setup.

ValidateSalesPersonOnSalesHeader

Checks if the document can be created/posted depending on the privacy blocked of the salesperson.

procedure ValidateSalesPersonOnSalesHeader(SalesHeader2: Record "Sales Header"; IsTransaction: Boolean; IsPostAction: Boolean)

Parameters

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

Sales header on which salesperson code has been changed.

IsTransaction Boolean

Determines if the check is completed during a write transaction.

IsPostAction Boolean

Determines if the check is completed during the posting.

ShouldSearchForCustomerByName

Determines whether a search for a customer should be performed by name for the provided customer number.

procedure ShouldSearchForCustomerByName(CustomerNo: Code[20]): Boolean

Parameters

Name Type Description
CustomerNo Code[20]

Customer number to check.

Returns

Type Description
Boolean

True if customer should be searched by name, otherwise false.

CanCalculateTax

Returns the value of the global variable SkipTaxCalculation.

procedure CanCalculateTax(): Boolean

Returns

Type Description
Boolean

The value of the global variable SkipTaxCalculation.

Remarks

Currently SkipTaxCalculation in sales header is used only in variable set and get procedures.

SetSkipTaxCalulation

Sets the value of the global variable SkipTaxCalculation.

procedure SetSkipTaxCalulation(Skip: Boolean)

Parameters

Name Type Description
Skip Boolean

The new value to set.

Remarks

Currently SkipTaxCalculation in sales header is used only in variable set and get procedures.

TestQuantityShippedField

Checks if the sales line quantity shipped is zero. If it is not, an error is raised.

procedure TestQuantityShippedField(SalesLine: Record "Sales Line")

Parameters

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

Sales line which shipped quantity has to be checked.

TestStatusIsNotPendingApproval

Determines if sales document status is not pending approval.

procedure TestStatusIsNotPendingApproval(): Boolean

Returns

Type Description
Boolean

True if status is not pending approval, otherwise false.

TestStatusIsNotPendingPrepayment

Determines if sales document status is not pending prepayment.

procedure TestStatusIsNotPendingPrepayment(): Boolean

Returns

Type Description
Boolean

True if status is not pending prepayment, otherwise false.

TestStatusIsNotReleased

Determines if sales document status is not released.

procedure TestStatusIsNotReleased(): Boolean

Returns

Type Description
Boolean

True if status is not released, otherwise false.

TestStatusOpen

Checks if sales document status is open. If it is not, an error is raised.

procedure TestStatusOpen()

TestStatusOpen

Checks if sales document status is open. If it is not, an error is raised.

procedure TestStatusOpen(ThrowErrorIfNot: Boolean): Boolean

Parameters

Name Type Description
ThrowErrorIfNot Boolean

Determines if an error should be raised if status is not open.

Returns

Type Description
Boolean

True if status is open, otherwise false.

SuspendStatusCheck

Sets the value of the global flag StatusCheckSuspended.

procedure SuspendStatusCheck(Suspend: Boolean)

Parameters

Name Type Description
Suspend Boolean

The new value to set.

Remarks

The global flag is used to suspend the check if the document status is open.

CheckForBlockedLines

Checks if there are any blocked items or resources in the sales lines of the sales header.

procedure CheckForBlockedLines()

CopyDocument

Runs the copy sales document report for the sales header.

procedure CopyDocument()

Remarks

The report creates new sales documents based on the existing one.

LookupSellToCustomerName

Opens customer lookup page to select a customer.

procedure LookupSellToCustomerName(var CustomerName: Text): Boolean

Parameters

Name Type Description
CustomerName Text

Return value: Selected customer name.

Returns

Type Description
Boolean

True if customer is selected, otherwise false.

SetBillToCustomerNo

Sets the bill-to customer number based on the provided customer record.

procedure SetBillToCustomerNo(var Cust: Record Customer)

Parameters

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

Specifies the customer record to determine the bill-to customer number.

GetStatusCheckSuspended

Returns the value of the global flag StatusCheckSuspended.

procedure GetStatusCheckSuspended(): Boolean

Returns

Type Description
Boolean

The value of the global flag StatusCheckSuspended.

Remarks

The global flag is used to suspend the check if the document status is open.

GetCalledFromWhseDoc

Returns the value of the global flag CalledFromWhseDoc.

procedure GetCalledFromWhseDoc(): Boolean

Returns

Type Description
Boolean

The value of the global flag CalledFromWhseDoc.

Remarks

Global flag CalledFromWhseDoc is used on posting date validation to check if currency factor can be updated.

SetCalledFromWhseDoc

Sets the value of the global flag CalledFromWhseDoc.

procedure SetCalledFromWhseDoc(NewCalledFromWhseDoc: Boolean)

Parameters

Name Type Description
NewCalledFromWhseDoc Boolean

The new value to set.

Remarks

Global flag CalledFromWhseDoc is set to true on init source header in warahoure shipment and receipt posting.

GetUseDate

Returns the date to use for the sales document.

procedure GetUseDate(): Date

Returns

Type Description
Date

Posting date if posting date is set in sales header, otherwise work date.

InitPostingNoSeries

Initializes the number series for sales document posting based on the document type.

procedure InitPostingNoSeries()

CreateDimFromDefaultDim

Initializes the dimensions for the document from default dimensions for the related entry specified in the field.

procedure CreateDimFromDefaultDim(FieldNo: Integer)

Parameters

Name Type Description
FieldNo Integer

The field number for which to initialize the dimensions.

SelltoContactLookup

Opens a contact lookup page and validates the sell-to contact number with the selected contact.

procedure SelltoContactLookup(): Boolean

Returns

Type Description
Boolean

True if the contact was validated, otherwise false.

SetWarnZeroQuantitySalesPosting

Inserts the default notification to warn before posting lines on sales documents where quantity is 0.

procedure SetWarnZeroQuantitySalesPosting()

Remarks

Notification is enabled by default.

SalesLinesEditable

Determines if the sales lines are editable based on whether sell-to information is in the sales header.

procedure SalesLinesEditable(): Boolean

Returns

Type Description
Boolean

True if sales lines are editable, otherwise false.

GetShowExternalDocAlreadyExistNotificationId

Returns the GUID for the external document already exists notification.

procedure GetShowExternalDocAlreadyExistNotificationId(): Guid

Returns

Type Description
Guid

The notification GUID.

UpdateSalesOrderLineIfExist

Updates the related sales order line if a posted credit memo exists for this document.

procedure UpdateSalesOrderLineIfExist()

SendICSalesDoc

Sends filtered sales documents to intercompany partners through the IC inbox/outbox.

procedure SendICSalesDoc(var SalesHeader: Record "Sales Header")

Parameters

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

Specifies the filtered sales header records to send.

Events

OnCheckSalesPostRestrictions

Raised to allow subscribers to add custom restrictions to the sales document posting process.

[IntegrationEvent(True,False)]
procedure OnCheckSalesPostRestrictions()

OnCustomerCreditLimitExceeded

Raised when the calculated credit amount exceeds the customer's credit limit.

[IntegrationEvent(True,False)]
procedure OnCustomerCreditLimitExceeded(NotificationId: Guid)

Parameters

Name Type Description
NotificationId Guid

Specifies the GUID of the credit limit notification.

OnCustomerCreditLimitNotExceeded

Raised when the calculated credit amount does not exceed the customer's credit limit.

[IntegrationEvent(True,False)]
procedure OnCustomerCreditLimitNotExceeded()

OnCheckSalesReleaseRestrictions

Raised to allow subscribers to add custom restrictions to the sales document release process.

[IntegrationEvent(True,False)]
local procedure OnCheckSalesReleaseRestrictions()

OnAfterAssignDefaultVATBusPostingGroup

Raised after the default VAT business posting group is assigned to the sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterAssignDefaultVATBusPostingGroup(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; GenBusinessPostingGroup: Record "Gen. Business Posting Group")

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

GenBusinessPostingGroup Table Microsoft.Finance.GeneralLedger.Setup."Gen. Business Posting Group"

The general business posting group used to determine the VAT business posting group.

OnAfterInitDefaultDimensionSources

Raised after the default dimension sources are initialized for the sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterInitDefaultDimensionSources(var SalesHeader: Record "Sales Header"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)

Parameters

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

The sales header record being modified.

DefaultDimSource List of [Dictionary of [Integer, Code[20]]]

The list of default dimension sources.

FieldNo Integer

The field number that triggered the dimension initialization.

OnAfterInitRecord

Raised after the sales header record is initialized.

[IntegrationEvent(True,False)]
local procedure OnAfterInitRecord(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was initialized.

OnAfterInitNoSeries

Raised after the number series is initialized for the sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterInitNoSeries(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnAfterInitializeRoundingPrecision

Raised after the rounding precision is initialized from the currency.

[IntegrationEvent(False,False)]
local procedure OnAfterInitializeRoundingPrecision(var SalesHeader: Record "Sales Header"; var Currency: Record Currency)

Parameters

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

The sales header record being modified.

Currency Table Microsoft.Finance.Currency.Currency

The currency record used to initialize rounding precision.

OnAfterIsBillToAddressEqualToSellToAddress

Raised after checking if the bill-to address equals the sell-to address.

[IntegrationEvent(False,False)]
local procedure OnAfterIsBillToAddressEqualToSellToAddress(SellToSalesHeader: Record "Sales Header"; BillToSalesHeader: Record "Sales Header"; var Result: Boolean)

Parameters

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

The sales header with sell-to address information.

BillToSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header with bill-to address information.

Result Boolean

The result of the address comparison.

OnAfterCheckCreditLimitCondition

Raised after the credit limit check condition is evaluated.

[IntegrationEvent(False,False)]
local procedure OnAfterCheckCreditLimitCondition(var SalesHeader: Record "Sales Header"; var RunCheck: Boolean)

Parameters

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

The sales header record being checked.

RunCheck Boolean

Specifies whether to run the credit limit check.

OnAfterCheckCreditMaxBeforeInsert

Raised after the credit maximum is checked before inserting the sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterCheckCreditMaxBeforeInsert(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record being checked.

OnAfterCheckBillToCust

Raised after the bill-to customer is validated.

[IntegrationEvent(False,False)]
local procedure OnAfterCheckBillToCust(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; Customer: Record Customer)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

Customer Table Microsoft.Sales.Customer.Customer

The bill-to customer record.

OnAfterCheckSellToCust

Raised after the sell-to customer is validated.

[IntegrationEvent(False,False)]
local procedure OnAfterCheckSellToCust(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; Customer: Record Customer; CurrentFieldNo: Integer)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

Customer Table Microsoft.Sales.Customer.Customer

The sell-to customer record.

CurrentFieldNo Integer

The field number that triggered the validation.

OnAfterCheckShippingAdvice

Raised after the shipping advice is checked.

[IntegrationEvent(False,False)]
local procedure OnAfterCheckShippingAdvice(var SalesHeader: Record "Sales Header"; var Result: Boolean)

Parameters

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

The sales header record being checked.

Result Boolean

The result of the shipping advice check.

OnCheckShippingAdviceOnAfterSetLineFilters

[IntegrationEvent(False,False)]
local procedure OnCheckShippingAdviceOnAfterSetLineFilters(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header")

Parameters

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

OnAfterConfirmSalesPrice

Raised after the user confirms sales price changes.

[IntegrationEvent(False,False)]
local procedure OnAfterConfirmSalesPrice(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var RecalculateLines: Boolean)

Parameters

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

The sales header record being modified.

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

The sales line record affected by price changes.

RecalculateLines Boolean

Specifies whether to recalculate the sales lines.

OnAfterConfirmCurrencyFactorUpdate

Raised after the user confirms the currency factor update.

[IntegrationEvent(False,False)]
local procedure OnAfterConfirmCurrencyFactorUpdate(var SalesHeader: Record "Sales Header"; var Confirmed: Boolean)

Parameters

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

The sales header record being modified.

Confirmed Boolean

Specifies whether the user confirmed the update.

OnAfterCouldDimensionsBeKept

Raised after checking if dimensions could be kept when changing header fields.

[IntegrationEvent(False,False)]
local procedure OnAfterCouldDimensionsBeKept(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var Result: Boolean)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

Result Boolean

The result indicating if dimensions can be kept.

OnBeforeRecreateSalesLine

Raised before a sales line is recreated from temporary storage, allowing subscribers to replace the standard sales line creation.

[IntegrationEvent(False,False)]
local procedure OnBeforeRecreateSalesLine(var IsHandled: Boolean; var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header")

Parameters

Name Type Description
IsHandled Boolean

Set to true to skip the standard CreateSalesLine call.

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

The sales line record being recreated.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line used as source.

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

The parent sales header record.

OnAfterRecreateSalesLine

Raised after a sales line is recreated from temporary storage.

[IntegrationEvent(False,False)]
local procedure OnAfterRecreateSalesLine(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header")

Parameters

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

The recreated sales line record.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line used as source.

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

The parent sales header record.

OnAfterDeleteAllTempSalesLines

Raised after all temporary sales lines are deleted.

[IntegrationEvent(False,False)]
local procedure OnAfterDeleteAllTempSalesLines(SalesHeader: Record "Sales Header")

Parameters

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

The sales header record whose temporary lines were deleted.

OnAfterDeleteSalesLines

Raised after sales lines are deleted from the sales header.

[IntegrationEvent(True,False)]
local procedure OnAfterDeleteSalesLines(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header")

Parameters

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

The sales line record that was deleted.

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

The parent sales header record.

OnAfterInitFromSalesHeader

Raised after the sales header is initialized from another sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterInitFromSalesHeader(var SalesHeader: Record "Sales Header"; SourceSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being initialized.

SourceSalesHeader Table Microsoft.Sales.Document."Sales Header"

The source sales header used for initialization.

OnAfterInitFromBillToCustTemplate

Raised after the sales header is initialized from a bill-to customer template.

[IntegrationEvent(False,False)]
local procedure OnAfterInitFromBillToCustTemplate(var SalesHeader: Record "Sales Header"; BillToCustTemplate: Record "Customer Templ.")

Parameters

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

The sales header record being initialized.

BillToCustTemplate Table Microsoft.Sales.Customer."Customer Templ."

The customer template used for initialization.

OnAfterInsertTempSalesLine

Raised after a sales line is inserted into temporary storage.

[IntegrationEvent(False,False)]
local procedure OnAfterInsertTempSalesLine(SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)

Parameters

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

The sales line record being stored.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line record.

OnAfterIsApprovedForPosting

Raised after checking if the sales header is approved for posting.

[IntegrationEvent(False,False)]
local procedure OnAfterIsApprovedForPosting(SalesHeader: Record "Sales Header"; var Approved: Boolean)

Parameters

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

The sales header record being checked.

Approved Boolean

Specifies whether the sales header is approved for posting.

OnAfterIsApprovedForPostingBatch

Raised after checking if the sales header is approved for batch posting.

[IntegrationEvent(False,False)]
local procedure OnAfterIsApprovedForPostingBatch(SalesHeader: Record "Sales Header"; var Approved: Boolean)

Parameters

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

The sales header record being checked.

Approved Boolean

Specifies whether the sales header is approved for batch posting.

OnAfterGetNoSeriesCode

Raised after the number series code is retrieved for the sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterGetNoSeriesCode(var SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var NoSeriesCode: Code[20])

Parameters

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

The sales header record.

SalesReceivablesSetup Table Microsoft.Sales.Setup."Sales & Receivables Setup"

The sales and receivables setup record.

NoSeriesCode Code[20]

The number series code that was retrieved.

OnAfterGetPostingNoSeriesCode

Raised after the posting number series code is retrieved.

[IntegrationEvent(False,False)]
local procedure OnAfterGetPostingNoSeriesCode(SalesHeader: Record "Sales Header"; var PostingNos: Code[20])

Parameters

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

The sales header record.

PostingNos Code[20]

The posting number series code that was retrieved.

OnAfterGetPrepaymentPostingNoSeriesCode

Raised after the prepayment posting number series code is retrieved.

[IntegrationEvent(False,False)]
local procedure OnAfterGetPrepaymentPostingNoSeriesCode(SalesHeader: Record "Sales Header"; var PostingNos: Code[20])

Parameters

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

The sales header record.

PostingNos Code[20]

The prepayment posting number series code that was retrieved.

OnAfterGetSalesSetup

Raised after the sales and receivables setup is retrieved.

[IntegrationEvent(False,False)]
local procedure OnAfterGetSalesSetup(SalesHeader: Record "Sales Header"; var SalesReceivablesSetup: Record "Sales & Receivables Setup"; CalledByFieldNo: Integer)

Parameters

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

The sales header record.

SalesReceivablesSetup Table Microsoft.Sales.Setup."Sales & Receivables Setup"

The sales and receivables setup record that was retrieved.

CalledByFieldNo Integer

The field number that triggered the retrieval.

OnAfterGetDocTypeText

Raised after the document type text is retrieved.

[IntegrationEvent(False,False)]
local procedure OnAfterGetDocTypeText(var SalesHeader: Record "Sales Header"; var TypeText: Text[50])

Parameters

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

The sales header record.

TypeText Text[50]

The document type text that was retrieved.

OnAfterGetStatusStyleText

Raised after the status style text is retrieved.

[IntegrationEvent(False,False)]
local procedure OnAfterGetStatusStyleText(SalesHeader: Record "Sales Header"; var StatusStyleText: Text)

Parameters

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

The sales header record.

StatusStyleText Text

The status style text that was retrieved.

OnAfterOnInsert

Raised after the sales header record is inserted.

[IntegrationEvent(False,False)]
local procedure OnAfterOnInsert(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was inserted.

OnAfterHasDifferentSellToAddress

Raised after checking if the sales header has a different sell-to address than the customer.

[IntegrationEvent(False,False)]
local procedure OnAfterHasDifferentSellToAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer; var Result: Boolean)

Parameters

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

The sales header record being checked.

Customer Table Microsoft.Sales.Customer.Customer

The customer record to compare with.

Result Boolean

The result of the address comparison.

OnAfterHasDifferentBillToAddress

Raised after checking if the sales header has a different bill-to address than the customer.

[IntegrationEvent(False,False)]
local procedure OnAfterHasDifferentBillToAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer; var Result: Boolean)

Parameters

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

The sales header record being checked.

Customer Table Microsoft.Sales.Customer.Customer

The customer record to compare with.

Result Boolean

The result of the address comparison.

OnAfterHasDifferentShipToAddress

Raised after checking if the sales header has a different ship-to address than the customer.

[IntegrationEvent(False,False)]
local procedure OnAfterHasDifferentShipToAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer; var Result: Boolean)

Parameters

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

The sales header record being checked.

Customer Table Microsoft.Sales.Customer.Customer

The customer record to compare with.

Result Boolean

The result of the address comparison.

OnAfterSalesLinesEditable

Raised after determining if the sales lines are editable.

[IntegrationEvent(False,False)]
local procedure OnAfterSalesLinesEditable(SalesHeader: Record "Sales Header"; var IsEditable: Boolean)

Parameters

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

The sales header record.

IsEditable Boolean

Specifies whether the sales lines are editable.

OnAfterTestNoSeries

Raised after testing the number series for the sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterTestNoSeries(var SalesHeader: Record "Sales Header"; var SalesReceivablesSetup: Record "Sales & Receivables Setup")

Parameters

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

The sales header record being tested.

SalesReceivablesSetup Table Microsoft.Sales.Setup."Sales & Receivables Setup"

The sales and receivables setup record.

OnAfterUpdateShipToAddress

Raised after the ship-to address is updated on the sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateShipToAddress(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; Location: Record Location; CompanyInformation: Record "Company Information")

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the update.

Location Table Microsoft.Inventory.Location.Location

The location record used for the update.

CompanyInformation Table Microsoft.Foundation.Company."Company Information"

The company information record used for the update.

OnAfterUpdateCurrencyFactor

Raised after the currency factor is updated on the sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; HideValidationDialog: Boolean)

Parameters

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

The sales header record being modified.

HideValidationDialog Boolean

Specifies whether to hide the validation dialog.

OnAfterAppliesToDocNoOnLookup

Raised after looking up the applies-to document number.

[IntegrationEvent(False,False)]
local procedure OnAfterAppliesToDocNoOnLookup(var SalesHeader: Record "Sales Header"; CustLedgerEntry: Record "Cust. Ledger Entry")

Parameters

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

The sales header record.

CustLedgerEntry Table Microsoft.Sales.Receivables."Cust. Ledger Entry"

The customer ledger entry selected from the lookup.

OnUpdateSalesLineByChangedFieldName

Raised during sales line update when a field changes by name.

[IntegrationEvent(False,False)]
local procedure OnUpdateSalesLineByChangedFieldName(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ChangedFieldName: Text[100]; ChangedFieldNo: Integer; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

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

The sales line record being updated.

ChangedFieldName Text[100]

The name of the changed field.

ChangedFieldNo Integer

The number of the changed field.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnUpdateSalesLinesByFieldNoOnAfterSalesLineSetFilters

Raised after filters are set on sales lines during update by field number.

[IntegrationEvent(False,False)]
local procedure OnUpdateSalesLinesByFieldNoOnAfterSalesLineSetFilters(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ChangedFieldNo: Integer)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

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

The sales line record with filters applied.

ChangedFieldNo Integer

The number of the changed field.

OnUpdateSalesLineAmountsOnAfterSalesHeaderModify

Raised after the sales header is modified during sales line amounts update.

[IntegrationEvent(False,False)]
local procedure OnUpdateSalesLineAmountsOnAfterSalesHeaderModify(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")

Parameters

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

The sales header record that was modified.

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

The sales line record being updated.

OnUpdateShipToContactOnBeforeValidateShipToContact

Raised before validating the ship-to contact during ship-to contact update.

[IntegrationEvent(False,False)]
local procedure OnUpdateShipToContactOnBeforeValidateShipToContact(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the update.

IsHandled Boolean

Set to true to skip the default validation logic.

OnUpdateOpportunityOnBeforeModify

Raised before modifying the opportunity during opportunity update.

[IntegrationEvent(False,False)]
local procedure OnUpdateOpportunityOnBeforeModify(var Opportunity: Record Opportunity; var SalesHeader: Record "Sales Header")

Parameters

Name Type Description
Opportunity Table Microsoft.CRM.Opportunity.Opportunity

The opportunity record being modified.

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

The related sales header record.

OnUpdateOpportunityLinkOnBeforeModify

Raised before modifying the opportunity during opportunity link update.

[IntegrationEvent(False,False)]
local procedure OnUpdateOpportunityLinkOnBeforeModify(var Opportunity: Record Opportunity; var SalesHeader: Record "Sales Header"; SalesDocumentType: Option; SalesHeaderNo: Code[20])

Parameters

Name Type Description
Opportunity Table Microsoft.CRM.Opportunity.Opportunity

The opportunity record being modified.

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

The related sales header record.

SalesDocumentType Option

The sales document type option value.

SalesHeaderNo Code[20]

The sales header document number.

OnValidateShortcutDimCodeOnBeforeUpdateAllLineDim

Raised before updating all line dimensions during shortcut dimension code validation.

[IntegrationEvent(False,False)]
local procedure OnValidateShortcutDimCodeOnBeforeUpdateAllLineDim(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNumber: Integer)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

FieldNumber Integer

The shortcut dimension field number being validated.

OnAfterValidateShortcutDimCode

Raised after the shortcut dimension code is validated.

[IntegrationEvent(False,False)]
local procedure OnAfterValidateShortcutDimCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNumber: Integer; var ShortcutDimCode: Code[20])

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

FieldNumber Integer

The shortcut dimension field number that was validated.

ShortcutDimCode Code[20]

The shortcut dimension code value.

OnAfterCreateSalesLine

Raised after a sales line is created from temporary storage.

[IntegrationEvent(False,False)]
local procedure OnAfterCreateSalesLine(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)

Parameters

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

The created sales line record.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line used as source.

OnAfterIsShipToAddressEqualToSellToAddress

Raised after checking if the ship-to address equals the sell-to address.

[IntegrationEvent(False,False)]
local procedure OnAfterIsShipToAddressEqualToSellToAddress(SellToSalesHeader: Record "Sales Header"; ShipToSalesHeader: Record "Sales Header"; var Result: Boolean)

Parameters

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

The sales header with sell-to address information.

ShipToSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header with ship-to address information.

Result Boolean

The result of the address comparison.

OnAfterSalesQuoteAccepted

Raised after a sales quote is accepted.

[IntegrationEvent(False,False)]
local procedure OnAfterSalesQuoteAccepted(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was accepted.

OnAfterChangePricesIncludingVAT

Raised after the Prices Including VAT field is changed.

[IntegrationEvent(False,False)]
local procedure OnAfterChangePricesIncludingVAT(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was modified.

OnAfterSelltoCustomerNoOnAfterValidate

Raised after the sell-to customer number is validated.

[IntegrationEvent(False,False)]
local procedure OnAfterSelltoCustomerNoOnAfterValidate(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnAfterSendSalesHeader

Raised after the sales header is sent.

[IntegrationEvent(False,False)]
local procedure OnAfterSendSalesHeader(var SalesHeader: Record "Sales Header"; ShowDialog: Boolean)

Parameters

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

The sales header record that was sent.

ShowDialog Boolean

Specifies whether a dialog was shown during sending.

OnAfterSetApplyToFilters

Raised after filters are set for applying customer ledger entries.

[IntegrationEvent(False,False)]
local procedure OnAfterSetApplyToFilters(var CustLedgerEntry: Record "Cust. Ledger Entry"; SalesHeader: Record "Sales Header")

Parameters

Name Type Description
CustLedgerEntry Table Microsoft.Sales.Receivables."Cust. Ledger Entry"

The customer ledger entry record with filters applied.

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

The sales header record.

OnAfterSetFieldsBilltoCustomer

Raised after bill-to customer fields are set on the sales header.

[IntegrationEvent(False,False)]
local procedure OnAfterSetFieldsBilltoCustomer(var SalesHeader: Record "Sales Header"; Customer: Record Customer; xSalesHeader: Record "Sales Header"; SkipBillToContact: Boolean; CUrrentFieldNo: Integer)

Parameters

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

The sales header record being modified.

Customer Table Microsoft.Sales.Customer.Customer

The bill-to customer record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

SkipBillToContact Boolean

Specifies whether to skip bill-to contact update.

CUrrentFieldNo Integer

The field number that triggered the update.

OnBeforeUpdateSetupOnBillToCustomerChangeInSalesHeader

Raised before updating the VAT registration setup on a bill-to customer change in the sales header.

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

Parameters

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

The sales header record being modified.

BillToCustomer Table Microsoft.Sales.Customer.Customer

The bill-to customer record.

IsHandled Boolean

Set to true to skip the standard update of the VAT registration setup.

OnAfterTransferExtendedTextForSalesLineRecreation

Raised after extended text is transferred for sales line recreation.

[IntegrationEvent(False,False)]
local procedure OnAfterTransferExtendedTextForSalesLineRecreation(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)

Parameters

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

The sales line record receiving extended text.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line with extended text.

OnAfterCopyFromNewSellToCustTemplate

Raised after copying fields from a new sell-to customer template.

[IntegrationEvent(False,False)]
local procedure OnAfterCopyFromNewSellToCustTemplate(var SalesHeader: Record "Sales Header"; SellToCustTemplate: Record "Customer Templ.")

Parameters

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

The sales header record being modified.

SellToCustTemplate Table Microsoft.Sales.Customer."Customer Templ."

The customer template used for copying.

OnAfterCopySellToAddressToShipToAddress

Raised after the sell-to address is copied to the ship-to address.

[IntegrationEvent(False,False)]
local procedure OnAfterCopySellToAddressToShipToAddress(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was modified.

OnAfterCopySellToAddressToBillToAddress

Raised after the sell-to address is copied to the bill-to address.

[IntegrationEvent(False,False)]
local procedure OnAfterCopySellToAddressToBillToAddress(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was modified.

OnAfterCopySellToCustomerAddressFieldsFromCustomer

Raised after sell-to customer address fields are copied from the customer.

[IntegrationEvent(False,False)]
local procedure OnAfterCopySellToCustomerAddressFieldsFromCustomer(var SalesHeader: Record "Sales Header"; SellToCustomer: Record Customer; CurrentFieldNo: Integer; var SkipBillToContact: Boolean; var SkipSellToContact: Boolean)

Parameters

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

The sales header record being modified.

SellToCustomer Table Microsoft.Sales.Customer.Customer

The sell-to customer record used as source.

CurrentFieldNo Integer

The field number that triggered the copy.

SkipBillToContact Boolean

Specifies whether to skip bill-to contact update.

SkipSellToContact Boolean

Specifies whether to skip sell-to contact update.

OnAfterCopyShipToCustomerAddressFieldsFromCustomer

Raised after ship-to customer address fields are copied from the customer.

[IntegrationEvent(False,False)]
local procedure OnAfterCopyShipToCustomerAddressFieldsFromCustomer(var SalesHeader: Record "Sales Header"; SellToCustomer: Record Customer; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being modified.

SellToCustomer Table Microsoft.Sales.Customer.Customer

The customer record used as source.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnAfterCopyShipToCustomerAddressFieldsFromShipToAddr

Raised after ship-to customer address fields are copied from a ship-to address.

[IntegrationEvent(False,False)]
local procedure OnAfterCopyShipToCustomerAddressFieldsFromShipToAddr(var SalesHeader: Record "Sales Header"; ShipToAddress: Record "Ship-to Address"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being modified.

ShipToAddress Table Microsoft.Sales.Customer."Ship-to Address"

The ship-to address record used as source.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnAfterUpdateSalesLinesByFieldNo

Raised after sales lines are updated by field number.

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateSalesLinesByFieldNo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldNo: Integer)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

ChangedFieldNo Integer

The field number that triggered the update.

OnBeforeAssistEdit

Raised before the assist edit function is executed.

[IntegrationEvent(False,False)]
local procedure OnBeforeAssistEdit(var SalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; var IsHandled: Boolean; var Result: Boolean)

Parameters

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

The sales header record being modified.

OldSalesHeader Table Microsoft.Sales.Document."Sales Header"

The original sales header record.

IsHandled Boolean

Set to true to skip the default assist edit logic.

Result Boolean

The result of the assist edit operation.

OnBeforeCheckAvailableCreditLimit

Raised before checking the available credit limit.

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

Parameters

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

The sales header record being checked.

ReturnValue Decimal

The available credit limit value.

IsHandled Boolean

Set to true to skip the default credit limit check.

OnBeforeCheckCreditLimit

Raised before checking the customer credit limit.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckCreditLimit(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being checked.

IsHandled Boolean

Set to true to skip the default credit limit check.

OnBeforeCheckCreditMaxBeforeInsert

Raised before checking the credit maximum before inserting the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckCreditMaxBeforeInsert(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; HideCreditCheckDialogue: Boolean; FilterCustNo: Code[20]; FilterContNo: Code[20])

Parameters

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

The sales header record being checked.

IsHandled Boolean

Set to true to skip the default credit check.

HideCreditCheckDialogue Boolean

Specifies whether to hide the credit check dialog.

FilterCustNo Code[20]

The customer number filter.

FilterContNo Code[20]

The contact number filter.

OnBeforeCheckCreditLimitIfLineNotInsertedYet

Raised before checking the credit limit when no sales line is inserted yet.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckCreditLimitIfLineNotInsertedYet(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being checked.

IsHandled Boolean

Set to true to skip the default credit limit check.

OnBeforeCheckCustomerContactRelation

Raised before checking the customer-contact relation.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckCustomerContactRelation(var SalesHeader: Record "Sales Header"; Cont: Record Contact; var IsHandled: Boolean; CustomerNo: Code[20]; ContBusinessRelationNo: Code[20])

Parameters

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

The sales header record being checked.

Cont Table Microsoft.CRM.Contact.Contact

The contact record being validated.

IsHandled Boolean

Set to true to skip the default relation check.

CustomerNo Code[20]

The customer number being validated.

ContBusinessRelationNo Code[20]

The contact business relation number.

OnBeforeCheckNoAndShowConfirm

Raised before checking document numbers and showing a confirmation dialog.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckNoAndShowConfirm(SalesHeader: Record "Sales Header"; var SalesShptHeader: Record "Sales Shipment Header"; var SalesInvHeader: Record "Sales Invoice Header"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var ReturnRcptHeader: Record "Return Receipt Header"; var SalesInvHeaderPrePmt: Record "Sales Invoice Header"; var SalesCrMemoHeaderPrePmt: Record "Sales Cr.Memo Header"; SourceCode: Record "Source Code"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being checked.

SalesShptHeader Table Microsoft.Sales.History."Sales Shipment Header"

The sales shipment header record.

SalesInvHeader Table Microsoft.Sales.History."Sales Invoice Header"

The sales invoice header record.

SalesCrMemoHeader Table Microsoft.Sales.History."Sales Cr.Memo Header"

The sales credit memo header record.

ReturnRcptHeader Table Microsoft.Sales.History."Return Receipt Header"

The return receipt header record.

SalesInvHeaderPrePmt Table Microsoft.Sales.History."Sales Invoice Header"

The prepayment sales invoice header record.

SalesCrMemoHeaderPrePmt Table Microsoft.Sales.History."Sales Cr.Memo Header"

The prepayment sales credit memo header record.

SourceCode Table Microsoft.Foundation.AuditCodes."Source Code"

The source code record.

Result Boolean

The result of the check.

IsHandled Boolean

Set to true to skip the default check logic.

OnBeforeCheckPrepmtInfo

Raised before checking prepayment information on the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckPrepmtInfo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var IsHandled: Boolean)

Parameters

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

The sales header record being checked.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

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

The sales line record being checked.

IsHandled Boolean

Set to true to skip the default prepayment check.

OnBeforeCheckReturnInfo

Raised before checking return information on the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckReturnInfo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; BillTo: Boolean)

Parameters

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

The sales header record being checked.

IsHandled Boolean

Set to true to skip the default return info check.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

BillTo Boolean

Specifies whether checking bill-to information.

OnBeforeCheckShipmentInfo

Raised before checking shipment information on the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckShipmentInfo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; BillTo: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being checked.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

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

The sales line record being checked.

BillTo Boolean

Specifies whether checking bill-to information.

IsHandled Boolean

Set to true to skip the default shipment check.

OnBeforeCheckShippingAdvice

Raised before checking the shipping advice on the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckShippingAdvice(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being checked.

IsHandled Boolean

Set to true to skip the default shipping advice check.

OnBeforeCreateDimensionsFromValidateBillToCustomerNo

Raised before creating dimensions from bill-to customer number validation.

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateDimensionsFromValidateBillToCustomerNo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

IsHandled Boolean

Set to true to skip the default dimension creation.

OnBeforeCreateDimensionsFromValidateSalesPersonCode

Raised before creating dimensions from salesperson code validation.

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateDimensionsFromValidateSalesPersonCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

IsHandled Boolean

Set to true to skip the default dimension creation.

OnBeforeCofirmClearOpportunityNo

Raised before confirming to clear the opportunity number.

[IntegrationEvent(False,False)]
local procedure OnBeforeCofirmClearOpportunityNo(Opportunity: Record Opportunity; var Confirmed: Boolean; var IsHandled: Boolean)

Parameters

Name Type Description
Opportunity Table Microsoft.CRM.Opportunity.Opportunity

The opportunity record being cleared.

Confirmed Boolean

The user confirmation result.

IsHandled Boolean

Set to true to skip the default confirmation dialog.

OnBeforeConfirmKeepExistingDimensions

Raised before confirming whether to keep existing dimensions.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmKeepExistingDimensions(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNo: Integer; OldDimSetID: Integer; var Confirmed: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

FieldNo Integer

The field number that triggered the dimension change.

OldDimSetID Integer

The old dimension set ID.

Confirmed Boolean

The user confirmation result.

IsHandled Boolean

Set to true to skip the default confirmation dialog.

OnBeforeConfirmUpdateAllLineDim

Raised before confirming to update all line dimensions.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmUpdateAllLineDim(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; NewParentDimSetID: Integer; OldParentDimSetID: Integer; var Confirmed: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

NewParentDimSetID Integer

The new parent dimension set ID.

OldParentDimSetID Integer

The old parent dimension set ID.

Confirmed Boolean

The user confirmation result.

IsHandled Boolean

Set to true to skip the default confirmation dialog.

OnBeforeConfirmBillToContactNoChange

Raised before confirming the bill-to contact number change.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmBillToContactNoChange(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var Confirmed: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the change.

Confirmed Boolean

The user confirmation result.

IsHandled Boolean

Set to true to skip the default confirmation dialog.

OnBeforeConfirmSellToContactNoChange

Raised before confirming the sell-to contact number change.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmSellToContactNoChange(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var Confirmed: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the change.

Confirmed Boolean

The user confirmation result.

IsHandled Boolean

Set to true to skip the default confirmation dialog.

OnBeforeConfirmUpdateCurrencyFactor

Raised before confirming the currency factor update.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; var HideValidationDialog: Boolean; var xSalesHeader: Record "Sales Header"; var IsHandled: Boolean; var ForceConfirm: Boolean)

Parameters

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

The sales header record being modified.

HideValidationDialog Boolean

Specifies whether to hide the validation dialog.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

IsHandled Boolean

Set to true to skip the default confirmation dialog.

ForceConfirm Boolean

Specifies whether to force the confirmation.

OnBeforeGetContactAsCompany

Raised before getting the contact as a company.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetContactAsCompany(Contact: Record Contact; var SearchContact: Record Contact; var IsHandled: Boolean)

Parameters

Name Type Description
Contact Table Microsoft.CRM.Contact.Contact

The contact record to search.

SearchContact Table Microsoft.CRM.Contact.Contact

The contact record used for searching.

IsHandled Boolean

Set to true to skip the default search logic.

OnBeforeConfirmDeletion

Raised before confirming deletion of the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmDeletion(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record to be deleted.

Result Boolean

The result of the deletion confirmation.

IsHandled Boolean

Set to true to skip the default confirmation dialog.

OnBeforeCopyShipToCustomerAddressFieldsFromCustomer

Raised before copying ship-to customer address fields from the customer.

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

Parameters

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

The sales header record being modified.

Customer Table Microsoft.Sales.Customer.Customer

The customer record used as source.

IsHandled Boolean

Set to true to skip the default copy logic.

OnBeforeCopySellToCustomerAddressFieldsFromCustomer

Raised before copying sell-to customer address fields from the customer.

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

Parameters

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

The sales header record being modified.

Customer Table Microsoft.Sales.Customer.Customer

The customer record used as source.

IsHandled Boolean

Set to true to skip the default copy logic.

OnBeforeCopySellToAddressToBillToAddress

Raised before copying the sell-to address to the bill-to address.

[IntegrationEvent(False,False)]
local procedure OnBeforeCopySellToAddressToBillToAddress(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record being modified.

OnBeforeCopyShipToCustomerAddressFieldsFromShipToAddr

Raised before copying ship-to customer address fields from a ship-to address.

[IntegrationEvent(False,False)]
local procedure OnBeforeCopyShipToCustomerAddressFieldsFromShipToAddr(var SalesHeader: Record "Sales Header"; var ShipToAddress: Record "Ship-to Address"; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

ShipToAddress Table Microsoft.Sales.Customer."Ship-to Address"

The ship-to address record used as source.

IsHandled Boolean

Set to true to skip the default copy logic.

OnBeforeCreateCustomerFromSellToCustomerTemplate

Raised before creating a customer from the sell-to customer template.

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateCustomerFromSellToCustomerTemplate(var SalesHeader: Record "Sales Header"; var Cont: Record Contact; var IsHandled: Boolean)

Parameters

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

The sales header record.

Cont Table Microsoft.CRM.Contact.Contact

The contact record associated with the customer.

IsHandled Boolean

Set to true to skip the default customer creation.

OnBeforeCreateCustomerFromBillToCustomerTemplate

Raised before creating a customer from the bill-to customer template.

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateCustomerFromBillToCustomerTemplate(var SalesHeader: Record "Sales Header"; var Cont: Record Contact; var IsHandled: Boolean)

Parameters

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

The sales header record.

Cont Table Microsoft.CRM.Contact.Contact

The contact record associated with the customer.

IsHandled Boolean

Set to true to skip the default customer creation.

OnBeforeCreateSalesLine

Raised before creating a sales line from temporary storage.

[IntegrationEvent(True,False)]
local procedure OnBeforeCreateSalesLine(var TempSalesLine: Record "Sales Line" temporary; var IsHandled: Boolean; var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")

Parameters

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

The temporary sales line used as source.

IsHandled Boolean

Set to true to skip the default sales line creation.

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

The parent sales header record.

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

The sales line record being created.

OnBeforeCreateDim

Raised before creating dimensions for the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateDim(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])

Parameters

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

The sales header record being modified.

IsHandled Boolean

Set to true to skip the default dimension creation.

DefaultDimSource List of [Dictionary of [Integer, Code[20]]]

The list of default dimension sources.

OnBeforeCreateInvtPutAwayPick

Raised before creating inventory put-away or pick documents.

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateInvtPutAwayPick(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

OnBeforeDeleteSalesLines

Raised before deleting sales lines from the sales header.

[IntegrationEvent(True,False)]
local procedure OnBeforeDeleteSalesLines(var SalesLine: Record "Sales Line"; var IsHandled: Boolean; var SalesHeader: Record "Sales Header")

Parameters

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

The sales line record to be deleted.

IsHandled Boolean

Set to true to skip the default deletion logic.

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

The parent sales header record.

OnBeforeDeleteRecordInApprovalRequest

Raised before deleting the record in the approval request.

[IntegrationEvent(True,False)]
local procedure OnBeforeDeleteRecordInApprovalRequest(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default deletion logic.

OnBeforeEnsureDocumentTypeIsQuote

Raised before ensuring the document type is Quote.

[IntegrationEvent(False,False)]
local procedure OnBeforeEnsureDocumentTypeIsQuote(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being checked.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the check.

IsHandled Boolean

Set to true to skip the default document type check.

OnBeforeGetCust

Raised before getting the customer record.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetCust(var SalesHeader: Record "Sales Header"; var Customer: Record Customer; CustNo: Code[20])

Parameters

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

The sales header record.

Customer Table Microsoft.Sales.Customer.Customer

The customer record being retrieved.

CustNo Code[20]

The customer number to retrieve.

OnBeforeGetCustomerVATRegistrationNumber

Raised before getting the customer VAT registration number.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetCustomerVATRegistrationNumber(var SalesHeader: Record "Sales Header"; var ReturnValue: Text; var IsHandled: Boolean)

Parameters

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

The sales header record.

ReturnValue Text

The VAT registration number value.

IsHandled Boolean

Set to true to skip the default retrieval logic.

OnBeforeGetCustomerVATRegistrationNumberLbl

Raised before getting the customer VAT registration number label.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetCustomerVATRegistrationNumberLbl(var SalesHeader: Record "Sales Header"; var ReturnValue: Text; var IsHandled: Boolean)

Parameters

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

The sales header record.

ReturnValue Text

The VAT registration number label value.

IsHandled Boolean

Set to true to skip the default retrieval logic.

OnBeforeGetNoSeriesCode

Raised before getting the number series code for the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetNoSeriesCode(var SalesHeader: Record "Sales Header"; SalesSetup: Record "Sales & Receivables Setup"; var NoSeriesCode: Code[20]; var IsHandled: Boolean)

Parameters

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

The sales header record.

SalesSetup Table Microsoft.Sales.Setup."Sales & Receivables Setup"

The sales and receivables setup record.

NoSeriesCode Code[20]

The number series code being retrieved.

IsHandled Boolean

Set to true to skip the default retrieval logic.

OnBeforeGetPstdDocLinesToReverse

Raised before getting posted document lines to reverse.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetPstdDocLinesToReverse(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default retrieval logic.

OnBeforeGetPostingNoSeriesCode

Raised before getting the posting number series code.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetPostingNoSeriesCode(var SalesHeader: Record "Sales Header"; SalesSetup: Record "Sales & Receivables Setup"; var NoSeriesCode: Code[20]; var IsHandled: Boolean)

Parameters

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

The sales header record.

SalesSetup Table Microsoft.Sales.Setup."Sales & Receivables Setup"

The sales and receivables setup record.

NoSeriesCode Code[20]

The posting number series code being retrieved.

IsHandled Boolean

Set to true to skip the default retrieval logic.

OnBeforeGetShippingTime

Raised before getting the shipping time for the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetShippingTime(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var CalledByFieldNo: Integer; var IsHandled: Boolean; CurrentFieldNo: Integer)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CalledByFieldNo Integer

The field number that triggered the retrieval.

IsHandled Boolean

Set to true to skip the default retrieval logic.

CurrentFieldNo Integer

The current field number being processed.

OnBeforeGetShipmentMethodCode

Raised before getting the shipment method code.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetShipmentMethodCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default retrieval logic.

OnBeforeInitFromSalesHeader

Raised before initializing the sales header from another sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeInitFromSalesHeader(var SalesHeader: Record "Sales Header"; SourceSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being initialized.

SourceSalesHeader Table Microsoft.Sales.Document."Sales Header"

The source sales header used for initialization.

IsHandled Boolean

Set to true to skip the default initialization logic.

OnBeforeInitInsert

Raised before initializing the sales header during insert.

[IntegrationEvent(False,False)]
local procedure OnBeforeInitInsert(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being initialized.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

IsHandled Boolean

Set to true to skip the default initialization logic.

OnBeforeInitPostingDescription

Raised before initializing the posting description.

[IntegrationEvent(False,False)]
local procedure OnBeforeInitPostingDescription(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being initialized.

IsHandled Boolean

Set to true to skip the default initialization logic.

OnBeforeInitRecord

Raised before initializing the sales header record.

[IntegrationEvent(False,False)]
local procedure OnBeforeInitRecord(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being initialized.

IsHandled Boolean

Set to true to skip the default initialization logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnBeforeIsCreditDocType

Raised before checking if the document type is a credit document.

[IntegrationEvent(False,False)]
local procedure OnBeforeIsCreditDocType(SalesHeader: Record "Sales Header"; var CreditDocType: Boolean)

Parameters

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

The sales header record being checked.

CreditDocType Boolean

Specifies whether the document is a credit document type.

OnBeforeIsApprovedForPosting

Raised before checking if the sales header is approved for posting.

[IntegrationEvent(False,False)]
local procedure OnBeforeIsApprovedForPosting(var SalesHeader: Record "Sales Header"; var Approved: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being checked.

Approved Boolean

Specifies whether the sales header is approved.

IsHandled Boolean

Set to true to skip the default approval check.

OnBeforeIsApprovedForPostingBatch

Raised before checking if the sales header is approved for batch posting.

[IntegrationEvent(False,False)]
local procedure OnBeforeIsApprovedForPostingBatch(var SalesHeader: Record "Sales Header"; var Approved: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being checked.

Approved Boolean

Specifies whether the sales header is approved for batch posting.

IsHandled Boolean

Set to true to skip the default approval check.

OnBeforeLookupAppliesToDocNo

Raised before looking up the applies-to document number.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupAppliesToDocNo(var SalesHeader: Record "Sales Header"; var CustLedgEntry: Record "Cust. Ledger Entry"; var IsHandled: Boolean)

Parameters

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

The sales header record.

CustLedgEntry Table Microsoft.Sales.Receivables."Cust. Ledger Entry"

The customer ledger entry record for lookup.

IsHandled Boolean

Set to true to skip the default lookup logic.

OnBeforeLookupBillToPostCode

Raised before looking up the bill-to post code.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupBillToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for lookup.

OnBeforeLookupBillToCity

Raised before looking up the bill-to city.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupBillToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for lookup.

OnBeforeLookupContact

Raised before looking up the contact.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupContact(CustomerNo: Code[20]; ContactNo: Code[20]; var Contact: Record Contact; var IsHandled: Boolean)

Parameters

Name Type Description
CustomerNo Code[20]

The customer number for the contact lookup.

ContactNo Code[20]

The contact number for the lookup.

Contact Table Microsoft.CRM.Contact.Contact

The contact record for lookup.

IsHandled Boolean

Set to true to skip the default lookup logic.

OnBeforeLookupSelltoContact

Raised before looking up the sell-to contact.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupSelltoContact(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

IsHandled Boolean

Set to true to skip the default lookup logic.

OnBeforeLookupSellToContactNo

Raised before looking up the sell-to contact number.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupSellToContactNo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean; var Result: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

IsHandled Boolean

Set to true to skip the default lookup logic.

Result Boolean

The result of the lookup operation.

OnBeforeLookupSellToCity

Raised before looking up the sell-to city.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupSellToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for lookup.

OnBeforeLookupSellToPostCode

Raised before looking up the sell-to post code.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupSellToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for lookup.

OnAfterLookupShipToCity

Raised after looking up the ship-to city.

[IntegrationEvent(False,False)]
local procedure OnAfterLookupShipToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record from the lookup.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnBeforeLookupShipToCity

Raised before looking up the ship-to city.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupShipToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for lookup.

OnAfterLookupShipToPostCode

Raised after looking up the ship-to post code.

[IntegrationEvent(False,False)]
local procedure OnAfterLookupShipToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record from the lookup.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnAfterLookupBillToPostCode

Raised after looking up the bill-to post code.

[IntegrationEvent(False,False)]
local procedure OnAfterLookupBillToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record from the lookup.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnAfterLookupBillToCity

Raised after looking up the bill-to city.

[IntegrationEvent(False,False)]
local procedure OnAfterLookupBillToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record from the lookup.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnAfterLookupSellToPostCode

Raised after looking up the sell-to post code.

[IntegrationEvent(False,False)]
local procedure OnAfterLookupSellToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record from the lookup.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnAfterLookupSellToCity

Raised after looking up the sell-to city.

[IntegrationEvent(False,False)]
local procedure OnAfterLookupSellToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record from the lookup.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnBeforeLookupShipToPostCode

Raised before looking up the ship-to post code.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupShipToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")

Parameters

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

The sales header record.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for lookup.

OnBeforeLookupShippingNoSeries

Raised before looking up the shipping number series.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupShippingNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default lookup logic.

OnBeforeLookupReturnReceiptNoSeries

Raised before looking up the return receipt number series.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupReturnReceiptNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default lookup logic.

OnBeforeQtyToShipIsZero

Raised before checking if the quantity to ship is zero.

[IntegrationEvent(False,False)]
local procedure OnBeforeQtyToShipIsZero(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

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

The sales line record being checked.

Result Boolean

The result of the check.

IsHandled Boolean

Set to true to skip the default check logic.

OnBeforeShowDocDim

Raised before showing the document dimensions.

[IntegrationEvent(False,False)]
local procedure OnBeforeShowDocDim(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

IsHandled Boolean

Set to true to skip the default dimension display.

OnBeforeShowInteractionLogEntries

Raised before showing interaction log entries.

[IntegrationEvent(False,False)]
local procedure OnBeforeShowInteractionLogEntries(var InteractionLogEntry: Record "Interaction Log Entry")

Parameters

Name Type Description
InteractionLogEntry Table Microsoft.CRM.Interaction."Interaction Log Entry"

The interaction log entry record to display.

OnBeforeShouldSearchForCustomerByName

Raised before determining if the customer should be searched by name.

[IntegrationEvent(False,False)]
local procedure OnBeforeShouldSearchForCustomerByName(CustomerNo: Code[20]; var Result: Boolean; var IsHandled: Boolean; var CallingFieldNo: Integer; var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

Name Type Description
CustomerNo Code[20]

The customer number being searched.

Result Boolean

The result of the search decision.

IsHandled Boolean

Set to true to skip the default search logic.

CallingFieldNo Integer

The field number that triggered the search.

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnBeforeTransferItemChargeAssgntSalesToTemp

Raised before transferring item charge assignments to temporary storage.

[IntegrationEvent(False,False)]
local procedure OnBeforeTransferItemChargeAssgntSalesToTemp(var SalesHeader: Record "Sales Header"; var ItemChargeAssgntSales: Record "Item Charge Assignment (Sales)"; var TempItemChargeAssgntSales: Record "Item Charge Assignment (Sales)" temporary; var IsHandled: Boolean)

Parameters

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

The sales header record.

ItemChargeAssgntSales Table Microsoft.Sales.Document."Item Charge Assignment (Sales)"

The item charge assignment record.

TempItemChargeAssgntSales Table Microsoft.Sales.Document."Item Charge Assignment (Sales)"

The temporary item charge assignment record.

IsHandled Boolean

Set to true to skip the default transfer logic.

OnBeforeUpdateCurrencyFactor

Raised before updating the currency factor.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; var Updated: Boolean; var CurrencyExchangeRate: Record "Currency Exchange Rate"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being modified.

Updated Boolean

Specifies whether the currency factor was updated.

CurrencyExchangeRate Table Microsoft.Finance.Currency."Currency Exchange Rate"

The currency exchange rate record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnBeforeUpdateBillToCont

Raised before updating the bill-to contact.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateBillToCont(var SalesHeader: Record "Sales Header"; CustomerNo: Code[20]; var SkipBillToContact: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

CustomerNo Code[20]

The customer number.

SkipBillToContact Boolean

Specifies whether to skip the bill-to contact update.

IsHandled Boolean

Set to true to skip the default update logic.

OnBeforeUpdateSellToEmail

Raised before updating the sell-to email from the contact.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateSellToEmail(var SalesHeader: Record "Sales Header"; Contact: Record Contact; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

Contact Table Microsoft.CRM.Contact.Contact

The contact record with email information.

IsHandled Boolean

Set to true to skip the default email update.

OnBeforeValidateBillToCity

Raised before validating the bill-to city.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateBillToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for validation.

CurrentFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateBillToPostCode

Raised before validating the bill-to post code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateBillToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for validation.

CurrentFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateDocumentDate

Raised before validating the document date.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateDocumentDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidatePromisedDeliveryDate

Raised before validating the promised delivery date.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidatePromisedDeliveryDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateLocationCode

Raised before validating the location code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateLocationCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidatePaymentTermsCode

Raised before validating the payment terms code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidatePaymentTermsCode(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CallingFieldNo: Integer; UpdateDocumentDate: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CallingFieldNo Integer

The field number that triggered the validation.

UpdateDocumentDate Boolean

Specifies whether to update the document date.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateReturnReceiptNoSeries

Raised before validating the return receipt number series.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateReturnReceiptNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateSellToCity

Raised before validating the sell-to city.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateSellToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for validation.

CurrentFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateSellToPostCode

Raised before validating the sell-to post code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateSellToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean; var DoExit: Boolean)

Parameters

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

The sales header record being validated.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for validation.

CurrentFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default validation logic.

DoExit Boolean

Specifies whether to exit after handling.

OnBeforeValidateShipToCity

Raised before validating the ship-to city.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShipToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for validation.

CurrentFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateShipToPostCode

Raised before validating the ship-to post code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShipToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

PostCodeRec Table Microsoft.Foundation.Address."Post Code"

The post code record for validation.

CurrentFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateVATRegistrationNo

Raised before validating the VAT registration number.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateVATRegistrationNo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateRequestedDeliveryDate

Raised before validating the requested delivery date.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateRequestedDeliveryDate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the validation.

OnBeforeMessageIfSalesLinesExist

Raised before showing a message when sales lines exist and a field changes.

[IntegrationEvent(False,False)]
local procedure OnBeforeMessageIfSalesLinesExist(var SalesHeader: Record "Sales Header"; ChangedFieldCaption: Text; var IsHandled: Boolean)

Parameters

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

The sales header record.

ChangedFieldCaption Text

The caption of the changed field.

IsHandled Boolean

Set to true to skip the default message display.

OnBeforePriceMessageIfSalesLinesExist

Raised before showing a price message when sales lines exist.

[IntegrationEvent(False,False)]
local procedure OnBeforePriceMessageIfSalesLinesExist(SalesHeader: Record "Sales Header"; ChangedFieldCaption: Text; var IsHandled: Boolean)

Parameters

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

The sales header record.

ChangedFieldCaption Text

The caption of the changed field.

IsHandled Boolean

Set to true to skip the default message display.

OnBeforeCreateDimSetForPrepmtAccDefaultDim

Raised before creating a dimension set for prepayment account default dimensions.

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateDimSetForPrepmtAccDefaultDim(SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default dimension set creation.

OnBeforeRecreateSalesLines

Raised before recreating sales lines.

[IntegrationEvent(False,False)]
local procedure OnBeforeRecreateSalesLines(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

OnBeforeRecreateSalesLinesHandler

Raised before handling the recreate sales lines process.

[IntegrationEvent(False,False)]
local procedure OnBeforeRecreateSalesLinesHandler(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldName: Text[100]; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

ChangedFieldName Text[100]

The name of the changed field.

IsHandled Boolean

Set to true to skip the default recreation handling.

OnBeforeRecreateSalesLinesHandleSupplementTypes

Raised before handling supplement types during sales line recreation.

[IntegrationEvent(False,False)]
local procedure OnBeforeRecreateSalesLinesHandleSupplementTypes(var TempSalesLine: Record "Sales Line" temporary; var IsHandled: Boolean)

Parameters

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

The temporary sales line record.

IsHandled Boolean

Set to true to skip the default supplement type handling.

OnBeforeSalesLineByChangedFieldNo

Raised before updating the sales line by changed field number.

[IntegrationEvent(False,False)]
local procedure OnBeforeSalesLineByChangedFieldNo(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ChangedFieldNo: Integer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)

Parameters

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

The sales header record.

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

The sales line record being updated.

ChangedFieldNo Integer

The number of the changed field.

IsHandled Boolean

Set to true to skip the default update logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The current field number being processed.

OnBeforeSalesLineInsert

Raised before inserting a sales line during line recreation.

[IntegrationEvent(False,False)]
local procedure OnBeforeSalesLineInsert(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; SalesHeader: Record "Sales Header")

Parameters

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

The sales line record being inserted.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line used as source.

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

The parent sales header record.

OnBeforeSetCustomerLocationCode

Raised before setting the customer location code.

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

Parameters

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

The sales header record being modified.

IsHandled Boolean

Set to true to skip the default location code setting.

SellToCustomer Table Microsoft.Sales.Customer.Customer

The sell-to customer record.

OnBeforeSetDefaultPaymentServices

Raised before setting the default payment services.

[IntegrationEvent(False,False)]
local procedure OnBeforeSetDefaultPaymentServices(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

IsHandled Boolean

Set to true to skip the default payment services setting.

OnBeforeSetDefaultSalesperson

Raised before setting the default salesperson.

[IntegrationEvent(False,False)]
local procedure OnBeforeSetDefaultSalesperson(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; InsertMode: Boolean)

Parameters

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

The sales header record being modified.

IsHandled Boolean

Set to true to skip the default salesperson setting.

InsertMode Boolean

Specifies whether the record is being inserted.

OnBeforeStoreSalesCommentLineToTemp

Raised before storing sales comment lines to temporary storage.

[IntegrationEvent(False,False)]
local procedure OnBeforeStoreSalesCommentLineToTemp(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

IsHandled Boolean

Set to true to skip the default storage logic.

OnBeforeTestNoSeries

Raised before testing the number series.

[IntegrationEvent(False,False)]
local procedure OnBeforeTestNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being tested.

IsHandled Boolean

Set to true to skip the default number series test.

OnBeforeSetSecurityFilterOnRespCenter

Raised before setting the security filter on the responsibility center.

[IntegrationEvent(False,False)]
local procedure OnBeforeSetSecurityFilterOnRespCenter(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default security filter setting.

OnBeforeShowPostedDocsToPrintCreatedMsg

Raised before showing the posted documents to print created message.

[IntegrationEvent(True,False)]
local procedure OnBeforeShowPostedDocsToPrintCreatedMsg(var ShowPostedDocsToPrint: Boolean)

Parameters

Name Type Description
ShowPostedDocsToPrint Boolean

Specifies whether to show the posted documents to print message.

OnBeforeSynchronizeForReservations

Raised before synchronizing for reservations.

[IntegrationEvent(False,False)]
local procedure OnBeforeSynchronizeForReservations(var SalesHeader: Record "Sales Header"; var NewSalesLine: Record "Sales Line"; OldSalesLine: Record "Sales Line"; var IsHandled: Boolean)

Parameters

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

The sales header record.

NewSalesLine Table Microsoft.Sales.Document."Sales Line"

The new sales line record.

OldSalesLine Table Microsoft.Sales.Document."Sales Line"

The old sales line record.

IsHandled Boolean

Set to true to skip the default synchronization logic.

OnBeforeUpdateBillToCustContact

Raised before updating the bill-to customer contact.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateBillToCustContact(var SalesHeader: Record "Sales Header"; Conact: Record Contact; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

Conact Table Microsoft.CRM.Contact.Contact

The contact record.

IsHandled Boolean

Set to true to skip the default contact update.

OnBeforeUpdateDirectDebitPmtTermsCode

Raised before updating direct debit payment terms code.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateDirectDebitPmtTermsCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var PaymentMethod: Record "Payment Method")

Parameters

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

The sales header record being modified.

IsHandled Boolean

Set to true to skip the default payment terms update.

PaymentMethod Table Microsoft.Bank.BankAccount."Payment Method"

The payment method record.

OnBeforeUpdateSellToCust

Raised before updating the sell-to customer.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateSellToCust(var SalesHeader: Record "Sales Header"; var Contact: Record Contact; var Customer: Record Customer; ContactNo: Code[20])

Parameters

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

The sales header record being modified.

Contact Table Microsoft.CRM.Contact.Contact

The contact record.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

ContactNo Code[20]

The contact number.

OnBeforeUpdateAllLineDim

Raised before updating all line dimensions.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateAllLineDim(var SalesHeader: Record "Sales Header"; NewParentDimSetID: Integer; OldParentDimSetID: Integer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

NewParentDimSetID Integer

The new parent dimension set ID.

OldParentDimSetID Integer

The old parent dimension set ID.

IsHandled Boolean

Set to true to skip the default dimension update.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

OnBeforeUpdateLocationCode

Raised before updating the location code.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateLocationCode(var SalesHeader: Record "Sales Header"; LocationCode: Code[10]; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

LocationCode Code[10]

The new location code.

IsHandled Boolean

Set to true to skip the default location code update.

OnBeforeUpdateOutboundWhseHandlingTime

Raised before updating the outbound warehouse handling time.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateOutboundWhseHandlingTime(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

IsHandled Boolean

Set to true to skip the default handling time update.

OnBeforeUpdateSalesLineAmounts

Raised before updating sales line amounts.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateSalesLineAmounts(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the update.

IsHandled Boolean

Set to true to skip the default amounts update.

OnBeforeUpdateSalesLinesByFieldNo

Raised before updating sales lines by field number.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateSalesLinesByFieldNo(var SalesHeader: Record "Sales Header"; ChangedFieldNo: Integer; var AskQuestion: Boolean; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)

Parameters

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

The sales header record.

ChangedFieldNo Integer

The number of the changed field.

AskQuestion Boolean

Specifies whether to ask the user a confirmation question.

IsHandled Boolean

Set to true to skip the default update logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The current field number being processed.

OnBeforeUpdateSalesLines

Raised before updating sales lines.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateSalesLines(var SalesHeader: Record "Sales Header"; ChangedFieldName: Text[100]; var AskQuestion: Boolean)

Parameters

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

The sales header record.

ChangedFieldName Text[100]

The name of the changed field.

AskQuestion Boolean

Specifies whether to ask the user a confirmation question.

OnBeforeUpdateSellToCustContact

Raised before updating the sell-to customer contact.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateSellToCustContact(var SalesHeader: Record "Sales Header"; Conact: Record Contact; var IsHandled: Boolean)

Parameters

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

The sales header record being modified.

Conact Table Microsoft.CRM.Contact.Contact

The contact record.

IsHandled Boolean

Set to true to skip the default contact update.

OnBeforeUpdateShipToAddress

Raised before updating the ship-to address.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateShipToAddress(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; CurrFieldNo: Integer)

Parameters

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

The sales header record being modified.

IsHandled Boolean

Set to true to skip the default address update.

CurrFieldNo Integer

The current field number being processed.

OnBeforeUpdateShipToCodeFromCust

Raised before updating the ship-to code from the customer.

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

Parameters

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

The sales header record being modified.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

IsHandled Boolean

Set to true to skip the default ship-to code update.

OnBeforeValidatePostingDate

Raised before validating the posting date.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidatePostingDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default validation logic.

OnCheckItemAvailabilityInLinesOnAfterSetFilters

Raised after filters are set on sales lines during item availability check.

[IntegrationEvent(False,False)]
local procedure OnCheckItemAvailabilityInLinesOnAfterSetFilters(var SalesLine: Record "Sales Line")

Parameters

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

The sales line record with filters applied.

OnCollectParamsInBufferForCreateDimSetOnAfterSetTempSalesLineFilters

Raised after filters are set on temporary sales lines during dimension set collection.

[IntegrationEvent(False,False)]
local procedure OnCollectParamsInBufferForCreateDimSetOnAfterSetTempSalesLineFilters(var TempSalesLine: Record "Sales Line" temporary; SalesLine: Record "Sales Line")

Parameters

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

The temporary sales line record with filters applied.

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

The source sales line record.

OnCopySelltoCustomerAddressFieldsFromCustomerOnAfterAssignRespCenter

Raised after assigning the responsibility center during sell-to customer address copy.

[IntegrationEvent(False,False)]
local procedure OnCopySelltoCustomerAddressFieldsFromCustomerOnAfterAssignRespCenter(var SalesHeader: Record "Sales Header"; Customer: Record Customer; CallingFieldNo: Integer)

Parameters

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

The sales header record being modified.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

CallingFieldNo Integer

The field number that triggered the copy.

OnCopySellToCustomerAddressFieldsFromCustomerOnAfterAssignSellToCustomerAddress

Raised after assigning the sell-to customer address during customer address copy.

[IntegrationEvent(False,False)]
procedure OnCopySellToCustomerAddressFieldsFromCustomerOnAfterAssignSellToCustomerAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer)

Parameters

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

The sales header record being modified.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

OnCreateDimOnBeforeUpdateLines

Raised before updating lines during dimension creation.

[IntegrationEvent(False,False)]
local procedure OnCreateDimOnBeforeUpdateLines(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; OldDimSetID: Integer; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

CurrentFieldNo Integer

The field number that triggered the dimension creation.

OldDimSetID Integer

The old dimension set ID.

DefaultDimSource List of [Dictionary of [Integer, Code[20]]]

The list of default dimension sources.

OnCreateDimOnBeforeModify

Raised before modifying the sales header during dimension creation.

[IntegrationEvent(False,False)]
local procedure OnCreateDimOnBeforeModify(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNo: Integer; OldDimSetID: Integer)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

FieldNo Integer

The field number that triggered the dimension creation.

OldDimSetID Integer

The old dimension set ID.

OnCreateDimOnKeepDimensionsOnAfterUpdateGlobalDim

Raised after updating global dimensions when keeping dimensions during dimension creation.

[IntegrationEvent(False,False)]
local procedure OnCreateDimOnKeepDimensionsOnAfterUpdateGlobalDim(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNo: Integer; OldDimSetID: Integer)

Parameters

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

The sales header record being modified.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before modification.

FieldNo Integer

The field number that triggered the dimension creation.

OldDimSetID Integer

The old dimension set ID.

OnCreateSalesLineOnAfterAssignType

Raised after assigning the type during sales line creation.

[IntegrationEvent(False,False)]
local procedure OnCreateSalesLineOnAfterAssignType(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)

Parameters

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

The sales line record being created.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line used as source.

OnCreateSalesLineOnBeforeValidateQuantity

Raised before validating the quantity during sales line creation.

[IntegrationEvent(False,False)]
local procedure OnCreateSalesLineOnBeforeValidateQuantity(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var ShouldValidateQuantity: Boolean)

Parameters

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

The sales line record being created.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line used as source.

ShouldValidateQuantity Boolean

Specifies whether to validate the quantity.

OnCreateSalesLineOnBeforeTransferFieldsFromTempSalesLine

Raised before transferring fields from temporary sales line during sales line creation.

[IntegrationEvent(False,False)]
local procedure OnCreateSalesLineOnBeforeTransferFieldsFromTempSalesLine(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header")

Parameters

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

The sales line record being created.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line used as source.

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

The parent sales header record.

OnDeleteSalesLinesOnBeforeDeleteLine

Raised before deleting a line during sales lines deletion.

[IntegrationEvent(False,False)]
local procedure OnDeleteSalesLinesOnBeforeDeleteLine(var SalesLine: Record "Sales Line")

Parameters

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

The sales line record being deleted.

OnDeleteOnAfterPostSalesDeleteDeleteHeader

Raised after the sales header is deleted during post-sales delete processing.

[IntegrationEvent(False,False)]
local procedure OnDeleteOnAfterPostSalesDeleteDeleteHeader(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was deleted.

OnDeleteOnBeforeArchiveSalesDocument

Raised before archiving the sales document during deletion.

[IntegrationEvent(False,False)]
local procedure OnDeleteOnBeforeArchiveSalesDocument(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being deleted.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before deletion.

OnInitFromContactOnAfterInitNoSeries

Raised after initializing the number series during initialization from a contact.

[IntegrationEvent(False,False)]
local procedure OnInitFromContactOnAfterInitNoSeries(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being initialized.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before initialization.

OnInitFromContactOnBeforeInitRecord

Raised before initializing the record during initialization from a contact.

[IntegrationEvent(False,False)]
local procedure OnInitFromContactOnBeforeInitRecord(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being initialized.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before initialization.

OnInitFromTemplateOnAfterInitNoSeries

Raised after initializing the number series during initialization from a template.

[IntegrationEvent(False,False)]
local procedure OnInitFromTemplateOnAfterInitNoSeries(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being initialized.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before initialization.

OnInitFromTemplateOnBeforeInitRecord

Raised before initializing the record during initialization from a template.

[IntegrationEvent(False,False)]
local procedure OnInitFromTemplateOnBeforeInitRecord(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being initialized.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before initialization.

OnInitInsertOnBeforeInitRecord

Raised before initializing the record during insert initialization.

[IntegrationEvent(False,False)]
local procedure OnInitInsertOnBeforeInitRecord(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being initialized.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The sales header record before initialization.

OnInitRecordOnBeforeAssignShipmentDate

Raised before assigning the shipment date during record initialization.

[IntegrationEvent(False,False)]
local procedure OnInitRecordOnBeforeAssignShipmentDate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being initialized.

IsHandled Boolean

Set to true to skip the default shipment date assignment.

OnInitRecordOnBeforeAssignOrderDate

Raised before assigning the order date during record initialization.

[IntegrationEvent(False,False)]
local procedure OnInitRecordOnBeforeAssignOrderDate(var SalesHeader: Record "Sales Header"; var NewOrderDate: Date)

Parameters

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

The sales header record being initialized.

NewOrderDate Date

The new order date to be assigned.

OnInsertTempSalesLineInBufferOnBeforeTempSalesLineInsert

Raised before inserting a temporary sales line during buffer insertion.

[IntegrationEvent(False,False)]
local procedure OnInsertTempSalesLineInBufferOnBeforeTempSalesLineInsert(var TempSalesLine: Record "Sales Line" temporary; SalesLine: Record "Sales Line")

Parameters

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

The temporary sales line record being inserted.

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

The source sales line record.

OnUpdateBillToCustOnAfterSalesQuote

Raised after updating the bill-to customer on a sales quote.

[IntegrationEvent(False,False)]
local procedure OnUpdateBillToCustOnAfterSalesQuote(var SalesHeader: Record "Sales Header"; Contact: Record Contact)

Parameters

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

The sales header record being updated.

Contact Table Microsoft.CRM.Contact.Contact

The contact record associated with the bill-to customer.

OnValidateBilltoCustomerTemplCodeOnBeforeRecreateSalesLines

Raised before recreating sales lines when validating the bill-to customer template code.

[IntegrationEvent(False,False)]
local procedure OnValidateBilltoCustomerTemplCodeOnBeforeRecreateSalesLines(var SalesHeader: Record "Sales Header"; CallingFieldNo: Integer)

Parameters

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

The sales header record being validated.

CallingFieldNo Integer

The field number that triggered the validation.

OnValidateResponsibilityCenterOnBeforeRecreateSalesLines

Raised before recreating sales lines when validating the responsibility center.

[IntegrationEvent(False,False)]
local procedure OnValidateResponsibilityCenterOnBeforeRecreateSalesLines(var SalesHeader: Record "Sales Header"; CallingFieldNo: Integer)

Parameters

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

The sales header record being validated.

CallingFieldNo Integer

The field number that triggered the validation.

OnValidateSellToCustomerNoAfterInit

Raised after initialization when validating the sell-to customer number.

[IntegrationEvent(False,False)]
local procedure OnValidateSellToCustomerNoAfterInit(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnValidateSellToCustomerNoOnAfterCalcShouldSkipConfirmSellToCustomerDialog

Raised after calculating whether to skip the confirm sell-to customer dialog during sell-to customer number validation.

[IntegrationEvent(False,False)]
local procedure OnValidateSellToCustomerNoOnAfterCalcShouldSkipConfirmSellToCustomerDialog(var SalesHeader: Record "Sales Header"; var ShouldSkipConfirmSellToCustomerDialog: Boolean; var ConfirmedShouldBeFalse: Boolean)

Parameters

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

The sales header record being validated.

ShouldSkipConfirmSellToCustomerDialog Boolean

Set to true to skip the confirmation dialog.

ConfirmedShouldBeFalse Boolean

Set to true to indicate that the confirmed result should be false.

OnValidateSelltoContactNoOnAfterCalcShouldUpdateOpportunity

Raised after calculating whether to update the opportunity when validating the sell-to contact number.

[IntegrationEvent(False,False)]
local procedure OnValidateSelltoContactNoOnAfterCalcShouldUpdateOpportunity(var SalesHeader: Record "Sales Header"; var ShouldUpdateOpportunity: Boolean)

Parameters

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

The sales header record being validated.

ShouldUpdateOpportunity Boolean

Set to true to update the related opportunity.

OnAfterTestQuantityShippedField

Raised after testing the quantity shipped field on a sales line.

[IntegrationEvent(False,False)]
local procedure OnAfterTestQuantityShippedField(SalesLine: Record "Sales Line")

Parameters

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

The sales line record that was tested.

OnBeforeTestSalesLineFieldsBeforeRecreate

Raised before testing sales line fields before recreating lines.

[IntegrationEvent(False,False)]
local procedure OnBeforeTestSalesLineFieldsBeforeRecreate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var SalesLine: Record "Sales Line")

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default test logic.

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

The sales line record being tested.

OnBeforeTestQuantityShippedField

Raised before testing the quantity shipped field on a sales line.

[IntegrationEvent(False,False)]
local procedure OnBeforeTestQuantityShippedField(SalesLine: Record "Sales Line"; var IsHandled: Boolean)

Parameters

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

The sales line record being tested.

IsHandled Boolean

Set to true to skip the default test logic.

OnAfterPrepareOpeningDocumentStatistics

Raised after preparing to open document statistics.

[IntegrationEvent(False,False)]
local procedure OnAfterPrepareOpeningDocumentStatistics(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

OnBeforeTestStatusOpen

Raised before testing if the status is open.

[IntegrationEvent(True,False)]
local procedure OnBeforeTestStatusOpen(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CallingFieldNo: Integer)

Parameters

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

The sales header record being tested.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CallingFieldNo Integer

The field number that triggered the test.

OnAfterTestStatusOpen

Raised after testing if the status is open.

[IntegrationEvent(True,False)]
local procedure OnAfterTestStatusOpen(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was tested.

OnAfterUpdateBillToCont

Raised after updating the bill-to contact from customer and contact records.

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateBillToCont(var SalesHeader: Record "Sales Header"; Customer: Record Customer; Contact: Record Contact)

Parameters

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

The sales header record being updated.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

Contact Table Microsoft.CRM.Contact.Contact

The contact record.

OnAfterUpdateBillToCust

Raised after updating the bill-to customer from a contact.

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateBillToCust(var SalesHeader: Record "Sales Header"; Contact: Record Contact)

Parameters

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

The sales header record being updated.

Contact Table Microsoft.CRM.Contact.Contact

The contact record used to update the bill-to customer.

OnAfterUpdateSellToCont

Raised after updating the sell-to contact from customer and contact records.

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateSellToCont(var SalesHeader: Record "Sales Header"; Customer: Record Customer; Contact: Record Contact; HideValidationDialog: Boolean)

Parameters

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

The sales header record being updated.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

Contact Table Microsoft.CRM.Contact.Contact

The contact record.

HideValidationDialog Boolean

Indicates whether validation dialogs should be hidden.

OnAfterUpdateSellToCust

Raised after updating the sell-to customer from a contact.

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateSellToCust(var SalesHeader: Record "Sales Header"; Contact: Record Contact)

Parameters

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

The sales header record being updated.

Contact Table Microsoft.CRM.Contact.Contact

The contact record used to update the sell-to customer.

OnAfterUpdateSalesLines

Raised after updating sales lines.

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateSalesLines(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record whose lines were updated.

OnAfterSetCompanyBankAccount

Raised after setting the company bank account.

[IntegrationEvent(False,False)]
local procedure OnAfterSetCompanyBankAccount(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being updated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnBeforeValidateAppliesToDocNo

Raised before validating the applies-to document number.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateAppliesToDocNo(var SalesHeader: Record "Sales Header"; var CustLedgEntry: Record "Cust. Ledger Entry"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

CustLedgEntry Table Microsoft.Sales.Receivables."Cust. Ledger Entry"

The customer ledger entry to apply.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateBillToCustomerName

Raised before validating the bill-to customer name.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateBillToCustomerName(var SalesHeader: Record "Sales Header"; var Customer: Record Customer)

Parameters

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

The sales header record being validated.

Customer Table Microsoft.Sales.Customer.Customer

The customer record to validate against.

OnBeforeValidateSellToCustomerName

Raised before validating the sell-to customer name.

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

Parameters

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

The sales header record being validated.

Customer Table Microsoft.Sales.Customer.Customer

The customer record to validate against.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateShortcutDimCode

Raised before validating a shortcut dimension code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShortcutDimCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNumber: Integer; var ShortcutDimCode: Code[20]; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

FieldNumber Integer

The field number of the shortcut dimension being validated.

ShortcutDimCode Code[20]

The shortcut dimension code value.

IsHandled Boolean

Set to true to skip the default validation logic.

OnLinkSalesDocWithOpportunityOnBeforeSalesHeaderModify

Raised before modifying the sales header when linking a sales document with an opportunity.

[IntegrationEvent(False,False)]
local procedure OnLinkSalesDocWithOpportunityOnBeforeSalesHeaderModify(var SalesHeader: Record "Sales Header"; OldOpportunityNo: Code[20]; Opportunity: Record Opportunity)

Parameters

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

The sales header record being linked.

OldOpportunityNo Code[20]

The previous opportunity number.

Opportunity Table Microsoft.CRM.Opportunity.Opportunity

The opportunity record being linked.

OnRecreateSalesLinesOnAfterSetSalesLineFilters

Raised after setting sales line filters during sales line recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateSalesLinesOnAfterSetSalesLineFilters(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header")

Parameters

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

The sales line record with filters applied.

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

The sales header record.

OnRecreateSalesLinesOnBeforeConfirm

Raised before confirming the recreation of sales lines.

[IntegrationEvent(False,False)]
local procedure OnRecreateSalesLinesOnBeforeConfirm(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldName: Text[100]; HideValidationDialog: Boolean; var Confirmed: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

ChangedFieldName Text[100]

The name of the field that was changed.

HideValidationDialog Boolean

Indicates whether validation dialogs should be hidden.

Confirmed Boolean

The confirmation result.

IsHandled Boolean

Set to true to skip the default confirmation logic.

OnRecreateSalesLinesOnBeforeSalesLineDeleteAll

Raised before deleting all sales lines during recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateSalesLinesOnBeforeSalesLineDeleteAll(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record.

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

The sales line record to be deleted.

CurrentFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default delete logic.

OnRecreateSalesLinesOnAfterProcessTempSalesLines

Raised after processing temporary sales lines during recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateSalesLinesOnAfterProcessTempSalesLines(var TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldName: Text[100])

Parameters

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

The temporary sales line record that was processed.

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

ChangedFieldName Text[100]

The name of the field that was changed.

OnRecreateReservEntryReqLineOnAfterLoop

Raised after the loop during reservation entry and requisition line recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateReservEntryReqLineOnAfterLoop(var SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")

Parameters

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

The sales header record.

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

The sales line record being processed.

OnRecreateReservEntryReqLineOnAfterCalcShouldValidateLocationCode

Raised after calculating whether to validate the location code during reservation entry recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateReservEntryReqLineOnAfterCalcShouldValidateLocationCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var ShouldValidateLocationCode: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

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

The sales line record being processed.

ShouldValidateLocationCode Boolean

Set to true to validate the location code.

OnRecreateSalesLinesHandleSupplementTypesOnAfterCalcShouldCreateSalsesLine

Raised after calculating whether to create a sales line when handling supplement types during recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateSalesLinesHandleSupplementTypesOnAfterCalcShouldCreateSalsesLine(var TempSalesLine: Record "Sales Line"; var ShouldCreateSalsesLine: Boolean; var SalesLine: Record "Sales Line")

Parameters

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

The temporary sales line record.

ShouldCreateSalsesLine Boolean

Set to true to create the sales line.

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

The sales line record being created.

OnSetBillToCustomerAddressFieldsFromCustomerOnAfterAssignBillToCustomerAddress

Raised after assigning the bill-to customer address from the customer record.

[IntegrationEvent(False,False)]
procedure OnSetBillToCustomerAddressFieldsFromCustomerOnAfterAssignBillToCustomerAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer)

Parameters

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

The sales header record being updated.

Customer Table Microsoft.Sales.Customer.Customer

The customer record used as the source.

OnSetShipToCustomerAddressFieldsFromShipToAddrOnAfterCalcShouldCopyLocationCode

Raised after calculating whether to copy location code and salesperson code from ship-to address.

[IntegrationEvent(False,False)]
local procedure OnSetShipToCustomerAddressFieldsFromShipToAddrOnAfterCalcShouldCopyLocationCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ShipToAddress: Record "Ship-to Address"; var ShouldCopyLocationCode: Boolean; var ShouldCopySalespersonCode: Boolean)

Parameters

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

The sales header record being updated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

ShipToAddress Table Microsoft.Sales.Customer."Ship-to Address"

The ship-to address record.

ShouldCopyLocationCode Boolean

Set to true to copy the location code.

ShouldCopySalespersonCode Boolean

Set to true to copy the salesperson code.

OnTestStatusIsNotPendingApproval

Raised to test if the status is not pending approval.

[IntegrationEvent(False,False)]
local procedure OnTestStatusIsNotPendingApproval(SalesHeader: Record "Sales Header"; var NotPending: Boolean)

Parameters

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

The sales header record being tested.

NotPending Boolean

Set to true if the status is not pending approval.

OnTestStatusIsNotPendingPrepayment

Raised to test if the status is not pending prepayment.

[IntegrationEvent(False,False)]
local procedure OnTestStatusIsNotPendingPrepayment(SalesHeader: Record "Sales Header"; var NotPending: Boolean)

Parameters

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

The sales header record being tested.

NotPending Boolean

Set to true if the status is not pending prepayment.

OnTestStatusIsNotReleased

Raised to test if the status is not released.

[IntegrationEvent(False,False)]
local procedure OnTestStatusIsNotReleased(SalesHeader: Record "Sales Header"; var NotReleased: Boolean)

Parameters

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

The sales header record being tested.

NotReleased Boolean

Set to true if the status is not released.

OnUpdateAllLineDimOnAfterSalesLineModify

Raised after modifying a sales line when updating all line dimensions.

[IntegrationEvent(False,False)]
local procedure OnUpdateAllLineDimOnAfterSalesLineModify(var SalesLine: Record "Sales Line")

Parameters

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

The sales line record that was modified.

OnUpdateAllLineDimOnBeforeSalesLineModify

Raised before modifying a sales line when updating all line dimensions.

[IntegrationEvent(False,False)]
local procedure OnUpdateAllLineDimOnBeforeSalesLineModify(var SalesLine: Record "Sales Line"; xSalesLine: Record "Sales Line")

Parameters

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

The sales line record being modified.

xSalesLine Table Microsoft.Sales.Document."Sales Line"

The previous version of the sales line record.

OnUpdateSalesLinesByFieldNoOnBeforeSalesLineModify

Raised before modifying a sales line when updating sales lines by field number.

[IntegrationEvent(False,False)]
local procedure OnUpdateSalesLinesByFieldNoOnBeforeSalesLineModify(var SalesLine: Record "Sales Line"; ChangedFieldNo: Integer; CurrentFieldNo: Integer)

Parameters

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

The sales line record being modified.

ChangedFieldNo Integer

The field number that was changed.

CurrentFieldNo Integer

The current field number being processed.

OnUpdateSalesLinesByFieldNoOnAfterCalcShouldConfirmReservationDateConflict

Raised after calculating whether to confirm a reservation date conflict when updating sales lines by field number.

[IntegrationEvent(False,False)]
local procedure OnUpdateSalesLinesByFieldNoOnAfterCalcShouldConfirmReservationDateConflict(var SalesHeader: Record "Sales Header"; ChangedFieldNo: Integer; var ShouldConfirmReservationDateConflict: Boolean)

Parameters

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

The sales header record.

ChangedFieldNo Integer

The field number that was changed.

ShouldConfirmReservationDateConflict Boolean

Set to true to confirm the reservation date conflict.

OnUpdateBillToCustOnBeforeContactIsNotRelatedToAnyCostomerErr

Raised before displaying an error that the contact is not related to any customer when updating bill-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateBillToCustOnBeforeContactIsNotRelatedToAnyCostomerErr(var SalesHeader: Record "Sales Header"; Contact: Record Contact; var ContactBusinessRelation: Record "Contact Business Relation"; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

Contact Table Microsoft.CRM.Contact.Contact

The contact record.

ContactBusinessRelation Table Microsoft.CRM.BusinessRelation."Contact Business Relation"

The contact business relation record.

IsHandled Boolean

Set to true to skip the default error logic.

OnUpdateBillToCustOnBeforeFindContactBusinessRelation

Raised before finding the contact business relation when updating bill-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateBillToCustOnBeforeFindContactBusinessRelation(Contact: Record Contact; var ContBusinessRelation: Record "Contact Business Relation"; var ContactBusinessRelationFound: Boolean; var IsHandled: Boolean)

Parameters

Name Type Description
Contact Table Microsoft.CRM.Contact.Contact

The contact record.

ContBusinessRelation Table Microsoft.CRM.BusinessRelation."Contact Business Relation"

The contact business relation record to find.

ContactBusinessRelationFound Boolean

Indicates whether the contact business relation was found.

IsHandled Boolean

Set to true to skip the default find logic.

OnUpdateSellToCustOnAfterSetFromSearchContact

Raised after setting the sales header from a search contact when updating sell-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateSellToCustOnAfterSetFromSearchContact(var SalesHeader: Record "Sales Header"; var SearchContact: Record Contact)

Parameters

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

The sales header record being updated.

SearchContact Table Microsoft.CRM.Contact.Contact

The search contact record used as the source.

OnUpdateSellToCustOnAfterSetShipToAddress

Raised after setting the ship-to address when updating sell-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateSellToCustOnAfterSetShipToAddress(var SalesHeader: Record "Sales Header"; var SearchContact: Record Contact)

Parameters

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

The sales header record being updated.

SearchContact Table Microsoft.CRM.Contact.Contact

The search contact record.

OnUpdateSellToCustOnAfterSetSellToContactNo

Raised after setting the sell-to contact number when updating sell-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateSellToCustOnAfterSetSellToContactNo(var SalesHeader: Record "Sales Header"; var Customer: Record Customer; var Cont: Record Contact; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

Cont Table Microsoft.CRM.Contact.Contact

The contact record.

IsHandled Boolean

Set to true to indicate custom handling was performed.

OnUpdateSellToCustOnBeforeContactIsNotRelatedToAnyCostomerErr

Raised before displaying an error that the contact is not related to any customer when updating sell-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateSellToCustOnBeforeContactIsNotRelatedToAnyCostomerErr(var SalesHeader: Record "Sales Header"; Contact: Record Contact; var ContactBusinessRelation: Record "Contact Business Relation"; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

Contact Table Microsoft.CRM.Contact.Contact

The contact record.

ContactBusinessRelation Table Microsoft.CRM.BusinessRelation."Contact Business Relation"

The contact business relation record.

IsHandled Boolean

Set to true to skip the default error logic.

OnUpdateSellToCustOnBeforeFindContactBusinessRelation

Raised before finding the contact business relation when updating sell-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateSellToCustOnBeforeFindContactBusinessRelation(Cont: Record Contact; var ContBusinessRelation: Record "Contact Business Relation"; var ContactBusinessRelationFound: Boolean; var IsHandled: Boolean)

Parameters

Name Type Description
Cont Table Microsoft.CRM.Contact.Contact

The contact record.

ContBusinessRelation Table Microsoft.CRM.BusinessRelation."Contact Business Relation"

The contact business relation record to find.

ContactBusinessRelationFound Boolean

Indicates whether the contact business relation was found.

IsHandled Boolean

Set to true to skip the default find logic.

OnValidateBillToCustomerNoOnAfterConfirmed

Raised after confirming the bill-to customer number change.

[IntegrationEvent(False,False)]
local procedure OnValidateBillToCustomerNoOnAfterConfirmed(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

OnValidatePaymentTermsCodeOnBeforeCalcDueDate

Raised before calculating the due date when validating payment terms code.

[IntegrationEvent(False,False)]
local procedure OnValidatePaymentTermsCodeOnBeforeCalcDueDate(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CalledByFieldNo: Integer; CallingFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CalledByFieldNo Integer

The field number that called the validation.

CallingFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default calculation logic.

OnValidatePaymentTermsCodeOnBeforeCalcPmtDiscDate

Raised before calculating the payment discount date when validating payment terms code.

[IntegrationEvent(False,False)]
local procedure OnValidatePaymentTermsCodeOnBeforeCalcPmtDiscDate(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CalledByFieldNo: Integer; CallingFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CalledByFieldNo Integer

The field number that called the validation.

CallingFieldNo Integer

The field number that triggered the validation.

IsHandled Boolean

Set to true to skip the default calculation logic.

OnValidatePaymentTermsCodeOnBeforeValidateDueDate

Raised before validating the due date when validating payment terms code.

[IntegrationEvent(False,False)]
local procedure OnValidatePaymentTermsCodeOnBeforeValidateDueDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrentFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default validation logic.

OnValidatePaymentTermsCodeOnBeforeValidateDueDateWhenBlank

Raised before validating the due date when payment terms code is blank.

[IntegrationEvent(False,False)]
local procedure OnValidatePaymentTermsCodeOnBeforeValidateDueDateWhenBlank(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrentFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default validation logic.

OnValidatePostingDateOnBeforeAssignDocumentDate

Raised before assigning the document date when validating posting date.

[IntegrationEvent(False,False)]
local procedure OnValidatePostingDateOnBeforeAssignDocumentDate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default assignment logic.

OnValidatePostingDateOnBeforeResetInvoiceDiscountValue

Raised before resetting the invoice discount value when validating posting date.

[IntegrationEvent(False,False)]
local procedure OnValidatePostingDateOnBeforeResetInvoiceDiscountValue(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnValidatePostingDateOnBeforeCheckNeedUpdateCurrencyFactor

Raised before checking if the currency factor needs to be updated when validating posting date.

[IntegrationEvent(False,False)]
local procedure OnValidatePostingDateOnBeforeCheckNeedUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; var IsConfirmed: Boolean; var NeedUpdateCurrencyFactor: Boolean; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being validated.

IsConfirmed Boolean

The confirmation result for updating the currency factor.

NeedUpdateCurrencyFactor Boolean

Indicates whether the currency factor needs to be updated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnValidatePaymentTermsCodeOnBeforeCalculatePrepaymentDueDate

Raised before calculating the prepayment due date when validating payment terms code.

[IntegrationEvent(False,False)]
local procedure OnValidatePaymentTermsCodeOnBeforeCalculatePrepaymentDueDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrentFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default calculation logic.

OnValidatePricesIncludingVATOnBeforeSalesLineModify

Raised before modifying a sales line when validating prices including VAT.

[IntegrationEvent(False,False)]
local procedure OnValidatePricesIncludingVATOnBeforeSalesLineModify(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; Currency: Record Currency; RecalculatePrice: Boolean)

Parameters

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

The sales header record being validated.

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

The sales line record being modified.

Currency Table Microsoft.Finance.Currency.Currency

The currency record.

RecalculatePrice Boolean

Indicates whether the price should be recalculated.

OnValidateShippingAgentCodeOnBeforeUpdateLines

Raised before updating lines when validating shipping agent code.

[IntegrationEvent(False,False)]
local procedure OnValidateShippingAgentCodeOnBeforeUpdateLines(var SalesHeader: Record "Sales Header"; CallingFieldNo: Integer; HideValidationDialog: Boolean)

Parameters

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

The sales header record being validated.

CallingFieldNo Integer

The field number that triggered the validation.

HideValidationDialog Boolean

Indicates whether validation dialogs should be hidden.

OnBeforeGetFullDocTypeTxt

Raised before getting the full document type text.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetFullDocTypeTxt(var SalesHeader: Record "Sales Header"; var FullDocTypeTxt: Text; var IsHandled: Boolean)

Parameters

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

The sales header record.

FullDocTypeTxt Text

The full document type text to return.

IsHandled Boolean

Set to true to skip the default logic.

OnCollectParamsInBufferForCreateDimSetOnBeforeInsertTempSalesLineInBuffer

Raised before inserting a temporary sales line in the buffer when collecting parameters for creating a dimension set.

[IntegrationEvent(True,False)]
local procedure OnCollectParamsInBufferForCreateDimSetOnBeforeInsertTempSalesLineInBuffer(var GenPostingSetup: Record "General Posting Setup"; var DefaultDimension: Record "Default Dimension")

Parameters

Name Type Description
GenPostingSetup Table Microsoft.Finance.GeneralLedger.Setup."General Posting Setup"

The general posting setup record.

DefaultDimension Table Microsoft.Finance.Dimension."Default Dimension"

The default dimension record.

OnBeforeCopyDocument

Raised before copying a document.

[IntegrationEvent(False,False)]
local procedure OnBeforeCopyDocument(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default copy logic.

OnBeforeUpdateBillToCust

Raised before updating the bill-to customer.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateBillToCust(var SalesHeader: Record "Sales Header"; ContactNo: Code[20]; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

ContactNo Code[20]

The contact number to use for the update.

IsHandled Boolean

Set to true to skip the default update logic.

OnRecreateSalesLinesOnBeforeTempSalesLineFindSet

Raised before finding the temporary sales line set during recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateSalesLinesOnBeforeTempSalesLineFindSet(var TempSalesLine: Record "Sales Line" temporary; var SalesLine: Record "Sales Line")

Parameters

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

The temporary sales line record.

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

The temporary sales line record.

OnBeforeCheckContactRelatedToCustomerCompany

Raised before checking if a contact is related to a customer company.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckContactRelatedToCustomerCompany(SalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean; ContactNo: Code[20]; CustomerNo: Code[20])

Parameters

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

The sales header record.

CurrFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default check logic.

ContactNo Code[20]

The contact number to check.

CustomerNo Code[20]

The customer number to check against.

OnBeforeShowModifyAddressNotification

Raised before showing the modify address notification.

[IntegrationEvent(False,False)]
local procedure OnBeforeShowModifyAddressNotification(var IsHandled: Boolean; SalesHeader: Record "Sales Header"; CustomerNumber: Code[20])

Parameters

Name Type Description
IsHandled Boolean

Set to true to skip the default notification logic.

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

The sales header record.

CustomerNumber Code[20]

The customer number for the notification.

OnShowDocDimOnBeforeUpdateSalesLines

Raised before updating sales lines when showing document dimensions.

[IntegrationEvent(False,False)]
local procedure OnShowDocDimOnBeforeUpdateSalesLines(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnBeforeConfirmRecalculatePrice

Raised before confirming price recalculation.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmRecalculatePrice(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var Result: Boolean; var HideValidationDialog: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrFieldNo Integer

The current field number being processed.

Result Boolean

The confirmation result.

HideValidationDialog Boolean

Indicates whether validation dialogs should be hidden.

IsHandled Boolean

Set to true to skip the default confirmation logic.

OnUpdateAllLineDimOnBeforeGetSalesLineNewDimSetID

Raised before getting a new dimension set ID for a sales line when updating all line dimensions.

[IntegrationEvent(False,False)]
local procedure OnUpdateAllLineDimOnBeforeGetSalesLineNewDimSetID(var SalesLine: Record "Sales Line"; NewParentDimSetID: Integer; OldParentDimSetID: Integer)

Parameters

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

The sales line record being updated.

NewParentDimSetID Integer

The new parent dimension set ID.

OldParentDimSetID Integer

The old parent dimension set ID.

OnUpdateAllLineDimOnAfterGetSalesLineNewDimsetID

Raised after getting a new dimension set ID for a sales line when updating all line dimensions.

[IntegrationEvent(False,False)]
local procedure OnUpdateAllLineDimOnAfterGetSalesLineNewDimsetID(SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var NewDimSetID: Integer; NewParentDimSetID: Integer; OldParentDimSetID: Integer)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

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

The sales line record being updated.

NewDimSetID Integer

The new dimension set ID.

NewParentDimSetID Integer

The new parent dimension set ID.

OldParentDimSetID Integer

The old parent dimension set ID.

OnBeforeValidateShippingNoSeries

Raised before validating the shipping number series.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShippingNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeRename

Raised before renaming the sales header.

[IntegrationEvent(False,False)]
local procedure OnBeforeRename(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being renamed.

IsHandled Boolean

Set to true to skip the default rename logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnBeforeLookupBillToContactNo

Raised before looking up the bill-to contact number.

[IntegrationEvent(True,False)]
local procedure OnBeforeLookupBillToContactNo(var IsHandled: Boolean; var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

Name Type Description
IsHandled Boolean

Set to true to skip the default lookup logic.

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnBeforeUpdateOpportunity

Raised before updating the opportunity.

[IntegrationEvent(True,False)]
local procedure OnBeforeUpdateOpportunity(var IsHandled: Boolean; var SalesHeader: Record "Sales Header")

Parameters

Name Type Description
IsHandled Boolean

Set to true to skip the default update logic.

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

The sales header record.

OnBeforeCheckPromisedDeliveryDate

Raised before checking the promised delivery date.

[IntegrationEvent(True,False)]
local procedure OnBeforeCheckPromisedDeliveryDate(var IsHandled: Boolean; var SalesHeader: Record "Sales Header")

Parameters

Name Type Description
IsHandled Boolean

Set to true to skip the default check logic.

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

The sales header record.

OnBeforeUpdateShipToAddressFromSellToAddress

Raised before updating the ship-to address from the sell-to address.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateShipToAddressFromSellToAddress(var SalesHeader: Record "Sales Header"; FieldNumber: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

FieldNumber Integer

The field number triggering the update.

IsHandled Boolean

Set to true to skip the default update logic.

OnBeforeUpdateShipToSalespersonCode

Raised before updating the ship-to salesperson code.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateShipToSalespersonCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

IsHandled Boolean

Set to true to skip the default update logic.

OnBeforeSetSalespersonCode

Raised before setting the salesperson code.

[IntegrationEvent(False,False)]
local procedure OnBeforeSetSalespersonCode(var SalesHeader: Record "Sales Header"; SalesPersonCodeToCheck: Code[20]; var SalesPersonCodeToAssign: Code[20]; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

SalesPersonCodeToCheck Code[20]

The salesperson code to check.

SalesPersonCodeToAssign Code[20]

The salesperson code to assign.

IsHandled Boolean

Set to true to skip the default logic.

OnAfterUpdateShipToAddressFromSellToAddress

Raised after updating the ship-to address from the sell-to address.

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateShipToAddressFromSellToAddress(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNumber: Integer)

Parameters

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

The sales header record that was updated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

FieldNumber Integer

The field number that triggered the update.

OnBeforeValidateShipToCode

Raised before validating the ship-to code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShipToCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; Cust: Record Customer; ShipToAddr: Record "Ship-to Address"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

Cust Table Microsoft.Sales.Customer.Customer

The customer record.

ShipToAddr Table Microsoft.Sales.Customer."Ship-to Address"

The ship-to address record.

IsHandled Boolean

Set to true to skip the default validation logic.

OnValidateSellToCustomerNoOnBeforeCheckBlockedCustOnDocs

Raised before checking if the customer is blocked on documents when validating sell-to customer number.

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

Parameters

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

The sales header record being validated.

Cust Table Microsoft.Sales.Customer.Customer

The customer record to check.

IsHandled Boolean

Set to true to skip the default check logic.

OnValidateBillToCustomerNoOnBeforeCheckBlockedCustOnDocs

Raised before checking if the customer is blocked on documents when validating bill-to customer number.

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

Parameters

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

The sales header record being validated.

Cust Table Microsoft.Sales.Customer.Customer

The customer record to check.

IsHandled Boolean

Set to true to skip the default check logic.

OnBeforeSetBillToCustomerAddressFieldsFromCustomer

Raised before setting bill-to customer address fields from the customer record.

[IntegrationEvent(False,False)]
local procedure OnBeforeSetBillToCustomerAddressFieldsFromCustomer(var SalesHeader: Record "Sales Header"; var BillToCustomer: Record Customer; var SkipBillToContact: Boolean; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; var GLSetup: Record "General Ledger Setup"; CurrentFieldNo: Integer)

Parameters

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

The sales header record being updated.

BillToCustomer Table Microsoft.Sales.Customer.Customer

The bill-to customer record.

SkipBillToContact Boolean

Set to true to skip updating the bill-to contact.

IsHandled Boolean

Set to true to skip the default logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

GLSetup Table Microsoft.Finance.GeneralLedger.Setup."General Ledger Setup"

The general ledger setup record.

CurrentFieldNo Integer

The current field number being processed.

OnValidateBillToCustomerNoOnBeforeRecallModifyAddressNotification

Raised before recalling the modify address notification when validating bill-to customer number.

[IntegrationEvent(False,False)]
local procedure OnValidateBillToCustomerNoOnBeforeRecallModifyAddressNotification(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnBeforeValidateBillToName

Obsolete

This element will become obsolete from version 27.0. This event is never raised.

Raised before validating the bill-to name.

[Obsolete(This event is never raised.,27.0)]
[IntegrationEvent(False,False)]
local procedure OnBeforeValidateBillToName(var SalesHeader: Record "Sales Header"; var Customer: Record Customer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being validated.

Customer Table Microsoft.Sales.Customer.Customer

The customer record.

IsHandled Boolean

Set to true to skip the default validation logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnValidateShipToCodeOnBeforeValidateTaxLiable

Raised before validating tax liable when validating the ship-to code.

[IntegrationEvent(False,False)]
local procedure OnValidateShipToCodeOnBeforeValidateTaxLiable(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnValidateShipToCodeOnBeforeCopyShipToAddress

Raised before copying the ship-to address when validating the ship-to code.

[IntegrationEvent(False,False)]
local procedure OnValidateShipToCodeOnBeforeCopyShipToAddress(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; var CopyShipToAddress: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CopyShipToAddress Boolean

Set to true to copy the ship-to address.

OnBeforeValidateShipmentMethodCode

Raised before validating the shipment method code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShipmentMethodCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidateShippingAgentCode

Raised before validating the shipping agent code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShippingAgentCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrentFieldNo Integer

The current field number being processed.

OnInitRecordOnBeforeAssignWorkDateToPostingDate

Raised before assigning the work date to the posting date during record initialization.

[IntegrationEvent(False,False)]
local procedure OnInitRecordOnBeforeAssignWorkDateToPostingDate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being initialized.

IsHandled Boolean

Set to true to skip the default assignment logic.

OnBeforeSetBillToCustomerNo

Raised before setting the bill-to customer number.

[IntegrationEvent(False,False)]
local procedure OnBeforeSetBillToCustomerNo(var SalesHeader: Record "Sales Header"; var Cust: Record Customer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; var CurrentFieldNo: Integer)

Parameters

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

The sales header record being updated.

Cust Table Microsoft.Sales.Customer.Customer

The customer record.

IsHandled Boolean

Set to true to skip the default logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrentFieldNo Integer

The current field number being processed.

OnBeforeValidateShippingAgentServiceCode

Raised before validating the shipping agent service code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShippingAgentServiceCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidatePrepmtPaymentTermsCode

Raised before validating the prepayment payment terms code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidatePrepmtPaymentTermsCode(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CalledByFieldNo: Integer; CallingFieldNo: Integer; UpdateDocumentDate: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CalledByFieldNo Integer

The field number that called the validation.

CallingFieldNo Integer

The field number that triggered the validation.

UpdateDocumentDate Boolean

Indicates whether the document date should be updated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnAfterRecreateSalesLines

Raised after recreating sales lines.

[IntegrationEvent(False,False)]
local procedure OnAfterRecreateSalesLines(var SalesHeader: Record "Sales Header"; ChangedFieldName: Text[100])

Parameters

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

The sales header record whose lines were recreated.

ChangedFieldName Text[100]

The name of the field that was changed.

OnAfterSetSellToCustomerFromFilter

Raised after setting the sell-to customer from a filter.

[IntegrationEvent(False,False)]
local procedure OnAfterSetSellToCustomerFromFilter(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was updated.

OnBeforeCalcInvDiscForHeader

Raised before calculating the invoice discount for the header.

[IntegrationEvent(False,False)]
local procedure OnBeforeCalcInvDiscForHeader(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default calculation logic.

OnBeforeCouldDimensionsBeKept

Raised before determining if dimensions could be kept.

[IntegrationEvent(False,False)]
local procedure OnBeforeCouldDimensionsBeKept(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

Result Boolean

The result indicating whether dimensions could be kept.

IsHandled Boolean

Set to true to skip the default logic.

OnBeforeConfirmBillToCustomerChange

Raised before confirming the bill-to customer change.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmBillToCustomerChange(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var Confirmed: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrFieldNo Integer

The current field number being processed.

Confirmed Boolean

The confirmation result.

IsHandled Boolean

Set to true to skip the default confirmation logic.

OnValidateSellToCustomerNoOnBeforeRecallModifyAddressNotification

Raised before recalling the modify address notification when validating sell-to customer number.

[IntegrationEvent(False,False)]
local procedure OnValidateSellToCustomerNoOnBeforeRecallModifyAddressNotification(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnCheckCreditMaxBeforeInsertOnCaseIfOnBeforeSalesHeaderCheckCase

Raised before checking the sales header case during credit max check before insert.

[IntegrationEvent(False,False)]
local procedure OnCheckCreditMaxBeforeInsertOnCaseIfOnBeforeSalesHeaderCheckCase(var SalesHeader: Record "Sales Header"; Rec: Record "Sales Header")

Parameters

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

The sales header record to check.

Rec Table Microsoft.Sales.Document."Sales Header"

The sales header record being inserted.

OnCheckCustomerCreatedOnAfterConfirmProcess

Raised after confirming the customer creation process.

[IntegrationEvent(False,False)]
local procedure OnCheckCustomerCreatedOnAfterConfirmProcess(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

OnPrepmtPaymentTermsCodeOnCaseElseOnBeforeValidatePrepaymentDueDate

Raised before validating the prepayment due date in the else case of prepayment payment terms code.

[IntegrationEvent(False,False)]
local procedure OnPrepmtPaymentTermsCodeOnCaseElseOnBeforeValidatePrepaymentDueDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default validation logic.

OnValidatePrepmtPaymentTermsCodeOnCaseIfOnBeforeValidatePrepaymentDueDate

Raised before validating the prepayment due date in the if case when validating prepayment payment terms code.

[IntegrationEvent(False,False)]
local procedure OnValidatePrepmtPaymentTermsCodeOnCaseIfOnBeforeValidatePrepaymentDueDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default validation logic.

OnAfterRecreateSalesLinesHandleSupplementTypes

Raised after handling supplement types during sales lines recreation.

[IntegrationEvent(False,False)]
local procedure OnAfterRecreateSalesLinesHandleSupplementTypes(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

OnAfterInitPostingNoSeries

Raised after initializing the posting number series.

[IntegrationEvent(False,False)]
local procedure OnAfterInitPostingNoSeries(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnBeforeInitFromBillToCustTemplate

Raised before initializing from the bill-to customer template.

[IntegrationEvent(False,False)]
local procedure OnBeforeInitFromBillToCustTemplate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var BillToCustTemplate: Record "Customer Templ.")

Parameters

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

The sales header record being initialized.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

BillToCustTemplate Table Microsoft.Sales.Customer."Customer Templ."

The bill-to customer template record.

OnBeforeCopyFromNewSellToCustTemplate

Raised before copying from a new sell-to customer template.

[IntegrationEvent(False,False)]
local procedure OnBeforeCopyFromNewSellToCustTemplate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SellToCustTemplate: Record "Customer Templ.")

Parameters

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

The sales header record being updated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

SellToCustTemplate Table Microsoft.Sales.Customer."Customer Templ."

The sell-to customer template record.

OnBeforeModifyCustomerAddress

Raised before modifying the customer address.

[IntegrationEvent(False,False)]
local procedure OnBeforeModifyCustomerAddress(var Rec: Record "Sales Header"; var xRec: Record "Sales Header")

Parameters

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

The sales header record.

xRec Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnBeforeShouldCopyAddressFromBillToCustomer

Raised before determining if the address should be copied from the bill-to customer.

[IntegrationEvent(False,False)]
local procedure OnBeforeShouldCopyAddressFromBillToCustomer(BillToCustomer: Record Customer; Rec: Record "Sales Header"; xRec: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The bill-to customer record.

Rec Table Microsoft.Sales.Document."Sales Header"

The sales header record.

xRec Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

Result Boolean

The result indicating whether to copy the address.

IsHandled Boolean

Set to true to skip the default logic.

OnBeforeBillToCustomerIsReplaced

Raised before determining if the bill-to customer is replaced.

[IntegrationEvent(False,False)]
local procedure OnBeforeBillToCustomerIsReplaced(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

Result Boolean

The result indicating whether the bill-to customer was replaced.

IsHandled Boolean

Set to true to skip the default logic.

OnRecreateSalesLinesOnAfterFindSalesLine

Raised after finding a sales line during recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateSalesLinesOnAfterFindSalesLine(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ChangedFieldName: Text[100])

Parameters

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

The sales header record.

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

The sales line record that was found.

ChangedFieldName Text[100]

The name of the field that was changed.

OnCopySelltoCustomerAddressFieldsFromCustomerOnBeforeAssignRespCenter

Raised before assigning the responsibility center when copying sell-to customer address fields.

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

Parameters

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

The sales header record being updated.

SellToCustomer Table Microsoft.Sales.Customer.Customer

The sell-to customer record.

IsHandled Boolean

Set to true to skip the default assignment logic.

OnBeforeValidateExternalDocumentNo

Raised before validating the external document number.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateExternalDocumentNo(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrentFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default validation logic.

OnValidatePostingDateOnAfterCheckNeedUpdateCurrencyFactor

Raised after checking if the currency factor needs to be updated when validating posting date.

[IntegrationEvent(False,False)]
local procedure OnValidatePostingDateOnAfterCheckNeedUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var NeedUpdateCurrencyFactor: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

NeedUpdateCurrencyFactor Boolean

Indicates whether the currency factor needs to be updated.

OnValidateSellToCustomerNoOnBeforeGetCust

Raised before getting the customer when validating sell-to customer number.

[IntegrationEvent(False,False)]
local procedure OnValidateSellToCustomerNoOnBeforeGetCust(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

OnInitRecordOnBeforeAssignResponsibilityCenter

Raised before assigning the responsibility center during record initialization.

[IntegrationEvent(False,False)]
local procedure OnInitRecordOnBeforeAssignResponsibilityCenter(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being initialized.

IsHandled Boolean

Set to true to skip the default assignment logic.

OnValidateSellToCustomerNoOnBeforeValidateLocationCode

Raised before validating the location code when validating sell-to customer number.

[IntegrationEvent(False,False)]
local procedure OnValidateSellToCustomerNoOnBeforeValidateLocationCode(var SalesHeader: Record "Sales Header"; var Cust: Record Customer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; var LocationCode: Code[10])

Parameters

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

The sales header record being validated.

Cust Table Microsoft.Sales.Customer.Customer

The customer record.

IsHandled Boolean

Set to true to skip the default validation logic.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

LocationCode Code[10]

The location code to validate.

OnValidateSendICDocumentOnBeforeCheckICDirection

Raised before checking the IC direction when validating send IC document.

[IntegrationEvent(False,False)]
local procedure OnValidateSendICDocumentOnBeforeCheckICDirection(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default check logic.

OnAfterGetPstdDocLinesToReverse

Raised after getting posted document lines to reverse.

[IntegrationEvent(False,False)]
local procedure OnAfterGetPstdDocLinesToReverse(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

OnCopyShipToCustomerAddressFieldsFromCustOnBeforeValidateShippingAgentFields

Raised before validating shipping agent fields when copying ship-to customer address fields from customer.

[IntegrationEvent(False,False)]
local procedure OnCopyShipToCustomerAddressFieldsFromCustOnBeforeValidateShippingAgentFields(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; SellToCustomer: Record Customer; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

SellToCustomer Table Microsoft.Sales.Customer.Customer

The sell-to customer record.

IsHandled Boolean

Set to true to skip the default validation logic.

OnSetShipToCustomerAddressFieldsFromShipToAddrOnBeforeValidateShippingAgentFields

Raised before validating shipping agent fields when setting ship-to customer address fields from ship-to address.

[IntegrationEvent(False,False)]
local procedure OnSetShipToCustomerAddressFieldsFromShipToAddrOnBeforeValidateShippingAgentFields(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ShipToAddr: Record "Ship-to Address"; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

ShipToAddr Table Microsoft.Sales.Customer."Ship-to Address"

The ship-to address record.

IsHandled Boolean

Set to true to skip the default validation logic.

OnInitRecordOnBeforeGetNextArchiveDocOccurrenceNo

Raised before getting the next archive document occurrence number during record initialization.

[IntegrationEvent(False,False)]
local procedure OnInitRecordOnBeforeGetNextArchiveDocOccurrenceNo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being initialized.

IsHandled Boolean

Set to true to skip the default logic.

OnRecreateSalesLinesOnBeforeCopyReservEntryFromTemp

Raised before copying reservation entries from temporary records during sales lines recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateSalesLinesOnBeforeCopyReservEntryFromTemp(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldName: Text[100])

Parameters

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

The sales line record.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line record.

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

ChangedFieldName Text[100]

The name of the field that was changed.

OnBeforeCheckCustomerPostingGroupChange

Raised before checking if the customer posting group has changed.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckCustomerPostingGroupChange(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

IsHandled Boolean

Set to true to skip the default check logic.

OnValidatePaymentTermsCodeOnAfterValidatePaymentDiscountWhenBlank

Raised after validating the payment discount when payment terms code is blank.

[IntegrationEvent(False,False)]
local procedure OnValidatePaymentTermsCodeOnAfterValidatePaymentDiscountWhenBlank(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrentFieldNo Integer

The current field number being processed.

OnUpdateSalesLineAmountsOnAfterSalesLineSetFilters

Raised after setting sales line filters when updating sales line amounts.

[IntegrationEvent(False,False)]
local procedure OnUpdateSalesLineAmountsOnAfterSalesLineSetFilters(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")

Parameters

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

The sales header record.

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

The sales line record with filters applied.

OnLookupAdjmtValueEntriesCaseDocumentTypeElse

Raised for the else case of document type when looking up adjustment value entries.

[IntegrationEvent(False,False)]
local procedure OnLookupAdjmtValueEntriesCaseDocumentTypeElse(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; QtyType: Option)

Parameters

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

The sales header record.

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

The sales line record.

QtyType Option

The quantity type (General or Invoicing).

OnBeforeSalesLinesExist

Raised before checking if sales lines exist.

[IntegrationEvent(False,False)]
local procedure OnBeforeSalesLinesExist(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var Result: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default check logic.

Result Boolean

The result indicating whether sales lines exist.

OnBeforeValidateVATBaseDiscountPct

Raised before validating the VAT base discount percentage.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateVATBaseDiscountPct(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnValidatePricesIncludingVATOnBeforeSalesLineFindFirst

Raised before finding the first sales line when validating prices including VAT.

[IntegrationEvent(False,False)]
local procedure OnValidatePricesIncludingVATOnBeforeSalesLineFindFirst(var SalesLine: Record "Sales Line")

Parameters

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

The sales line record with filters applied.

OnBeforeValidatePaymentMethodCode

Raised before validating the payment method code.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidatePaymentMethodCode(var SalesHeader: Record "Sales Header"; PaymentMethod: Record "Payment Method"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

PaymentMethod Table Microsoft.Bank.BankAccount."Payment Method"

The payment method record.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeOnInsert

Raised before the OnInsert trigger.

[IntegrationEvent(False,False)]
local procedure OnBeforeOnInsert(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var InsertMode: Boolean)

Parameters

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

The sales header record being inserted.

IsHandled Boolean

Set to true to skip the default insert logic.

InsertMode Boolean

Indicates the insert mode.

OnValidateSellToCustomerNoOnBeforeUpdateSellToCont

Raised before updating the sell-to contact when validating sell-to customer number.

[IntegrationEvent(False,False)]
local procedure OnValidateSellToCustomerNoOnBeforeUpdateSellToCont(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; SellToCustomer: Record Customer; var SkipSellToContact: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

SellToCustomer Table Microsoft.Sales.Customer.Customer

The sell-to customer record.

SkipSellToContact Boolean

Set to true to skip updating the sell-to contact.

OnDeferralHeadersExistOnAfterSetFilters

Raised after setting filters when checking if deferral headers exist.

[IntegrationEvent(False,False)]
local procedure OnDeferralHeadersExistOnAfterSetFilters(var SalesHeader: Record "Sales Header"; var DeferralHeader: Record "Deferral Header")

Parameters

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

The sales header record.

DeferralHeader Table Microsoft.Finance.Deferral."Deferral Header"

The deferral header record with filters applied.

OnCopySellToCustomerAddressFieldsFromCustomerOnBeforeUpdateLocation

Raised before updating the location when copying sell-to customer address fields.

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

Parameters

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

The sales header record being updated.

SellToCustomer Table Microsoft.Sales.Customer.Customer

The sell-to customer record.

IsHandled Boolean

Set to true to skip the default update logic.

OnValidateVATReportingDateOnBeforeInitVATDate

Raised before initializing the VAT date when validating VAT reporting date.

[IntegrationEvent(False,False)]
local procedure OnValidateVATReportingDateOnBeforeInitVATDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

IsHandled Boolean

Set to true to skip the default initialization logic.

OnShowDocDimOnBeforeSalesHeaderModify

Raised before modifying the sales header when showing document dimensions.

[IntegrationEvent(False,False)]
local procedure OnShowDocDimOnBeforeSalesHeaderModify(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record being modified.

OnCreateDimSetForPrepmtAccDefaultDimOnBeforeTempSalesLineCreateDim

Raised before creating dimensions on a temporary sales line for prepayment account default dimensions.

[IntegrationEvent(False,False)]
local procedure OnCreateDimSetForPrepmtAccDefaultDimOnBeforeTempSalesLineCreateDim(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; SalesLine: Record "Sales Line")

Parameters

Name Type Description
DefaultDimSource List of [Dictionary of [Integer, Code[20]]]

The default dimension source list.

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

The sales line record.

OnBeforeInitDefaultDimensionSources

Raised before initializing default dimension sources.

[IntegrationEvent(False,False)]
local procedure OnBeforeInitDefaultDimensionSources(var SalesHeader: Record "Sales Header"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)

Parameters

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

The sales header record.

DefaultDimSource List of [Dictionary of [Integer, Code[20]]]

The default dimension source list to initialize.

FieldNo Integer

The field number triggering the initialization.

OnValidateSelltoContactNoOnBeforeValidateSalespersonCode

Raised before validating the salesperson code when validating sell-to contact number.

[IntegrationEvent(False,False)]
local procedure OnValidateSelltoContactNoOnBeforeValidateSalespersonCode(var SalesHeader: Record "Sales Header"; Contact: Record Contact; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

Contact Table Microsoft.CRM.Contact.Contact

The contact record.

IsHandled Boolean

Set to true to skip the default validation logic.

OnCreateInvtPutAwayPickOnBeforeTestingStatus

Raised before testing the status when creating inventory put-away or pick.

[IntegrationEvent(False,False)]
local procedure OnCreateInvtPutAwayPickOnBeforeTestingStatus(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record being tested.

OnSendToPostingOnAfterPost

Raised after posting when sending to posting.

[IntegrationEvent(False,False)]
local procedure OnSendToPostingOnAfterPost(var SalesHeader: Record "Sales Header"; IsSuccess: Boolean)

Parameters

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

The sales header record that was posted.

IsSuccess Boolean

Indicates whether the posting was successful.

OnBeforeCheckItemAvailabilityInLines

Raised before checking item availability in lines.

[IntegrationEvent(False,False)]
local procedure OnBeforeCheckItemAvailabilityInLines(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var IsHandled: Boolean)

Parameters

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

The sales header record.

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

The sales line record to check.

IsHandled Boolean

Set to true to skip the default check logic.

OnValidateSellToCustomerNoOnAfterTestStatusOpen

Raised after testing status open when validating sell-to customer number.

[IntegrationEvent(False,False)]
local procedure OnValidateSellToCustomerNoOnAfterTestStatusOpen(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

IsHandled Boolean

Set to true to skip further processing.

OnValidateBillToCustomerNoOnAfterCheckBilltoCustomerNoChanged

Raised after checking if bill-to customer number changed when validating bill-to customer number.

[IntegrationEvent(False,False)]
local procedure OnValidateBillToCustomerNoOnAfterCheckBilltoCustomerNoChanged(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean; var IsHandledDoExist: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip further processing.

IsHandledDoExist Boolean

Set to true to indicate that the do exist check was handled.

OnValidateSellToContactNoOnAfterContCheckIfPrivacyBlockedGeneric

Raised after checking if contact is privacy blocked when validating sell-to contact number.

[IntegrationEvent(False,False)]
local procedure OnValidateSellToContactNoOnAfterContCheckIfPrivacyBlockedGeneric(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

IsHandled Boolean

Set to true to skip further processing.

OnRecreateSalesLinesHandleSupplementTypesOnAfterCreateSalesLine

Raised after creating a sales line when handling supplement types during recreation.

[IntegrationEvent(False,False)]
local procedure OnRecreateSalesLinesHandleSupplementTypesOnAfterCreateSalesLine(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)

Parameters

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

The sales header record.

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

The sales line record that was created.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line record used as source.

OnBeforeConfirmCloseUnposted

Raised before confirming close unposted.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmCloseUnposted(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

Result Boolean

The result indicating whether to proceed with closing.

IsHandled Boolean

Set to true to skip the default confirmation logic.

OnBeforeGetFilterCustNo

Raised before getting filter customer number.

[IntegrationEvent(False,False)]
local procedure OnBeforeGetFilterCustNo(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record.

OnConfirmCloseUnpostedOnSalesLinesExist

Raised when confirming close unposted and sales lines exist.

[IntegrationEvent(False,False)]
local procedure OnConfirmCloseUnpostedOnSalesLinesExist(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

Result Boolean

The result indicating whether to proceed with closing.

IsHandled Boolean

Set to true to skip the default confirmation logic.

OnBeforeResetInvoiceDiscountValue

Raised before resetting the invoice discount value.

[IntegrationEvent(False,False)]
local procedure OnBeforeResetInvoiceDiscountValue(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default reset logic.

OnCreateSalesLineOnBeforeAssignType

Raised before assigning the type when creating a sales line.

[IntegrationEvent(False,False)]
local procedure OnCreateSalesLineOnBeforeAssignType(var SalesLine: Record "Sales Line"; TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header")

Parameters

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

The sales line record being created.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line record used as source.

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

The sales header record.

OnCreateSalesLineOnBeforeValidateShipmentDate

Raised before validating the shipment date when creating a sales line.

[IntegrationEvent(False,False)]
local procedure OnCreateSalesLineOnBeforeValidateShipmentDate(var SalesLine: Record "Sales Line"; TempSalesLine: Record "Sales Line" temporary; SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales line record being created.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line record used as source.

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

The sales header record.

IsHandled Boolean

Set to true to skip the default validation logic.

OnCreateSalesLineOnBeforeSetDropShipment

Raised before setting the drop shipment flag when creating a sales line.

[IntegrationEvent(False,False)]
local procedure OnCreateSalesLineOnBeforeSetDropShipment(var SalesLine: Record "Sales Line"; TempSalesLine: Record "Sales Line" temporary; var IsHandled: Boolean)

Parameters

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

The sales line record being created.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line record used as source.

IsHandled Boolean

Set to true to skip the default logic.

OnCreateSalesLineOnAfterValidateNo

Raised after validating the number field when creating a sales line.

[IntegrationEvent(False,False)]
local procedure OnCreateSalesLineOnAfterValidateNo(var SalesLine: Record "Sales Line"; TempSalesLine: Record "Sales Line" temporary)

Parameters

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

The sales line record that was created.

TempSalesLine Table Microsoft.Sales.Document."Sales Line"

The temporary sales line record used as source.

OnCheckCustomerCreatedOnBeforeConfirmProcess

Raised before confirming the customer creation process.

[IntegrationEvent(False,False)]
local procedure OnCheckCustomerCreatedOnBeforeConfirmProcess(SalesHeader: Record "Sales Header"; var Prompt: Boolean; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

Prompt Boolean

Indicates whether to prompt the user.

Result Boolean

The result of the check.

IsHandled Boolean

Set to true to skip the default confirmation logic.

OnBeforeConfirmUpdateDeferralDate

Raised before confirming the deferral date update.

[IntegrationEvent(False,False)]
local procedure OnBeforeConfirmUpdateDeferralDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default confirmation logic.

OnBeforeSetCompanyBankAccount

Raised before setting the company bank account.

[IntegrationEvent(False,False)]
local procedure OnBeforeSetCompanyBankAccount(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

IsHandled Boolean

Set to true to skip the default logic.

OnUpdateSellToCustOnAfterFindContactBusinessRelation

Raised after finding the contact business relation when updating sell-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateSellToCustOnAfterFindContactBusinessRelation(SalesHeader: Record "Sales Header"; Contact: Record Contact; var ContactBusinessRelation: Record "Contact Business Relation"; var ContactBusinessRelationFound: Boolean)

Parameters

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

The sales header record.

Contact Table Microsoft.CRM.Contact.Contact

The contact record.

ContactBusinessRelation Table Microsoft.CRM.BusinessRelation."Contact Business Relation"

The contact business relation record that was found.

ContactBusinessRelationFound Boolean

Indicates whether the contact business relation was found.

OnUpdateBillToCustOnAfterFindContactBusinessRelation

Raised after finding the contact business relation when updating bill-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateBillToCustOnAfterFindContactBusinessRelation(SalesHeader: Record "Sales Header"; Contact: Record Contact; var ContactBusinessRelation: Record "Contact Business Relation"; var ContactBusinessRelationFound: Boolean)

Parameters

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

The sales header record.

Contact Table Microsoft.CRM.Contact.Contact

The contact record.

ContactBusinessRelation Table Microsoft.CRM.BusinessRelation."Contact Business Relation"

The contact business relation record that was found.

ContactBusinessRelationFound Boolean

Indicates whether the contact business relation was found.

OnCopyShipToCustomerAddressFieldsFromCustOnAfterAssignAddressFromSellToCustomer

Raised after assigning the address from sell-to customer when copying ship-to customer address fields.

[IntegrationEvent(False,False)]
procedure OnCopyShipToCustomerAddressFieldsFromCustOnAfterAssignAddressFromSellToCustomer(var SalesHeader: Record "Sales Header"; SellToCustomer: Record Customer)

Parameters

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

The sales header record that was updated.

SellToCustomer Table Microsoft.Sales.Customer.Customer

The sell-to customer record used as source.

OnBeforeHasSellToAddress

Raised before checking if the sales header has a sell-to address.

[IntegrationEvent(False,False)]
local procedure OnBeforeHasSellToAddress(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

Result Boolean

The result indicating whether the sales header has a sell-to address.

IsHandled Boolean

Set to true to skip the default check logic.

OnBeforeHasShipToAddress

Raised before checking if the sales header has a ship-to address.

[IntegrationEvent(False,False)]
local procedure OnBeforeHasShipToAddress(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

Result Boolean

The result indicating whether the sales header has a ship-to address.

IsHandled Boolean

Set to true to skip the default check logic.

OnBeforeHasBillToAddress

Raised before checking if the sales header has a bill-to address.

[IntegrationEvent(False,False)]
local procedure OnBeforeHasBillToAddress(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

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

The sales header record.

Result Boolean

The result indicating whether the sales header has a bill-to address.

IsHandled Boolean

Set to true to skip the default check logic.

OnAfterSetShipToAddress

Raised after setting the ship-to address.

[IntegrationEvent(False,False)]
local procedure OnAfterSetShipToAddress(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was updated.

OnBeforeValidateShipmentDate

Raised before validating the shipment date.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShipmentDate(var SalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

CurrentFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeValidatePaymentDiscount

Raised before validating the payment discount.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidatePaymentDiscount(var SalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

CurrentFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeUpdateSalesOrderLineIfExist

Raised before updating sales order lines if they exist.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateSalesOrderLineIfExist(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default update logic.

OnBeforeLinkSalesDocWithOpportunity

Raised before linking a sales document with an opportunity.

[IntegrationEvent(False,False)]
local procedure OnBeforeLinkSalesDocWithOpportunity(var SalesHeader: Record "Sales Header"; OldOpportunityNo: Code[20]; var IsHandled: Boolean)

Parameters

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

The sales header record being linked.

OldOpportunityNo Code[20]

The old opportunity number.

IsHandled Boolean

Set to true to skip the default link logic.

OnBeforeUpdateVATReportingDate

Raised before updating the VAT reporting date.

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateVATReportingDate(var SalesHeader: Record "Sales Header"; CalledByFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

CalledByFieldNo Integer

The field number that called the update.

IsHandled Boolean

Set to true to skip the default update logic.

OnBeforeSendToPosting

Raised before sending the document to posting.

[IntegrationEvent(False,False)]
local procedure OnBeforeSendToPosting(var SalesHeader: Record "Sales Header"; var IsSuccess: Boolean; var IsHandled: Boolean; PostingCodeunitID: Integer)

Parameters

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

The sales header record being posted.

IsSuccess Boolean

Indicates whether the posting was successful.

IsHandled Boolean

Set to true to skip the default posting logic.

PostingCodeunitID Integer

The codeunit ID used for posting.

OnUpdateSellToCustOnBeforeValidateBillToContactNo

Raised before validating the bill-to contact number when updating sell-to customer.

[IntegrationEvent(False,False)]
local procedure OnUpdateSellToCustOnBeforeValidateBillToContactNo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforePerformManualRelease

Raised before performing a manual release.

[IntegrationEvent(False,False)]
local procedure OnBeforePerformManualRelease(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being released.

IsHandled Boolean

Set to true to skip the default release logic.

OnBeforeIsNotFullyCancelled

Obsolete

This element will become obsolete from version 27.0. Removed Not used anymore.

Raised before checking if the document is not fully cancelled.

[Obsolete(Removed Not used anymore.,27.0)]
[IntegrationEvent(False,False)]
local procedure OnBeforeIsNotFullyCancelled(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var Result: Boolean; var IsHandled: Boolean)

Parameters

Name Type Description
SalesCrMemoHeader Table Microsoft.Sales.History."Sales Cr.Memo Header"

The sales credit memo header record.

Result Boolean

The result indicating whether the document is not fully cancelled.

IsHandled Boolean

Set to true to skip the default check logic.

OnCheckCreditLimitOnAfterCreditLimitCheck

Raised after the credit limit check.

[IntegrationEvent(False,False)]
local procedure OnCheckCreditLimitOnAfterCreditLimitCheck(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record that was checked.

OnBeforeCreateDimFromDefaultDim

Raised before creating dimensions from default dimensions.

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateDimFromDefaultDim(var Rec: Record "Sales Header"; FieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record.

FieldNo Integer

The field number triggering the dimension creation.

IsHandled Boolean

Set to true to skip the default creation logic.

OnBeforeValidateCustomerDiscGroup

Raised before validating the customer discount group.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidateCustomerDiscGroup(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CurrentFieldNo Integer

The current field number being processed.

IsHandled Boolean

Set to true to skip the default validation logic.

OnBeforeSetWorkDescription

Raised before setting the work description.

[IntegrationEvent(False,False)]
local procedure OnBeforeSetWorkDescription(var SalesHeader: Record "Sales Header"; var NewWorkDescription: Text)

Parameters

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

The sales header record being updated.

NewWorkDescription Text

The new work description text.

OnBeforeLookupPrepmtCrMemoNoSeries

Raised before looking up the prepayment credit memo number series.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupPrepmtCrMemoNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default lookup logic.

OnBeforeValidatePrepmtCrMemoNoSeries

Raised before validating the prepayment credit memo number series.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidatePrepmtCrMemoNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnCalcOutstandingQuantityBaseOnAfterSalesLineSetFilters

Obsolete

This element will become obsolete from version 27.0. Not used anymore due to new implementation that uses Query. Replaced by OnBeforeCalculateReservableOutstandingQuantityBase.

Raised after setting sales line filters when calculating outstanding quantity base.

[Obsolete(Not used anymore due to new implementation that uses Query. Replaced by OnBeforeCalculateReservableOutstandingQuantityBase.,27.0)]
[IntegrationEvent(False,False)]
local procedure OnCalcOutstandingQuantityBaseOnAfterSalesLineSetFilters(var SalesLine: Record "Sales Line")

Parameters

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

The sales line record with filters applied.

OnBeforeCalculateReservableOutstandingQuantityBase

Raised before calculating the reservable outstanding quantity base.

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

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default calculation logic.

OutstandingQtyBase Decimal

The outstanding quantity base to calculate.

OnBeforeModifyBillToCustomerAddress

Raised before modifying the bill-to customer address.

[IntegrationEvent(False,False)]
local procedure OnBeforeModifyBillToCustomerAddress(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being updated.

IsHandled Boolean

Set to true to skip the default modification logic.

OnAfterValidateAppliesToDocNo

Raised after validating the applies-to document number.

[IntegrationEvent(False,False)]
local procedure OnAfterValidateAppliesToDocNo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CustLedgEntry: Record "Cust. Ledger Entry")

Parameters

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

The sales header record that was validated.

xSalesHeader Table Microsoft.Sales.Document."Sales Header"

The previous version of the sales header record.

CustLedgEntry Table Microsoft.Sales.Receivables."Cust. Ledger Entry"

The customer ledger entry that was applied.

OnBeforeLookupPrepmtNoSeries

Raised before looking up the prepayment number series.

[IntegrationEvent(False,False)]
local procedure OnBeforeLookupPrepmtNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record.

IsHandled Boolean

Set to true to skip the default lookup logic.

OnBeforeValidatePrepmtNoSeries

Raised before validating the prepayment number series.

[IntegrationEvent(False,False)]
local procedure OnBeforeValidatePrepmtNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

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

The sales header record being validated.

IsHandled Boolean

Set to true to skip the default validation logic.

OnCopySellToCustomerFilterOnAfterGetSellToCustomerFilter

Raised after getting the sell-to customer filter when copying.

[IntegrationEvent(False,False)]
local procedure OnCopySellToCustomerFilterOnAfterGetSellToCustomerFilter(var SalesHeader: Record "Sales Header"; var SellToCustomerFilter: Text)

Parameters

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

The sales header record.

SellToCustomerFilter Text

The sell-to customer filter text.

OnBeforeSetSellToCustomerFromFilter

Raised before setting the sell-to customer from a filter.

[IntegrationEvent(False,False)]
local procedure OnBeforeSetSellToCustomerFromFilter(var SalesHeader: Record "Sales Header")

Parameters

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

The sales header record being updated.

OnLookupSellToCustomerNameOnBeforeSelectCustomer

Raised before selecting a customer when looking up sell-to customer name.

[IntegrationEvent(False,False)]
local procedure OnLookupSellToCustomerNameOnBeforeSelectCustomer(SalesHeader: Record "Sales Header"; var Customer: Record Customer; var CustomerName: Text)

Parameters

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

The sales header record.

Customer Table Microsoft.Sales.Customer.Customer

The customer record to select.

CustomerName Text

The customer name text.

OnCalcQuoteValidUntilDateOnBeforeAssign

[IntegrationEvent(False,False)]
local procedure OnCalcQuoteValidUntilDateOnBeforeAssign(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var QuoteValidityCalculation: DateFormula; UpdateDocumentDate: Boolean)

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"
xSalesHeader Table Microsoft.Sales.Document."Sales Header"
QuoteValidityCalculation DateFormula
UpdateDocumentDate Boolean

OnBeforeResponsibilityCenterValidate

[IntegrationEvent(False,False)]
local procedure OnBeforeResponsibilityCenterValidate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"
xSalesHeader Table Microsoft.Sales.Document."Sales Header"
IsHandled Boolean

See also