Hi,
I have a requirement to exclude the PART_USAGE.PART_LINE_CODE = ‘C_PDO’ from the list.
After initialization the result is correct.
But once I add a part usage which has part_line_code = ‘C_PDO’ inserted the the list will show the increasing number ( including PART_USAGE.PART_LINE_CODE = ‘C_PDO’ in the list)
Example here: after reinitialization, the list = 4.
Add part-usage C_PDO, the list = 5.
Do reinitialization, the list = 4
The PART_USAGE sync rule:
Ownership Query:
<hierarchy_select>
<primary_table>task_assignment_view</primary_table>
<from>
<table>task_assignment_view</table>
</from>
<attrs>
<attr>task_assignment_view.person_id</attr>
</attrs>
<where>
<data_constraint>
<constraint>
<left_operand>task_assignment_view.task_id</left_operand>
<operator>eq</operator>
<right_operand>{task_id}</right_operand>
</constraint>
</data_constraint>
</where>
</hierarchy_select>
Initial Query:
<hierarchy_select return_only_requested_attrs="true" max_rows="50000">
<primary_table>part_usage</primary_table>
<attrs>
<attr>part_usage.*</attr>
<attr>part_usage_lot.*</attr>
</attrs>
<from>
<table>part_usage</table>
<table>part_usage_lot</table>
<table>task</table>
<table>task_assignment_view</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>TASK_ASSIGNMENT_VIEW.PERSON_ID</left_operand>
<operator>eq</operator>
<right_operand>{PERSON_ID}</right_operand>
</constraint>
<and/>
<constraint>
<left_operand>task.status</left_operand>
<operator>eq</operator>
<right_operand>OP</right_operand>
</constraint>
<and/>
<parens>
<constraint>
<left_operand>task.task_status</left_operand>
<operator>eq</operator>
<right_operand>OPEN</right_operand>
</constraint>
<or/>
<constraint>
<left_operand>task.task_status</left_operand>
<operator>eq</operator>
<right_operand>ASSIGNED</right_operand>
</constraint>
<or/>
<constraint>
<left_operand>task.task_status</left_operand>
<operator>eq</operator>
<right_operand>COMMITTED</right_operand>
</constraint>
<or/>
<constraint>
<left_operand>task.task_status</left_operand>
<operator>eq</operator>
<right_operand>ACCEPTED</right_operand>
</constraint>
<or/>
<constraint>
<left_operand>task.task_status</left_operand>
<operator>eq</operator>
<right_operand>ENROUTE</right_operand>
</constraint>
<or/>
<constraint>
<left_operand>task.task_status</left_operand>
<operator>eq</operator>
<right_operand>ARRIVED</right_operand>
</constraint>
<or/>
<constraint>
<left_operand>task.task_status</left_operand>
<operator>eq</operator>
<right_operand>IN PROCESS</right_operand>
</constraint>
<or/>
<constraint>
<left_operand>task.task_status</left_operand>
<operator>eq</operator>
<right_operand>RECEIVED</right_operand>
</constraint>
</parens>
<and/>
<constraint>
<left_operand>part_usage.part_line_code</left_operand>
<operator>ne</operator>
<right_operand>C_PDO</right_operand>
</constraint>
</data_constraint>
<join_constraint>
<constraint>
<left_operand>part_usage.task_id</left_operand>
<operator>eq</operator>
<right_operand>task.task_id</right_operand>
</constraint>
<constraint>
<left_operand>part_usage.pu_id</left_operand>
<operator>left_outer</operator>
<right_operand>part_usage_lot.pu_id</right_operand>
</constraint>
<constraint>
<left_operand>task.task_id</left_operand>
<operator>eq</operator>
<right_operand>task_assignment_view.task_id</right_operand>
</constraint>
</join_constraint>
</where>
</hierarchy_select>
I have tried to set the Related Query same as Initial Query. The list is still having C_PDO part-usage.
Tried setting the Related Query like this:
<hierarchy_select return_only_requested_attrs="true" max_rows='50000'>
<primary_table>PART_USAGE</primary_table>
<from>
<table>PART_USAGE</table>
<table>PART_DISP</table>
<table>PART_USAGE_LOT</table>
</from>
<attrs>
<attr>PART_USAGE.*</attr>
<attr>PART_DISP.*</attr>
<attr>PART_USAGE_LOT.*</attr>
</attrs>
<where>
<data_constraint>
<constraint>
<left_operand>PART_USAGE.PU_ID</left_operand>
<operator>eq</operator>
<right_operand>{PU_ID}</right_operand>
</constraint>
<constraint>
<left_operand>PART_USAGE.part_line_code</left_operand>
<operator>ne</operator>
<right_operand>C_PDO</right_operand>
</constraint>
</data_constraint>
<join_constraint>
<constraint>
<left_operand>PART_USAGE.PU_ID</left_operand>
<operator>left_outer</operator>
<right_operand>PART_DISP.PU_ID</right_operand>
</constraint>
<constraint>
<left_operand>PART_USAGE.PU_ID</left_operand>
<operator>left_outer</operator>
<right_operand>PART_USAGE_LOT.PU_ID</right_operand>
</constraint>
</join_constraint>
</where>
</hierarchy_select>
Or like this:
<hierarchy_select return_only_requested_attrs="true" max_rows='50000'>
<primary_table>PART_USAGE</primary_table>
<from>
<table>PART_USAGE</table>
<table>PART_USAGE_LOT</table>
</from>
<attrs>
<attr>PART_USAGE.*</attr>
<attr>PART_USAGE_LOT.*</attr>
</attrs>
<where>
<data_constraint>
<constraint>
<left_operand>PART_USAGE.TASK_ID</left_operand>
<operator>eq</operator>
<right_operand>{TASK_ID}</right_operand>
</constraint>
<constraint>
<left_operand>PART_USAGE.part_line_code</left_operand>
<operator>ne</operator>
<right_operand>C_PDO</right_operand>
</constraint>
</data_constraint>
<join_constraint>
<constraint>
<left_operand>PART_USAGE.PU_ID</left_operand>
<operator>left_outer</operator>
<right_operand>PART_USAGE_LOT.PU_ID</right_operand>
</constraint>
</join_constraint>
</where>
</hierarchy_select>
they don’t give the expected result.
Do you know how to achieve it?
Thanks in advance.
Cheers,
~Juni