AnsweredAssumed Answered

Updating records with just one search criteria using ZOG

Question asked by TimGibbons on Apr 2, 2018
Latest reply on Apr 9, 2018 by roland.parrotte

I am trying to update records in PPM using XOG.

 

Every time we try to use XOG it is asking for the name and we need only to use the ProjectID

 

<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_project.xsd">

<Header version="12.0" action="write" objectType="project" externalSource="NIKU" />

<Projects>

<Project projectID="000001" >

<CustomInformation>

<ColumnValue name="named_client_id">1 – bank name 1</ColumnValue>

</CustomInformation>

<General addedBy="admin" addedDate="2018-04-02"/>

<OBSAssocs>

</OBSAssocs>

 </Projects>

 

<Project projectID="000002" >

<CustomInformation>

<ColumnValue name="named_client_id">2 – bank name 2</ColumnValue>

</CustomInformation>

<General addedBy="admin" addedDate="2018-04-02"/>

<OBSAssocs>

</OBSAssocs>

  </Projects>

 

<Project projectID="000003" >

<CustomInformation>

<ColumnValue name="named_client_id">3 – bank name 3</ColumnValue>

</CustomInformation>

<General addedBy="admin" addedDate="2018-04-02"/>

<OBSAssocs>

</OBSAssocs>

  </Projects>

 

</Project>

 

When we run the code above it fails and is saying it needs "name".

 

Error Mesaage

 

<XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
<Object type="project"/>
<Status elapsedTime="0.001 seconds" state="FAILURE"/>
<Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="0" updatedRecords="0"/>
<ErrorInformation>
<Severity>FATAL</Severity>
<Description>
[Error] :1:1: element "Project" is missing "name" attribute
</Description>
<Exception type="java.lang.Exception">Invalid xml data</Exception>
</ErrorInformation>
</XOGOutput>

 

We have 1717 projects we need to update.

 

However, we only need to update the field using the Project id, in SQL would be

 

UPDATE Project

SET named_Client_ID = '0001 – bank name 2'

WHERE ProjectID =PRJ00000101'

 

This should be a very simple task. It is a custom field we created but nothing special.

We would have a section of code for each record.

 

<Project projectID="PRJ00000103" >

<CustomInformation>

<ColumnValue name="named_client_id">0001 – bank name 3</ColumnValue>

</CustomInformation>

<General addedBy="admin" addedDate="2018-04-02"/>

<OBSAssocs>

</OBSAssocs>

  </Projects>

Outcomes