Share via


Interface "Price Source"

Namespace: Microsoft.Pricing.Source

Methods

GetNo

The method fills the Price Source parameter with "Source No." and other data from the source defined in the implementation codeunit.

procedure GetNo(var PriceSource: Record "Price Source" temporary)

Parameters

Name Type Description
PriceSource Table Microsoft.Pricing.Source."Price Source"

the record gets filled with data

GetId

The method fills the Price Source parameter with "Source ID" and other data from the source defined in the implementation codeunit.

procedure GetId(var PriceSource: Record "Price Source" temporary)

Parameters

Name Type Description
PriceSource Table Microsoft.Pricing.Source."Price Source"

the record gets filled with data

IsForAmountType

The method should return true if the source can define both price and discount. If the price source is relevant only for prices it should return true when AmountType is Price, and false if AmountType is Discount E.g., "Customer Price Group" is not relevant for discounts, "Customer Discount Group" is not relevant for prices.

procedure IsForAmountType(AmountType: Enum "Price Amount Type"): Boolean

Parameters

Name Type Description
AmountType Enum Microsoft.Pricing.PriceList."Price Amount Type"

Current amount type: price or discount

Returns

Type Description
Boolean

true if the price source is relevant for the AmountType

IsLookupOK

The method runs the modal page for looking up for a price source.

procedure IsLookupOK(var PriceSource: Record "Price Source" temporary): Boolean

Parameters

Name Type Description
PriceSource Table Microsoft.Pricing.Source."Price Source"

Defines the default price source to be shown on opening of the lookup page

Returns

Type Description
Boolean

true if the lookup is completed

VerifyParent

The method should throw an error if the price source does not support the parent source, but "Parent Source No" is filled, and vice versa, if the parent source is supported but "Parent Source No" is empty or inconsistent. E.g., "Job Task" is the only price source that supports "Job" price source as a parent.

procedure VerifyParent(var PriceSource: Record "Price Source" temporary): Boolean

Parameters

Name Type Description
PriceSource Table Microsoft.Pricing.Source."Price Source"

Current price source

Returns

Type Description
Boolean

true is the parent is supported and validated

IsSourceNoAllowed

The method should return true for a source that requires "Source No." to be filled. In W1 returns false for group source types: "All", "All Customers", "All Vendors", "All Jobs".

procedure IsSourceNoAllowed(): Boolean

Returns

Type Description
Boolean

true is "Source No." must be filled

GetGroupNo

The method should return "Source No." of the related Customer, Vendor, or Job. E.g., "Job Task" returns the parent job's "Source No.", so the detailed price calculation setup defined for the job will be applied for all Job Tasks.

procedure GetGroupNo(PriceSource: Record "Price Source" temporary): Code[20]

Parameters

Name Type Description
PriceSource Table Microsoft.Pricing.Source."Price Source"

Current price source

Returns

Type Description
Code[20]

"Source No." of the related customer, vendor, or job

See also