KVSKBASalesContractLine
Fields
| Name | Type | Note |
|---|---|---|
| Contract No. | Code[20] | |
| Line No. | Integer | |
| Customer No. | Code[20] | |
| Currency Code | Code[10] | |
| Status | Option | Warning: Obsolete OptionMembers: Open,Released,Finished |
| Valid From | Date | |
| Valid To | Date | |
| Contract Status | Enum (KVSKBASalesContractStatus) | |
| KVSKBAPositionNo | Code[20] | |
| Type | Option | OptionMembers: ,G/L Account,Item,Resource,,,,,,,,,,,,,,Item Price Group |
| No. | Code[20] | |
| Variant Code | Code[10] | |
| Item Reference No. | Code[50] | |
| Description | Text[100] | |
| Description 2 | Text[50] | |
| Unit Price | Decimal | |
| KVSKBAPriceUnit | Decimal | |
| KVSKBAUnitPricePriceUnit | Decimal | |
| Line Discount % | Decimal | |
| Unit of Measure Code | Code[10] | |
| Unit of Measure | Text[50] | |
| Qty. per Unit of Measure | Decimal | |
| Quantity | Decimal | |
| Quantity (Base) | Decimal | |
| Quantity Shipped | Decimal | |
| Qty. Shipped (Base) | Decimal | |
| Outstanding Quantity | Decimal | |
| Outstanding Qty. (Base) | Decimal | |
| Qty. (Base) on Sales Order | Decimal | FlowField |
| Completely Shipped | Boolean | |
| Print Page Break | Boolean | |
| Font Style | Enum (KVSKBAFontStyle) | |
| Price Calculation Method | Enum Price Calculation Method |
Procedures
GetSalesContractHeader() :
Summary: Gets the sales contract header record for the current contract line.
procedure GetSalesContractHeader():
Remarks: This procedure is used in several places in the code, so it is better to have it in a separate procedure to avoid code duplication.
TestStatusOpen() :
Summary: Tests if the sales contract header status is open.
procedure TestStatusOpen():
Remarks: This procedure is used to ensure that the sales contract header is in an open status before performing certain actions.
SuspendStatusCheck(Boolean) :
Summary: Suspends or resumes the status check for the sales contract header.
procedure SuspendStatusCheck(NewStatusCheckSuspended: Boolean):
Parameters:
NewStatusCheckSuspended: Indicates whether to suspend (true) or resume (false) the status check.
Remarks: This procedure is used to temporarily suspend the status check when performing batch updates or other operations where the sales contract header status is expected to be in a non-open status. It is important to ensure that the status check is resumed after the operation is completed to maintain data integrity.
CountDiscount(Boolean) : Integer
Summary: Counts the number of discounts for the sales contract line.
procedure CountDiscount(ShowAll: Boolean): Integer
Parameters:
ShowAll: Indicates whether to show all discounts or only applicable ones.
Returns: The number of discounts.
Remarks: This procedure is used to count the number of discounts for the sales contract line, which can be used for display purposes (e.g. showing the number of discounts in a tooltip). It uses the price calculation handler to get the count of discounts, which ensures that the logic for counting discounts is consistent with the logic for calculating prices and discounts. The ShowAll parameter can be used to indicate whether to count all discounts or only those that are currently applicable to the sales contract line, which can be useful for providing more detailed information to the user.
CountPrice(Boolean) : Integer
Summary: Counts the number of prices for the sales contract line.
procedure CountPrice(ShowAll: Boolean): Integer
Parameters:
ShowAll: Indicates whether to show all prices or only applicable ones.
Returns: The number of prices.
Remarks: This procedure is used to count the number of prices for the sales contract line, which can be used for display purposes (e.g. showing the number of prices in a tooltip). It uses the price calculation handler to get the count of prices, which ensures that the logic for counting prices is consistent with the logic for calculating prices and discounts. The ShowAll parameter can be used to indicate whether to count all prices or only those that are currently applicable to the sales contract line, which can be useful for providing more detailed information to the user.
GetPriceCalculationHandler(Enum Price Type, Record KVSKBASalesContractHeader, Interface Price Calculation) :
procedure GetPriceCalculationHandler(PriceType: Enum "Price Type"; LocalSalesContractHeader: Record "KVSKBASalesContractHeader"; var PriceCalculation: Interface "Price Calculation"):
GetLineWithPrice(Interface Line With Price) :
procedure GetLineWithPrice(var LineWithPrice: Interface "Line With Price"):
Events
OnAfterGetLineWithPrice(Interface Line With Price) :
[IntegrationEvent(true, false)]
local procedure OnAfterGetLineWithPrice(var LineWithPrice: Interface "Line With Price"):
OnAfterGetDateForCalculations(Date, Record KVSKBASalesContractHeader, Record KVSKBASalesContractLine) :
Summary: Event raised after the date for price/discount calculations has been determined.
[IntegrationEvent(false, false)]
local procedure OnAfterGetDateForCalculations(var DocumentDate: Date; KVSKBASalesContractHeader: Record "KVSKBASalesContractHeader"; KVSKBASalesContractLine: Record "KVSKBASalesContractLine"):
Parameters:
DocumentDate: The resolved document date used for calculations.KVSKBASalesContractHeader: The sales contract header record.KVSKBASalesContractLine: The sales contract line record.
Remarks: Use this event to override the calculated document date with a custom value.
OnValidateNoOnAfterAssignFieldsForNo(Record KVSKBASalesContractLine, Record KVSKBASalesContractLine, Record KVSKBASalesContractHeader) :
Summary: Event raised after item-related fields have been assigned following a validate of the No. field.
[IntegrationEvent(false, false)]
local procedure OnValidateNoOnAfterAssignFieldsForNo(var KVSKBASalesContractLine: Record "KVSKBASalesContractLine"; var xKVSKBASalesContractLine: Record "KVSKBASalesContractLine"; KVSKBASalesContractHeader: Record "KVSKBASalesContractHeader"):
Parameters:
KVSKBASalesContractLine: The sales contract line record.xKVSKBASalesContractLine: The previous state of the sales contract line record.KVSKBASalesContractHeader: The sales contract header record.
Remarks: Use this event to apply additional field assignments after the standard No. validation logic has run.
OnValidateNoOnAfterAssignHeaderValues(Record KVSKBASalesContractLine, Record KVSKBASalesContractHeader) :
Summary: Event raised after header values have been assigned to the sales contract line during No. validation.
[IntegrationEvent(false, false)]
local procedure OnValidateNoOnAfterAssignHeaderValues(var KVSKBASalesContractLine: Record "KVSKBASalesContractLine"; KVSKBASalesContractHeaderr: Record "KVSKBASalesContractHeader"):
Parameters:
KVSKBASalesContractLine: The sales contract line record.KVSKBASalesContractHeaderr: The sales contract header record.
Remarks: Use this event to override or extend the header values copied to the line after the standard logic has run.
OnAfterValidateItemReferenceOnBeforeItemReferenceInit(Record KVSKBASalesContractLine) :
Summary: Event raised after the item reference has been validated and before the item reference fields are initialised.
[IntegrationEvent(false, false)]
local procedure OnAfterValidateItemReferenceOnBeforeItemReferenceInit(var KVSKBASalesContractLine: Record "KVSKBASalesContractLine"):
Parameters:
KVSKBASalesContractLine: The sales contract line record.
Remarks: Use this event to modify line fields before the item reference initialisation overwrites them.
OnBeforeItemReferenceNoLookup(Record KVSKBASalesContractLine, Boolean) :
Summary: Event raised before the item reference number lookup is executed.
[IntegrationEvent(false, false)]
local procedure OnBeforeItemReferenceNoLookup(var KVSKBASalesContractLine: Record "KVSKBASalesContractLine"; var IsHandled: Boolean):
Parameters:
KVSKBASalesContractLine: The sales contract line record.IsHandled: Set to true to skip the default lookup logic.
Remarks: Subscribers can set IsHandled to true to provide a custom item reference lookup.
OnBeforeShowLineDiscounts(Record KVSKBASalesContractLine, Boolean) :
Summary: Event raised before the line discounts page is shown.
[IntegrationEvent(false, false)]
local procedure OnBeforeShowLineDiscounts(var KVSKBASalesContractLine: Record "KVSKBASalesContractLine"; var IsHandled: Boolean):
Parameters:
KVSKBASalesContractLine: The sales contract line record.IsHandled: Set to true to skip the default show logic.
Remarks: Subscribers can set IsHandled to true to replace the standard line discounts display with custom behaviour.
OnBeforeShowPrices(Record KVSKBASalesContractLine, Boolean) :
Summary: Event raised before the prices page is shown.
[IntegrationEvent(false, false)]
local procedure OnBeforeShowPrices(var KVSKBASalesContractLine: Record "KVSKBASalesContractLine"; var IsHandled: Boolean):
Parameters:
KVSKBASalesContractLine: The sales contract line record.IsHandled: Set to true to skip the default show logic.
Remarks: Subscribers can set IsHandled to true to replace the standard prices display with custom behaviour.
OnValidateNoOnAfterVerifyChange(Record KVSKBASalesContractLine, Record KVSKBASalesContractLine) :
Summary: Event raised after the change verification has been performed during No. validation.
[IntegrationEvent(false, false)]
local procedure OnValidateNoOnAfterVerifyChange(var SalesContractLine: Record "KVSKBASalesContractLine"; xSalesContractLine: Record "KVSKBASalesContractLine"):
Parameters:
SalesContractLine: The sales contract line record.xSalesContractLine: The previous state of the sales contract line record.
Remarks: Use this event to perform additional checks or assignments after the standard change verification has run.
OnValidateNoOnCopyFromTempSalesLine(Record KVSKBASalesContractLine, Record KVSKBASalesContractLine) :
Summary: Event raised during No. validation when fields are copied from a temporary sales contract line.
[IntegrationEvent(false, false)]
local procedure OnValidateNoOnCopyFromTempSalesLine(var SalesContractLine: Record "KVSKBASalesContractLine"; var TempSalesContractLine: Record "KVSKBASalesContractLine" temporary):
Parameters:
SalesContractLine: The sales contract line record.TempSalesContractLine: The temporary sales contract line used as the copy source.
Remarks: Use this event to copy additional custom fields from the temporary line to the target line.
OnValidateNoOnBeforeInitRec(Record KVSKBASalesContractLine, Record KVSKBASalesContractLine, Integer) :
Summary: Event raised before the record is initialised during No. validation.
[IntegrationEvent(false, false)]
local procedure OnValidateNoOnBeforeInitRec(var SalesContractLine: Record "KVSKBASalesContractLine"; xSalesContractLine: Record "KVSKBASalesContractLine"; CallingFieldNo: Integer):
Parameters:
SalesContractLine: The sales contract line record.xSalesContractLine: The previous state of the sales contract line record.CallingFieldNo: The field number that triggered the validation.
Remarks: Use this event to set custom field values or suppress initialisation steps before the standard init logic runs.
OnBeforeTestItemVariantBlocked(Record KVSKBASalesContractLine, Boolean) :
Summary: Event raised before the item variant blocked status is tested.
[IntegrationEvent(false, false)]
local procedure OnBeforeTestItemVariantBlocked(Rec: Record "KVSKBASalesContractLine"; var IsHandled: Boolean):
Parameters:
Rec: The sales contract line record.IsHandled: Set to true to skip the default blocked check.
Remarks: Subscribers can set IsHandled to true to replace the standard item variant blocked check with custom behaviour.
Protected Variables
Currency
Type: Record Currency
SalesContractHeader
Type: Record (KVSKBASalesContractHeader)