The Sampling Plan Policy determines how a Sampling Plan is applied to a SDI.

Property Description
Sampling Plan Type Specifies details concering the Sampling Plan:
Property Name Description
SDCSDC to which the Sampling Plan is applied. For example, the OOB behavior is that the Sampling Plan is used by the Batch SDC to create Samples. The SDIs created are configured by the "SDI Created by this Sampling Plan" property below.
Apply Event Determines when the Sampling Plan is applied to the above SDC. For example, "On Creation" applies the Sampling Plan during creation of the Batch.
Size ColumnColumn containing the value used for evaluation of the Count Rule, which is specified for a combination of each Level and Source Label defined in Sampling Plan. The value in this column is considered during application of the Sampling Plan to determine the number of Samples created.
SDI Created by this Sampling PlanDetermines the SDI created when the Sampling Plan is applied to the above SDC. For example, the OOB behavior is that Sample SDIs are created whenever a Sampling Plan is applied to a Batch.
Based on SDCSDC on which the selected "SDC" is based. The selected SDC is the one to which the Sampling Plan is applied. For example, given a Batch and a Product, the Batch is the SDC to which the Sampling Plan is applied, and the Product is based on the SDC.
SDI Columns to be Populated
with Sampling Plan Info
Determines which columns of the Target SDC are populated with the Sampling Plan information. For example, the OOB behavior is that "samplingplanid" is copied to the "sourcespid" column of Sample.
Evaluation Sort ByThe column specified in this property is used during evaluation of the rules that are based on a date range. For example, given a rule of "Set Level to Full when less than 2 items passed in the last 6 months", if the value of this property is "createdt", it is used to count the Batches created in the last 6 months.
Product Variant Type Determines the column mapping between the SDC on which the Sampling Plan is applied and the Product Variant SDC.

For example, the OOB behavior is this: For a "Raw Material" Batch, the ProductId of the Batch is matched with the ProductId of the Product Variant and supplieraddressid of Batch with supplieraddressid of ProdVariant. Preference is given if both columns match, in which case the Sampling Plan of that matching Product Variant is applied to the Batch. If both do not match, the only Product Variant considered is the one whose ProductId matches with Batch productid, and whose supplieraddressid is null or empty (or vice-versa).

Property Name Description
SDCSDC on which the Sampling Plan is applied.
TypeProduct Variant Type to apply ("Raw Material" or "Finished").
Column Mapping Maps column values from an SDC (typically "Batch") to column values of the Product Variant (ProdVariant) SDC.

When a Sampling Plan Policy is applied to a Batch SDI, the Product Variant SDIs associated with the Product of the Batch SDI are retrieved based on the column values that match those of the Batch SDI. For example:

If Batch SDIs are created with a "Sugar" Product Id, and the Supplier Id is "Fidel", the Product Variant SDI of Product Variant Type "Raw Material" and Product Id of "Sugar or (null) and Supplier Id of "Fidel" or (null) is retrieved.
The Batch SDI is applied with the associated Sampling Plan of that Product Variant SDI.
Property Name Description
SDC ColumnSDC column mapped to the Product Variant column below.
ProdVariant ColumnProduct Variant column mapped to the SDC column above.
Custom Rules LabVantage provides a predefined set of Level and Transition Rules. This is for when you want to define your own custom Rule Types:
Property Name Description
Rule TypeSpecifies the Rule Type (Level or Transition).
Rule List of all Rules. Select the new custom Rule here.
Java Object Name (including package) Specifies the Java class name and package

All custom rule classes must implement the com.labvantage.sapphire.pages.prodvariantruleeditor.RuleTypeProcessor interface in order to define the editor and rule evaluator specific to the rule requirement.

Fiscal Year Starts In Defines the start month of the fiscal year. This property is necessary for the evaluation of Level rules. For example, "Set Level to Full on first item of the Year": If the start month of the fiscal year is set to March, per this rule, the Level of the first Batch received in the month of March is set to "Full".
Action Collection Specifies details concerning items eligible to be applied to SDIs created by the Sampling Plan. The items configured here are available as items that can be applied to the Samples created by the Sampling Plan in the Sampling Plan Detail Item element in the Sampling Plan Maint page.
Property Name Description
Item SDC IdItems applied to SDIs created by the Sampling Plan.
Display NameName displayed for the item in the Sampling Plan page.
Show Shows/hides the item in the Sampling Plan page.
Lookup URLURL to the Lookup page for the item in the Sampling Plan page.
Action IdAction that executes when the Sampling Plan is applied to the SDI.
Action Version IdVersion of the Action above.
Action Input Properties Action property definitions:
Property Name Description
Property IdIdentifier of the Action property.
Property ValueValue of the Action property.

These variables can be used for the Action Input properties:

Variable Refers to...
[primarysdcid]

[primarykeyid1/2/3]

SDI created by this Sampling Plan (such as Sample).
[sdcid]

[keyid1/2/3]

SDI on which the Sampling Plan is applied (such as Batch).
[itemsdcid]

[itemkeyid1/2/3]

Item SDIs to be applied to the SDI created by the plan (such as WorkItem).
[samplingplanid]

[samplingplanversionid]

[prodvariantid]

[levelid]

Sampling Plan information applied to the SDC.
[productid]

[supplieraddressid]

Product Variant Type columns.