Hi.
I need to update multiple contract statuses depending on another contract’s status.
The solution im trying to use is having a table I created named c_contract_link where I list contracts that should be cancelled when the primary contract gets cancelled.
Now im trying to mass update on the contract table using the values from the c_contract_link table.
<perform_batch>
<sequential_dependent>
<mass_update_contract result_name="link_select">
<hierarchy_select>
<primary_table>c_contract_link</primary_table>
<attrs>
<attr>c_contract_link.linked_contract_id</attr>
</attrs>
<from>
<table>contract</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>c_contract_link.contract_id</left_operand>
<operator>eq</operator>
<right_operand>@contract_id</right_operand>
</constraint>
<constraint>
<left_operand>c_contract_link.cancel_with_primary</left_operand>
<operator>eq</operator>
<right_operand>Y</right_operand>
</constraint>
</data_constraint>
<join_constraint>
<constraint>
<left_operand>contract.contract_id</left_operand>
<operator>equi</operator>
<right_operand>c_contract_link.contract_id</right_operand>
</constraint>
</join_constraint>
</where>
</hierarchy_select>
<contract>
<contract_id xpath_node="//c_contract_link_hierarchy_select_result;@result_name='link_select']/c_contract_link/linked_contract_id" />
<contract_version>1</contract_version>
<contract_status>CANCEL</contract_status>
<user_def5>@user_def5</user_def5>
<cancelled_dt>@cancelled_dt</cancelled_dt>
<update is_initialized="True"/>
</contract>
<transaction_size>100</transaction_size>
<synchronous>Y</synchronous>
</mass_update_contract>
</sequential_dependent>
</perform_batch>
This gives me an error:
<perform_batch_result>
<mass_update_contract_result result_name="link_select">
<result type="Exception">
<error>
<application_error>
<severity>ERROR</severity>
<message>The rows returned from the query are for the c_contract_link table but the mass update message is for the contract table. Mass update cannot be performed.</message>
</application_error>
</error>
</result>
</mass_update_contract_result>
</perform_batch_result>
Is it possible to use the results from one table to mass update another table?