-
1. Re: Parent getting deleted when it's required child is deleted from BCC
Gopinath Ramasamy Jul 15, 2013 5:23 PM (in response to Jagadeesh.P.B)Hi,
Can you please post how you have defined the relationship in your product catalog xml?
Thanks,
Gopinath Ramasamy
-
2. Re: Parent getting deleted when it's required child is deleted from BCC
Jagadeesh.P.B Jul 16, 2013 5:03 AM (in response to Gopinath Ramasamy)Below is a sample xml configuration. In the case below, when delivery type is deleted from BCC, the associated products also get deleted
<item-descriptor name="product">
<table name="dcs_product" type="primary" xml-combine="append">
<property name="description" required="true" />
</table>
<table name="tf_product" id-column-name="product_id" type="auxiliary">
<property name="deliveryType" item-type="deliveryTypes" column-name="delivery_type"
display-name-resource="DeliveryType" category-resource="categoryBasics"
required="true" default="DT02"
hidden="false" writable="true" cache-mode="inherit" queryable="true" >
<attribute name="propertySortPriority" value="5"/>
</property>
<!-- Story TF-384 merchandizing attributes and delivery type end -->
</table>
</item-descriptor>
<item-descriptor name="deliveryTypes" display-property="description" display-name-resource="DeliveryType" >
<attribute name="resourceBundle" value="atg.commerce.CustomCatalogTemplateResources"/>
<attribute name="plural-display-name-resource" value="DeliveryType.plural"/>
<attribute name="create-asset-name-resource" value="DeliveryType.create"/>
<attribute name="new-asset-name-resource" value="DeliveryType.new"/>
<attribute name="plural-asset-name-resource" value="DeliveryType.plural.select"/>
<attribute name="select-asset-name-resource" value="MDeliveryType.select"/>
<table name="tf_delivery_types" id-column-name="id" type="primary">
<property name="id" column-name="id" data-type="string"
hidden="false" writable="true" required="false" cache-mode="inherit" queryable="true"
category-resource="categoryBasics" >
<attribute name="propertySortPriority" value="1"/>
</property>
<property name="description" column-name="description" data-type="string"
hidden="false" writable="true" required="true" cache-mode="inherit" queryable="true"
display-name-resource="DeliveryType" category-resource="categoryBasics" >
<attribute name="unique" value="true"/>
<attribute name="propertySortPriority" value="2"/>
</property>
</table>
</item-descriptor>
-
3. Re: Parent getting deleted when it's required child is deleted from BCC
Nitin Khare Jul 16, 2013 5:38 AM (in response to Jagadeesh.P.B)Your "deliveryType" property is a required property which refers to a deliveryTypes item so when you are deleting the deliveryTypes item the product containing that item is also getting deleted since in this case the foreign key can't be set to null. This is clearly explained here:
You can probably try either making it as non-required or a multi-value property in your repository definition.
-
4. Re: Parent getting deleted when it's required child is deleted from BCC
Jagadeesh.P.B Jul 16, 2013 12:51 PM (in response to Nitin Khare)Yes. I understand the OOTB behaviour. But the business team didn't like the way when delivery type is marked for deletion, BCC was showing all the associated products and on deployment it actually deleted all of them .