Linking records to containers with value 0


Our organisation has created a "project" record type with  a container value of 0.
They link folders from other sections into this projects container that relate to a common project.

I would like to write some code that will allow them via  a webpage to link folders and files into this project container. Unfortunately the error message I get is

"A record of type 'Project' cannot be used as a container - it has a container level of 0."

Can someone tell me how I might go about fixing this.

My test code so far is below, sorry about the formatting

protected void btnDocumentCreate()
txtSubFolder = "title:Bills test project";
  String txtDocumentNewRec = "ScheduleDocument_" DateTime.Now;
  String IdNumber=""

      //string username = fnUserIdentity();
      using (Database objDB = new Database())

            objDB.Id = DataSetId;
            objDB.WorkgroupServerName = ServerName;
            objDB.TrustedUser = "Bill Sigar";

            TrimMainObjectSearch objSearch = new TrimMainObjectSearch(objDB, BaseObjectTypes.Record);


             foreach (Record thisObjRec in objSearch)

                IdNumber = thisObjRec.Number;

        if (!(String.IsNullOrEmpty(IdNumber)))

            RecordType objRecType = new RecordType(objDB, "Document");
            Record objRec = new Record(objDB, objRecType);
            Record objContainer = new Record(objDB, IdNumber);
            objRec.TypedTitle = txtDocumentNewRec;

            objRec.SetContainer(objContainer, true);




catch (Exception ex)
   txtError.Text = ex.Message;

Parents Reply Children
No Data