Forum Discussion

angela's avatar
angela
Catalyst II
8 years ago

Update the minor_rev property with client Method fails

Hi, We use a revision scheme based on Major Revision (B) and Minor Revision (01, 02, 03). I want to update the minor_rev property of ItemType Part with the following a JavaScript Method triggered from a Form button:
var updateItm = inn.getItemById("Part", "-------------id-------------");
updateItm.setAction("edit");
updateItm.setAttribute("doGetItem", "0");
updateItm.setProperty("major_rev", "B"); // <-works!
updateItm.setProperty("minor_rev", "02"); // <-don´t work!
updateItm = updateItm.apply();
The minor_rev property is a standard string and there should be nothing special with that property. I have all necessary permissions to perform this action. The corresponding Part is in state Preliminary and I am the Owner. The Method works fine for changing the major_rev, keyed_name, etc. . But even though I can easily override all kind of properties in my Part, the minor_rev property steadfastly refuses to change. It stays the same value as before. If nothing works, I will use a Server Method for this change. But I right have no single idea, why this Method don´t work. What could be wrong here? Is there anything special with the minor_rev property? For me it looks like all other properties. Thanks again! Angela

4 Replies

  • I wouldn't use SQL for any system properties. Some can have side effects, which you skip by running SQL instead of AML. For instance, all File Properties have side effects (the file container is updated). It's usually safe for string properties.
  • I think I found an explanation for this behaviour. It seems that minor_rev is a system property like "created_on". Didn't expect that. 1. Using Server Method to set minor_rev property -> fail 2. Grant special permission to set minor_rev property -> fail Using applySQL finally broke the minor_rev resistance.
  • Can you use updateItm.setAction("version") or updateItm.setAttribute("version","0") If updateItm is not released and the item is versionable, then this should update the minor version on the item.  You can set versioning to Manual if you wish to control when the version is incremented. Many thanks, Martin
  • Thank you Martin and Stefan for your input! I tried to use the version attribute in combinaton with my AML query, but still wasn´t able to change the minor_rev without addtional SQL. I normally try to avoid using direct SQL or SQL procedures. But in my case, nothing else worked so far. A little bit suspicious: Even Aras uses SQL to change the Minor revision: github.com/.../MinorRev Handling.xml The example recommends to check the minor_rev ReadOnly checkbox in the Property settings. But I didn´t check this one. So my minor_rev should be fully editable. Can one of you confirm, that you are able to overwrite your minor_rev property with AML?