Understand generating on-demand samples
- Last UpdatedNov 04, 2024
- 2 minute read
You can use the Generate Sample command to generate samples on demand. When using this command, you identify a QM Specification to use for the on-demand sample. The QM specification specifies which characteristics should be considered in the on-demand sample, which sample plan should be used, and the sample name (as defined in the sample plan).
When generating an on-demand sample from the SRO, the provided QM Specification attribute is used to create a new ready sample for the object’s parent entity with a requested time set to the current time. A check is performed to verify that the provided QM Specification is an active QM Specification.
-
If there is more than one version of the QM Specification, then the version with the most recent start effectivity date whose end effectivity is not in the past will be selected.
-
If there are no versions of the QM Specification that are active, an error will be returned.
The sample generated from the QM Specification will have all the characteristics that belong to the QM Specification whose severity is not Unused.
-
The sample context fields for work order, operation, sequence number, and item will be set to the current job running on the entity at the lowest job position.
-
If the QM Specification’s sample plan contains a "Manual" sample frequency definition, then it will be used; otherwise, the first "Manual" sample frequency definition in the database will be used.
-
The sample name will be set based on the sample plan associated to the QM Specification.
-
The warning time and expiration time for the sample will be set based on the sample frequency definition.
If warning and expiration times are to be set, then a Manual sample frequency must exist in the database. If the command completes successfully, the SampleID of the created sample will be populated in the Sample.SampleID object attribute.