Item tracking group

Sometimes it is necessary to know what type of tracking is active for an item. From the Product (EcoResProduct) you can get this information a follows:

First get the tracking group for the product:

Select firstonly recid from EcoResTrackingDimensionGroupProduct
where EcoResTrackingDimensionGroupProduct.Product == EcoResProduct.RecId;

Once you have the tracking groups recid you can lookup the individual tracking field:

Select firstonly IsActive from EcoResTrackingDimensionGroupFldSetup
where EcoResTrackingDimensionGroupFldSetup.TrackingDimensionGroup == EcoResTrackingDimensionGroupProduct.RecId && EcoResTrackingDimensionGroupFldSetup.DimensionFieldId == fieldnum(InventDim, <tracking field>);

Tracking fields might be InventSerialId or InventBatchId.

You can now look at the isActive field, EcoResTrackingDimensionGroupFldSetup.IsActive, to determine if the tracking field is active.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s