Is there a way to use DFC to link an object to a folder without having to do a save? Ideally we'd like to avoid getting the r_modify_date updated and bypass the TBO.
Updating the object through SQL is possible although I'm not sure if it's only 1 field that needs to be updated.
You can look at the database, then update a document through DFC (link it) and see what has changed in the database.
If it turns out it's only 1 field, there should be no problem.
Just create the SQL statement and execute it through DFC by calling IDfSession.apiExec("execsql", "UPDATE dm_sysobject_s ...");
If it's too much trouble to do it like that, you can also manually reset the modify date after you have linked it, also through SQL (this is only 1 value in the database):
IDfDocument dfDocument = dfSession.getObject(...);Date modifyDate = dfDocument.getModifyDate().getDate();String modifyDateStr = new SimpleDateFormat("MM-dd-yyyy").format(modifyDate);String objId = dfDocument.getObjectId().getId();String sqlQuery = "update dm_sysobject_s set r_modify_date" + "=to_timestamp('" + modifyDateStr + "','MM-DD-YYYY HH24:mi:ss') " + "where r_object_id = '" + objId +"'";dfSession.apiExec("execsql", sqlQuery);
Notes:
Thanks for the suggestions. I was aware of the apiExec, but that's been depricated so I was trying to avoid that.
I ran a couple of tests, and it turns out that even though you have to execute the save method after doing a link, it doesn't update the r_modify_date, so it appears my concern was for nothing. Thanks for the help though!
Are you a 100% sure about that?
I was under the impression that r_modify_date changes everytime save is called.
I was under the same impression, but I put together a quick test and have linked and unlinked a couple of documents multiple times and the r_modify_date has not changed.
You did call save() after the linking, right?
Yep. According to the documentation, you must execute a save after doing a link or unlink (although it would be nice if that was not a requirement).