Forum Discussion
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.
- Former_Member7 years agoIdeator I
Hello Angelalp,
I see, thanks a lot for your suggestion! I will try to "promote" an item without creating a new version/revision (hopefully the version = "0" attribute can be used here similar to how you can update a versionable item) and add the comments that way. I am interested in those comments just for tracking purposes, so this may work. Once I test it I will let you know.
Kind regards,
Pmateo
- Former_Member7 years agoIdeator I
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
- AngelaIp7 years agoIdeator I
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)
[deleted by author]
I will give it a try next time I do a add/edit action via batch loader.
- Former_Member7 years agoIdeator I
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.