Log changes made by Batchloader on part history

Hi. When I create and then release an ECN, I can see some descriptions and comments if I go to Views/History. However, I would like to find a way to also add some description on the History of the part when I use the batchloader to update any part properties. Is there a way to accomplish this?

Also, I am wondering if there is a way to also add comments when a manual change has been made (let's say, a manual release of a part, or manually promoting a part due to unforeseen circumstances).

Thanks in advance!

PMateo

Parents
  • Hi pmateo,

    I am not sure if I remember things right. But I think for promotion you can add comments via the batch loader. This one is not tested, but maybe works:

    <Item type="Manufacturer Part" action="promoteItem" where="item_number='@1'">
    <state>@2</state>
    <comments>@3</comments>
    </Item>

    You just cannot add history comments when you add or edit new items.

  • I forgot to get back to you; this worked like a charm. The issue of not adding comments when you add or edit is still there, but if the part is not new I am planning to create a new lifecycle state, promoting the part to that state, adding comments in part history, then reverting back to the previous state. Not elegant by any means, but I don't want to edit SQL tables just to add comments. Whenever I have a chance I will look for a better alternative and let you know.

    Thanks,

    Pmateo

  • Hi pmateo,

    maybe we can use a second batchloader query to add history entries after performing add/edit queries.

    The main challenge is that we have to know all required history data when we prepare the batch loader data file. But than something like this may work (not tested)

    <Item type="History Container" action="edit" where="item_config_id='@1''">
    <Relationships>
    <Item type="History" action="add">
    <action>Batch</action>
    <comments>Batch Import 2019-09-30</comments>
    <item_major_rev>...</item_major_rev>
    <item_id>...</item_id>
    <sort_order>0</sort_order> // it´s always 0...
    <created_on_tick>...</created_on_tick>
    </Item>
    </Relationships>
    </Item>

    I will give it a try next time I do a add/edit action via batch loader.

  • Hello,.

    I see, this looks promising indeed, even with the challenge of having to know all required data when creating the data file. I will test this in the next few hours and let you know how it goes. Thank you very much! This looks much more elegant than updating the item to a new "state" and then reverting back the state to the original just to leave comments in history. 

  • Hello! A long overdue update, but this is doing the trick for me. I must know the revision, state and generation in advance so I first have to look at the history table, but so far it's working. I followed  the thread you suggested as well and tried to modify the method  you posted, but I keep getting "not a single item" errors so eventually I  decided to give it another try after I have a few hours to spare.

    Long story short, thanks a lot for your suggestions! Kind regards,

    Pmateo

Reply
  • Hello! A long overdue update, but this is doing the trick for me. I must know the revision, state and generation in advance so I first have to look at the history table, but so far it's working. I followed  the thread you suggested as well and tried to modify the method  you posted, but I keep getting "not a single item" errors so eventually I  decided to give it another try after I have a few hours to spare.

    Long story short, thanks a lot for your suggestions! Kind regards,

    Pmateo

Children
No Data