Skip to main content
Question

Mass Update of coverage_start_dt and end_dt of product_pm

  • January 17, 2025
  • 6 replies
  • 44 views

Forum|alt.badge.img+2

Hi,

I have a many places with multiple products linked to each (with a product_id and modeli_id), each product_id has a fixed Product_PM coverage end date (for example 31.12.2024). This end date prevents users from creating new tasks or inspections because it it is expired or if it is earlier than the current date.

Manually modifying the coverage end date automatically triggers slots and updates to the PM schedules which is fine. With Sql update query it changes the coverage end date but not triggering new slots in PM schedule.

Problem: I need to update the coverage end date for 1,000 of product_id’s for 1000 places.
any possible solution would be helpful.

Thanks and Regards,
Akshay.

 

6 replies

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • 1135 replies
  • January 19, 2025

@RTTPAAKDE 

You can use “mass_update” XML

Below is a generic structure. You can search the community for more examples

<mass_update_product>
  <hierarchy_select>
    <primary_table>product</primary_table>
    <attrs>
      <attr>product.product_id</attr>
    </attrs>
    <from>
      <table>product</table>
    </from>
    <where>
      <data_constraint>
        <constraint>
          <left_operand>product.product_type</left_operand>
          <operator>eq</operator>
          <right_operand>MY_TYPE</right_operand>
        </constraint>
      </data_constraint>
    </where>
  </hierarchy_select>
  <product>
    <MY_DATE>SOME_VLAUE</MY_DATE>
    <update />
  </product>
  <transaction_size>100</transaction_size>
  <synchronous>Y</synchronous>
</mass_update_product>

 

Cheers!


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Customer)
  • 8 replies
  • January 21, 2025

Hi,

Thank you for suggestion!

Regards,
Akshay.


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Customer)
  • 8 replies
  • February 6, 2025

Hi ​@Shneor Cheshin ,

If I want to do mass insert for example creation of new product additional to existing product with new coverage_start_dt and coverage_end_dt. How i need to do it?
I tried like changing XML to insertbutdid not work.
Do you have any suggestions? Thanks for help!

Regards,
Akshay

<mass_update_product>

<hierarchy_select>

<primary_table>product</primary_table>

<attrs>

<attr>product.product_id</attr>

</attrs>

<from>

<table>product</table>

</from>

<where>

<data_constraint>

<constraint>

<left_operand>product.product_type</left_operand>

<operator>eq</operator>

<right_operand>MY_TYPE</right_operand>

</constraint> </data_constraint>

</where>

</hierarchy_select>

<product>

<MY_DATE>SOME_VLAUE</MY_DATE>

<insert/>

</product>

<transaction_size>100</transaction_size>

<synchronous>Y</synchronous>

</mass_update_product>


Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • 1135 replies
  • February 7, 2025

Hi ​@RTTPAAKDE 

Mass Insert is NOT supported by baseline product.

Cheers!


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Customer)
  • 8 replies
  • February 7, 2025

Hi ​@Shneor Cheshin ,

Thanks!


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Customer)
  • 8 replies
  • April 2, 2025

Hi ​@Shneor Cheshin ,

If i want to update multiple products id’s, which operator i use in constraint in where clause

the below is example what i tried:

<where>
      <data_constraint>
        <constraint>
          <left_operand>product_pm.product_id</left_operand>
          <operator>eq</operator>
          <right_operand>12345</right_operand>
        </constraint>
        <constraint>
          <left_operand>product_pm.product_id</left_operand>
          <operator>eq</operator>
          <right_operand>67890</right_operand>
        </constraint>
      </data_constraint>
    </where>

but not working i get response as:

  <response>

Mass update complete.

For update, 0 records were successfully updated and 0 were skipped because of errors.</response>

It would be great if you help me!

Thanks,
Akshay.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings