Recently while working on an implementation, there came some requirements so here we go
- We had to implement parallel workflow approval process within project server workflow,
and as project server uses a sequential hence it was a problem - Had to capture adhoc data for project server for reporting purpose and for everything you can’t use custom fields
Now there are multiple solutions to it use an infopath / sharepoint list etc… which all have their own pros & cons
however i took an alternative approach of using javascript to laod a modal dialog box for user interaction to get the required data filled in and come back to the same PDP page, one thing i found most usefule with this was you can customize as mucha s you want, also you can really control the navigation, let user be on the same page unless information is filled in and at last you can execute server side code without having to post back , so what i did
1. Create a Site Page
2. Customize the Ribbon and add your own buttons to it , However i disabled the default Page Tab and created a new tab with my own custom buttons
3. Create custom web part where user will fill in data
4. Put your custom logic on web part
5. Call Site page in Modal dialog box
So Step 1 through 4 are pretty easy and is specific to environment so as you wish you can do it however i have tagged couple of links for ease
So the Final Step 5, how to call that modal dialog box,
1. Edit the PDP page where you want to place the Link / Button / any other control, i am using hyperlink for easy reference
2. Insert a Content Editor Web Part
3. Edit the HTML Source of Content Editor Web Part
4. Paste the Code given below in CEW
<script type="text/// <![CDATA[
javascript” language=”// <![CDATA[
javascript" type="text/javascript" style="text-decoration: underline">
// ]]>
function CallModalDialogPopup {
var name = "projuid";
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp(regexS);
var url = window.location.href;
var lowercaseurl = url.toLowerCase();
var results = regex.exec(lowercaseurl);
if( results == null ) return "";
else {
targeturl = "/PWA/ProjectWorkflowPages/ConfigDocs/Survey.aspx?Projuid=";
targeturl += decodeURIComponent(results[1].replace(/\+/g, " "));
var options = SP.UI.$create_DialogOptions();
options.url = targeturl;
//alert(options.url);
options.title = "ModalDialogPopUp";
options.width = 1000;
options.height = 850;
SP.UI.ModalDialog.showModalDialog(options);
}
}
</script>
Click here to submit <a onclick="javascript:CallModalDialogPopup” href=”#” style=”text-decoration: underline”>Calling Modal Dialog
Note : Make Sure Your Path to site page is configured properly in java script
5. Viola Youa re done your modal dialog box is up
// ]]>