Interface "Line With Price"
Methods
GetTableNo
Returns the table number of the internal record line.
procedure GetTableNo(): Integer
Returns
| Type | Description |
|---|---|
| Integer |
The table id of the source line. |
SetLine
Setup the internal record line. Applicable for the journal lines that does not have a header record. The PriceType parameter defines what type of price is going to be calculated.
procedure SetLine(PriceType: Enum "Price Type", Line: Variant)
Parameters
| Name | Type | Description |
|---|---|---|
| PriceType | Enum Microsoft.Pricing.PriceList."Price Type" |
the price type for which the price or discount will be calculated. |
| Line | Variant |
the source record line |
SetLine
Setup the internal records - line and header. Applicable for the document lines. The PriceType parameter defines what type of price is going to be calculated.
procedure SetLine(PriceType: Enum "Price Type", Header: Variant, Line: Variant)
Parameters
| Name | Type | Description |
|---|---|---|
| PriceType | Enum Microsoft.Pricing.PriceList."Price Type" |
the price type for which the price or discount will be calculated. |
| Header | Variant |
the source record header |
| Line | Variant |
the source record line |
SetSources
This method allows to overwrite the internal price source list that is normally filled by SetLine() method.
procedure SetSources(var NewPriceSourceList: Codeunit "Price Source List")
Parameters
| Name | Type | Description |
|---|---|---|
| NewPriceSourceList | Codeunit Microsoft.Pricing.Source."Price Source List" |
The new list of sources that should be attached to the line |
GetLine
After the calculations are done this method allows to get the updated internal record line.
procedure GetLine(var Line: Variant)
Parameters
| Name | Type | Description |
|---|---|---|
| Line | Variant |
The updated record line |
GetLine
After the calculations are done this method allows to get the updated internal record line and header.
procedure GetLine(var Header: Variant, var Line: Variant)
Parameters
| Name | Type | Description |
|---|---|---|
| Header | Variant | |
| Line | Variant |
The updated record line |
GetAssetType
Returns the asset type of the internal record line.
procedure GetAssetType(): Enum "Price Asset Type"
Returns
| Type | Description |
|---|---|
| Enum Microsoft.Pricing.Asset."Price Asset Type" |
The asset type of the internal record line. |
GetPriceType
Returns the price type that was set by the SetLine() method.
procedure GetPriceType(): Enum "Price Type"
Returns
| Type | Description |
|---|---|
| Enum Microsoft.Pricing.PriceList."Price Type" |
The price type |
IsPriceUpdateNeeded
This method defines if the source line should be updated after the search for a price list line is done.
procedure IsPriceUpdateNeeded(AmountType: Enum "Price Amount Type", FoundPrice: Boolean, CalledByFieldNo: Integer): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| AmountType | Enum Microsoft.Pricing.PriceList."Price Amount Type" |
The amount type |
| FoundPrice | Boolean |
If FoundPrice is true this method returns true |
| CalledByFieldNo | Integer |
The number of the field that caused the calculation |
Returns
| Type | Description |
|---|---|
| Boolean |
If the price amount should be updated |
IsDiscountAllowed
The calculation of the price defines if the discount allowed for this line. This method should be called after the price is calculated.
procedure IsDiscountAllowed(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
If the discount allowed for this line |
Verify
Verification of the line before price calculation, usually some TESTFIELD calls.
procedure Verify()
SetAssetSourceForSetup
Copy asset and source data to the buffer to search for a detailed price calculation setup.
procedure SetAssetSourceForSetup(var DtldPriceCalculationSetup: Record "Dtld. Price Calculation Setup"): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| DtldPriceCalculationSetup | Table Microsoft.Pricing.Calculation."Dtld. Price Calculation Setup" |
The buffer record that get values of filters for search |
Returns
| Type | Description |
|---|---|
| Boolean |
If the internal record line is consistent and all filters for detailed setup are in place |
CopyToBuffer
Copy the fields related for price calculation to the buffer that is used in calculation handlers.
procedure CopyToBuffer(var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| PriceCalculationBufferMgt | Codeunit Microsoft.Pricing.Calculation."Price Calculation Buffer Mgt." |
The buffer that got filled |
Returns
| Type | Description |
|---|---|
| Boolean |
If all the internal record line is consistent and can fill the buffer |
Update
This method is called after the calculation and allow to do corrections.
procedure Update(AmountType: Enum "Price Amount Type")
Parameters
| Name | Type | Description |
|---|---|---|
| AmountType | Enum Microsoft.Pricing.PriceList."Price Amount Type" |
The amount type |
SetPrice
After calculation is done, and the right price list line is found this method copies required fields to the internal record line. The amount type defines what amount will be copied.
procedure SetPrice(AmountType: Enum "Price Amount Type", PriceListLine: Record "Price List Line")
Parameters
| Name | Type | Description |
|---|---|---|
| AmountType | Enum Microsoft.Pricing.PriceList."Price Amount Type" |
the amount type. |
| PriceListLine | Table Microsoft.Pricing.PriceList."Price List Line" |
The price list line that should define the price or discount. |
ValidatePrice
The method SetPrice() copies amounts to the internal record line. This method calls the validation triggers on the amount defined by AmountType parameter.
procedure ValidatePrice(AmountType: Enum "Price Amount Type")
Parameters
| Name | Type | Description |
|---|---|---|
| AmountType | Enum Microsoft.Pricing.PriceList."Price Amount Type" |
the amount type |