Happy Programmers Day #Microsoft Developer
Friday, September 13, 2013
Posted by Usama Wahab Khan at 5:01 PM 1 comments
Labels: Microsft
Join US SharePoint 2013 Workflow for Developer (Dev Saturday UAE)
Wednesday, September 4, 2013
Posted by Usama Wahab Khan at 10:49 AM 0 comments
SharePoint 2013 Developer Meetup
Thanks to all MVPs, MCTs, Community Members ,for Participating in SharePoint Dev meetup.
Posted by Usama Wahab Khan at 10:20 AM 0 comments
Labels: Dev Saturday UAE, SharePoint 2013, Usama wahab khana
SharePoint 2013 App authorization policy (RunWithElevatedPrivileges for App )
Friday, August 23, 2013
On Code
Posted by Usama Wahab Khan at 11:01 PM 0 comments
Labels: Oauth, SharePoint 2013, SharePoint Apps
CSOM SharePoint app 2013 External Services by Using WebProxy
Monday, July 29, 2013
You can also use Office 365 SharePoint Online.
Add your Test or developer Site URL
Open App.Js File from solution Explorer. Cope the Following from Sample code and Paste into App.js
Open your default.aspx file in App and SP.runtime.js and Also Executed SharePOint Ready method
Define html Container with ID in my case i used message in js code so i defined tab with id
and Hit F5
Download code Link :http://code.msdn.microsoft.com/SharePoint-Call-External-83b49a85
Related Content
- SP.WebProxy object
- Work with data in SharePoint 2013
- Apps for SharePoint overview
- Hosting options for apps for SharePoint
- Build apps for SharePoint
- How to: Create a basic SharePoint-hosted app (A Must)
By usama wahab khan
Posted by Usama Wahab Khan at 6:53 AM 0 comments
Labels: SharePoint 2013, SharePoint Apps, SharePoint Development
Received Microsoft Certified Trainer WelCome kit
Friday, July 26, 2013
Posted by Usama Wahab Khan at 3:02 AM 0 comments
Labels: MCT, Usama wahab khana
Start workflow SharePoint 2013 programmatically
Friday, July 5, 2013
Javascript :)
// ---------- Start workflow ---------- function StartWorkflow() { var errorMessage = "An error occured when starting the workflow."; var subscriptionId = "", itemId = "", redirectUrl = ""; var urlParams = GetUrlParams(); if (urlParams) { //itemGuid = urlParams["ItemGuid"]; itemId = urlParams["ID"]; redirectUrl = urlParams["Source"]; subscriptionId = urlParams["TemplateID"]; } if (subscriptionId == null || subscriptionId == "") { // Cannot load the workflow subscription without a subscriptionId, so workflow cannot be started. alert(errorMessage + " Could not find the workflow subscription id."); RedirFromInitForm(redirectUrl); } else { // Set workflow in-arguments/initiation parameters var wfParams = new Object(); // get reviewer loginname var html = $("#ctl00_PlaceHolderMain_docReviewerUser_upLevelDiv"); wfParams['DocReviewerLoginName'] = $("#divEntityData", html).attr("key"); // get editor loginname var html = $("#ctl00_PlaceHolderMain_docEditorUser_upLevelDiv"); wfParams['DocEditorLoginName'] = $("#divEntityData", html).attr("key"); // Get workflow subscription and then start the workflow var context = SP.ClientContext.get_current(); var wfManager = SP.WorkflowServices.WorkflowServicesManager.newObject(context, context.get_web()); var wfDeployService = wfManager.getWorkflowDeploymentService(); var subscriptionService = wfManager.getWorkflowSubscriptionService(); context.load(subscriptionService); context.executeQueryAsync( function (sender, args) { // Success var subscription = null; // Load the workflow subscription if (subscriptionId) subscription = subscriptionService.getSubscription(subscriptionId); if (subscription) { if (itemId != null && itemId != "") { // Start list workflow wfManager.getWorkflowInstanceService().startWorkflowOnListItem(subscription, itemId, wfParams); } else { // Start site workflow wfManager.getWorkflowInstanceService().startWorkflow(subscription, wfParams); } context.executeQueryAsync( function (sender, args) { // Success RedirFromInitForm(redirectUrl); }, function (sender, args) { // Error alert(errorMessage + " " + args.get_message()); RedirFromInitForm(redirectUrl); } ) } else { // Failed to load the workflow subscription, so workflow cannot be started. alert(errorMessage + " Could not load the workflow subscription."); RedirFromInitForm(redirectUrl); } }, function (sender, args) { // Error alert(errorMessage + " " + args.get_message()); RedirFromInitForm(redirectUrl); } ) } } // ---------- Redirect from page ---------- function RedirFromInitForm(redirectUrl) { window.location = redirectUrl; } // ---------- Returns an associative array (object) of URL params ---------- function GetUrlParams() { var urlParams = null; if (urlParams == null) { urlParams = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) { urlParams[key] = decodeURIComponent(value); }); } return urlParams; }
C#
var WSM = new WorkflowServicesManager(web); var wfSubscriptionService = WSM .GetWorkflowSubscriptionService(); //get all workflows associated with the list var subscriptions = wfSubscriptionService .EnumerateSubscriptionsByList(listId); //run all workflows associated with the list foreach (var workflowSubscription in subscriptions) { //initiation parameters var inputParameters = new DictionaryReference :(); inputParameters.Add("WFProperty", "Value"); WSM .GetWorkflowInstanceService().StartWorkflowOnListItem(workflowSubscription, itemId, inputParameters); }
http://code.msdn.microsoft.com/office/SharePoint-2013-Approval-f5ac5eb2
Posted by Usama Wahab Khan at 5:15 AM 1 comments
Labels: SharePoint 2013, sharepoint workflow, Workflow




















