R29963-6 Product - Populate Required Properties From Product Group

Code 29963-6
Entity General.Products.Products Entity
Name PopulateRequiredPropertiesFromProductGroup
Attribute
Layer Front-End
Events AttributeChanged(ProductGroup)
Priority Normal
Modify YES
Applicable Legislations ALL // no condition needed
Action
  1. Delete all property values of the current product if they don't have a value.
  2. If ProductGroup!=null Foreach (ProductGroup.RequiredProperties and ProductGroup.ParentGroups.RequiredProperties) IF(Product.CustomProperties(PropertyId=RequiredProperty.PropertyID).Count=0) Create new PropertyValue ( newPV.Property = RequiredProperty.Property; newPV.PropertyValueField = RequiredProperty.DefaultPropertyValue; newPV.Description = RequiredProperty.DefaultPropertyValueDescription; newPV.ValueId = RequiredProperty.DefaultValueId; newPV.EntityItemId = Product.Id;)
Description Populates the product's custom properties with the required properties of the product group and its parent groups.
Message
Version 2019.1
Revocable YES

* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.