This discussion is archived
4 Replies Latest reply: Jul 16, 2013 12:51 PM by Jagadeesh.P.B RSS

Parent getting deleted when it's required child is deleted from BCC

Jagadeesh.P.B Newbie
Currently Being Moderated

I'm extending the product catalog to attach another object, say additional info and this is a mandatory field during product declaration and hence this property is been marked with required=true

But whenever the child item i.e, additional info is deleted through BCC, the products which are associated with this objects are also getting deleted from BCC.

I guess this is how ATG deals with relationships. Business team is asking for any alternate or better approach.

Is there any round about way of having the product deleted and still have this some kind of mandatory check working?

  • 1. Re: Parent getting deleted when it's required child is deleted from BCC
    GopinathRamasamy Journeyer
    Currently Being Moderated

    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 Newbie
    Currently Being Moderated

    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 Expert
    Currently Being Moderated

    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:

     

    http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGRepositoryGuide/html/s1204removingreferencestoitems01.html

     

    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 Newbie
    Currently Being Moderated

    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 .

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points