Clarity

  • 1.  Removal of Custom object Instances

    Posted May 02, 2013 07:51 AM
    Hi,

    Is there any way to remove custom object instances in clarity.

    for example if i create a custom object demo and create a instance demo1 for the custom object demo and if want to remove custom object instance demo1 is there any way we can remove through XOG or we can remove those custom object instances through job but i didn't get any job for these.

    I came through a solution some where in CA Communities where we can delete custom object instances through XOG by adding action="delete" attribute to instance tag but when i am trying XOG the write file it is throwing me an Invalid xml Data.

    PFB custom object instances write file.

    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd">
    <Header action="write" externalSource="NIKU"
    objectType="customObjectInstance" version="13.1.0.0248"/>
    <customObjectInstances objectCode="demo">
    <instance instanceCode="demo1" objectCode="demo" action="delete">
    <CustomInformation>
    <ColumnValue name="code">demo1</ColumnValue>
    <ColumnValue name="name">demo1</ColumnValue>
    <ColumnValue name="odf_period_end"/>
    <ColumnValue name="odf_period_start"/>
    <ColumnValue name="page_layout">odf.demoFrame</ColumnValue>
    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
    </CustomInformation>
    <OBSAssocs complete="false"/>
    <Security>
    <UserSecurity rightCode="odf_cst_demo_edit" userName="admin"/>
    </Security>
    </instance>
    </customObjectInstances>
    <XOGOutput>
    <Object type="customObjectInstance"/>
    <Status state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0"
    totalNumberOfRecords="1" updatedRecords="0"/>
    <Records/>
    </XOGOutput>
    </NikuDataBus>


    and the xog output i am getting is:

    <?xml version="1.0" encoding="UTF-8"?>
    <XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="customObjectInstance"/>
    <Status elapsedTime="0.001 seconds" state="FAILURE"/>
    <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="0" updatedRecords="0"/>
    <ErrorInformation>
    <Severity>FATAL</Severity>
    <Description>[Error] :0:0: unexpected attribute "action"

    Invalid attribute in input document. Please remove all instances of attribute from document elements and try again.

    [Element : instance, Attribute : action ].
    </Description>
    <Exception type="java.lang.Exception">Invalid xml data</Exception>
    </ErrorInformation>
    </XOGOutput>


    Thanks & Regards,
    Sravan Kumar Indupuri


  • 2.  RE: Removal of Custom object Instances

    Posted May 02, 2013 08:06 AM
    I don't know if
    action="delete"
    is documented so the usage in not quite clear.
    Which thread was it, that indicates that it can be used for custom object instances?

    Martti K.


  • 3.  RE: Removal of Custom object Instances

    Posted May 02, 2013 08:09 AM
    Post Ways to delete Custom Sub-object instances from Project in 20324780


  • 4.  RE: Removal of Custom object Instances

    Posted May 02, 2013 08:30 AM
    That is what I suspected. That thread talks about custom subobjects not custom master objects.
    There is a post by Federico Pena (if I recall correctly) tells that action=2delete" works for tasks which are subobject instances.
    Some people have got around the undocumentation by just simply trying every single possible variation that comes into their mind.

    There is not a job either to delete those instances. The only job there is, ie Delete Investments, but that does works only for investments not for any other object.

    Just wondering if you could create a process to delete those instances and the run that with the process job.

    Martti K.


  • 5.  RE: Removal of Custom object Instances

    Posted May 02, 2013 08:36 AM
    Even i am also thinking of the same just to create a process job and trigger a job from that process but there is no job for deletion so we need to write a stored procedure i think so.

    pls suggest me..


  • 6.  RE: Removal of Custom object Instances
    Best Answer

    Posted May 09, 2013 08:10 AM
    Hi Sravan,
    unfortunately the delete=true only works on some stuff, and only some of the time, and does NOT work on custom objects, weather they are a parent or a sub.
    Be very careful with the stored procedure as there is referential integrity to several tables not just the custom object table. Tables to watch out for are Security tables, process tables.
    If you plan on writing delete statements for custom I recommend using SQL Trace to figure out what the app does. Keep in mind Support does not like direct deletes to the DB.
    hope this helps.
    Federico