I'm thinking of using convention and programming to automatically set r_alias_set_id value in a TBO in doSave prior to saving. The hope is to avoid any confusion in regards to alias set resolution. In this case one of the parent folders will have the same name as the alias set so all I have to do is check to see if there is an alias set with the same name as one of the parent folders and if so set the r_alias_set_id to the id of that alias set. Will this work? Just wanted to be sure before I spent the time coding and deploying it.
Something like:
// set r_alias_set_id based on parent folder nameif(null == this.getAliasSetId()){ int iFolderCount = this.getFolderIdCount(); for(int x=0; x<iFolderCount; x++){ IDfId folderId = this.getFolderId(x); IDfFolder folder = (IDfFolder) this.getSession().getObject(folderId); IDfAliasSet aliasSet = (IDfAliasSet) this.getSession().getObjectByQualification("dm_alias_set where object_name = '" + folder.getObjectName() + "'"); if(null != aliasSet){ this.setId("r_alias_set_id", aliasSet.getObjectId()); break; } }}
This is just a first stab at the code so my feelings won't be hurt if you have ideas for improvements
Message was edited by: fainemr - added code