Answered by:
Possible to automate account creation ??

Question
-
I'm still kind of new to C#/project APIs - and I'm trying to research best practices/best paths forward
What I'd like to do is have a user fill out a form, get approval from a manager and then add that user to the correct department after the approval email is clicked
I have found code that adds a user to project ..awesome
But I'm not sure how to go about the linkage between a workflow and adding a user; does anyone have any resources that could point me in the right direction?
Or if there is a better path forward I'd be glad to hear about that also...
Thank you for your help
Friday, October 16, 2015 11:35 AM
Answers
-
Designer alone will not be able to support everything you want. Although you might find a way of querying project server data via odata API in the designer, what you really need to be able to do is to "create" data. That means you are going to have to use a supported API to write data to Project Server (or Project Online), which is currently CSOM. In infoPath they have the ability to run c# code so you can use CSOM, but I believe with sharepoint designer you cannot. So, I believe you are going to have to start a sharepoint workflow in visual studio so you can drop into c# code for the CSOM calls. Hope that helps.
- Marked as answer by kbwrecker Tuesday, October 20, 2015 10:28 AM
Tuesday, October 20, 2015 12:38 AM
All replies
-
The workflow does not need to be linked to the user necessarily.
You can store the username in the source list that the form depends on and have the workflow pick that username up on approval action and create the user (if not already created) and set the department of the user. There's nothing that I know of that is built for this already.
- Proposed as answer by Carlos A. Gonzalez Monday, October 19, 2015 1:26 PM
Friday, October 16, 2015 3:44 PM -
Is there a guide on how to start this - I'm new to workflows and the code integration. There is little on CSOM that I can find ... I'd be appreciative if there was more information you could point me to.
Is it similar to setting up sharepoint workflows?
Would C# code be a better path or CSOM?Thanks
Sunday, October 18, 2015 4:12 PM -
This is all custom programming, you are not going to find a guide on it. The best thing you can do is look through the documentation, download the SDK and ask specific questions about what you are trying to accomplish.
Here's a link to the documentation and there is a place you can download the SDK too from here:
https://msdn.microsoft.com/en-us/library/office/ms512767.aspx
To answer some of your questions:
What you are describing would be well suited for a sharepoint workflow, not similar, exactly like one, but it would have project server methods you would be calling.
The last question is a bit confusing. CSOM is an API , C# is a language. You use C# to use CSOM.
Monday, October 19, 2015 1:26 PM -
See thats where I'm a little hazy on ... C# vs CSOM and tying them together...
Can this be accomplished in Designer solely or is Visual Studio the only path forward?Thank you very much for the information.. not much out there in concise area/site
Monday, October 19, 2015 1:41 PM -
Designer alone will not be able to support everything you want. Although you might find a way of querying project server data via odata API in the designer, what you really need to be able to do is to "create" data. That means you are going to have to use a supported API to write data to Project Server (or Project Online), which is currently CSOM. In infoPath they have the ability to run c# code so you can use CSOM, but I believe with sharepoint designer you cannot. So, I believe you are going to have to start a sharepoint workflow in visual studio so you can drop into c# code for the CSOM calls. Hope that helps.
- Marked as answer by kbwrecker Tuesday, October 20, 2015 10:28 AM
Tuesday, October 20, 2015 12:38 AM -
thank you for your help.. I'll have to get things going and come back here and get more insight
I really appreciate all the insight
Tuesday, October 20, 2015 10:29 AM