Aaron A


I was working on automating a submission to the records center through my workflow and was referencing the rrSubmit project in the ECM SDK, but I swear I thought I saw something a lot simpler than this mess of code they have in that project.

I delved a little deeper and saw there is an SPFile.SendToOfficialFile method, but when I tried to find any code for it, I couldn't. Plus when I tried to add the line of code for it, and i assumed it was something along the line of...

string result = SPFile.SendToOfficialFile(filepath);

something along that line anyway, but there is no intellisense for the SendToOfficialFile method. So I assumed I was missing some sort of reference to call the method, but I am at a loss as to what reference I need to add.

I have the Web reference to the Official File web service, but that doesn't include the SendToOfficialFile method, since that part of the SPFile class, not the web service.

So needless to say I am utterly confused. But I do have the records center correctly configured, because I can manually send one of my items to the records center, and it routes properly.

Thanks,

Aaron



Re: SubmitToOfficialFile

Aaron A


Haha, ok, so apparently I wasn't looking close enough. But I may still need some clarification.

Should I be able to just open the workflow item as SPFile class say something like:

SPFile doc = new SPFile(workflowProperties.item);

then call the method:

result = doc.SendToOfficialFile();

Does there need to be any additional information within the (), I know it says routing and or additional information under the method properties, but i don't know if its necessary or not

Is it as simple as that





Re: SubmitToOfficialFile

Aaron A

Apparently its an overloaded method and requires information within the parenthesis. I'm not sure what needs to be in the string file though....




Re: SubmitToOfficialFile

A4orce84

Aaron A, do you have AOL or MSN Messenger I am attempting to do something simliar, and was wondering if you could provide any assistance Thanks.

--A4orce84





Re: SubmitToOfficialFile

Aaron A

Ah well, I figured it out btw....

you can call the SendToOfficialFile method by doing this

string result;

string properties;

result = workflowproperties.item.file.SendToOfficialFile(out properties);

assuming you have the official file setup correctly.

and yes, it is that simple...it does exactly as choosing the send to --> official file from the menu context on the item.





Re: SubmitToOfficialFile

A4orce84

Thanks Aaron A. That was very helpful. =)

I was going to ask an additional question concerning file structure within SharePoint. I was going to see

if you or anyone knew how to create a directory structure in Record Center with custom workflows. I have a top level site, let's call it Test. Then Sub sites, test1, test2, test3, etc......I have a custom workflow right now that when you kick it off, writes to the Record Center.

What I want to do is that if you are in Test2, and you submit to the record center....it will create a folder called test2 and then upload the file to that directory under the Record Center automatically. Does anyone have any ideas on how to achieve this Thanks.

--A4orce84





Re: SubmitToOfficialFile

Aaron A

I don't know how to do that...my goal is to learn just like you though, because the default submission will not do Smile

I have heard that there is a way to program the records center routing to do that, but the sub-folder structure is set and unchangeable (i believe, but don't hold me to that).





Re: SubmitToOfficialFile

rajfouru

Can you share with me wh u done so far..some code

i am creating workflow in final step of workflwo it is calling SendToOfficialFile method, them document moving to record center

how to use this method..