Wednesday, March 25, 2015

K2 Destination Configurations for Work list Items to be available for all destination users even if any destination user already opened the item

Scenario: I want to have a work list item to be visible for all Users in an AD group, even if one of the user already opened the work list item. Also, I need to advance to the next step in workflow when one of the user in Group takes action.
I don’t want the worklist item to be disappeared from the User’s Worklist as soon as one user opens it. All users should be able to see the worklist item until one of the user takes action.
Resolution:
Go to Destination Rule Options of the Activity.
Select Plan per Destination – All at once
Create a slot for each destination.
Resolve all roles and groups to users since I want any user in the role or group can action the item.







In the Destination Sets, Add the user/roles/groups who can action the item.
You can also add multiple users, Roles in the Destination Sets.
Click Next and Finish.








Go to Outcome succeeding rule wizard








Open each configured outcome -
You will see that
All slots of Action Result =







Change it to
Atleast 1 of ActionResult =


Do the same for all other Outcomes.







Saturday, March 21, 2015

Assigning K2 worklist Item to Dynamic Multiple Destination Users - Configuration

Adding Multiple Users for Destination in K2 workflow:


Scenario: Sometimes we may need to assign a work list to a list of multiple users (approvers).  We can achieve this functionality as follows:
  1. Create a Process Field “UsersList” with “;” separated list of userids(along with domain)
EX: denallix\bob;denallix\riverarod;denallix\jarmanj2




Note: make sure there is no semi-colon at the end of the string.


  1. Update the Destination Users as follows.
Make sure you selected Advanced Settings.




i.e. Configure Function as follows:




To Send email to the Users, Configure as follows
For Email Activity Do as Follows:







Open the email Event. And Set “Destination user” as recipient.




Right Click on K2 Designer for Visual Studio 2010 not working

Right click on the kprx file of Visual Studio 2010 Designer for K2 stopped working. Not able to go to Line properties in the workflow.

Solution:


Go to Start => All Programs => Microsoft Visual Studio 2010 =>Visual Studio Tools => 
Right click on “Visual Studio Command Prompt (2010)” and Run as administrator.
Type “devenv /setup”  and hit enter.

cid:image001.png@01CEC98A.838E3D50
If still not working, try below solution:

1.     Ensure Visual Studio 2010 is not running. Check for and shut-down the devenv.exe process if necessary.
2.     Using Windows Explorer, browse to the folder with the originally extracted installation file e.g.:
[your extraction folder]\Setup\Installation
3.     Right-click on the K2 for Visual Studio 2010.msi file and select Repair
http://help.k2.com/helppages/k2blackpearlUserGuide4.6.4/images/TS_VS2010_K2Context%20menu-right-click.png

The K2 Designer extension will be repaired in a few seconds and the mouse right-click context menu and K2 toolbar will be available in Visual Studio 2010 once more.


Wednesday, February 13, 2013

All about SandBox Solutions

SandBox Solutions:
  • Scope of the solution is Site Collection and not entire farm.
  • Deployed and managed by Site Collection Administrators.
  • Sandbox solutions are hosted on SharePoint User Code Server Worker Process(SPUCWorkerProcess.exe) where as Farm solutions are hosted on IISWorkerProcess(w3wp.exe)
  • Sandbox solutions are uploaded to Solution Gallery(_Catalogs/Solutions).
  • No need of IIS reset or IIS App Pool recyclying.
  • Used for Web Parts, Event Receivers, Feature Receivers, Custom SharePoint Designer Workflow Activities.
  • Sandbox solutions are stored in Content Database not in GAC.
  • When a site is restored, it gets Sandbox Solutions also, if any.
  • Assemblies in a sandbox solution are included in Solution package(.wsp) and package is deployed to Site Collection 's Solution Gallery.
  • When Sandbox solution is accessed(i.e when user navigates to a page that contains web part from Sandbox solution), any assemblies in the solution are extracted from Package in the gallery and copied to the file system(C:\ProgramFiles\Microsoft\SharePoint\UCCache) of the server that is handling the sandbox request.
  • For Sandbox solutions coding, referrence the Microsoft.Sharepoint.dll from  the path, ...\14\UserCode\Assemblies. For Form solutions this dll can be  referrenced from ...\14\ISAPI folder.
  • To access resources outside a site collection from within Sandbox solution, you must implement and call a Full Trust Sandbox Proxy.
Disadvantages:
  • Can't access outside Sandbox(Ex: Database, Registry, Environment Variables)
  • Can only access same domain, other domains can't be accessed.
  • Can't be used for application pages, visual web parts, code-based workflows, unmanaged code, web service calls, SPUtility.Sendmail, RunWithElevatedPrevilages, Writing to Disk, Accessing objects in other site collection.
  • Sandbox solutions by default have code limits to 300 points.
  • Microsoft.Sharepoint.WebPartPages not allowed
Powershell Commands:

  • To upload Sandbox solution to Site Collection's Solution gallery, 
          ADD -SPUserSolution -LiteralPath .wsp 
                                               -Site

  • To Deploy(Activate) SandBox Solution,
          Install -SPUserSolution -Identity .wsp
                                                 -Site 
  • To Update  SandBox Solution,
          Update -SPUserSolution -Identity .wsp                                                  -Site 
                                                  -ToSolution .wsp
                                             


Thursday, February 03, 2011

SPQuery related

An interesting thing to note about SPList.GetItems and SPQuery is that by default, SPList.GetItems will return you results in only one folder of a given list. If indeed you wanted to recurse the folders in a given list and identify all items matching the given criterion, you need to add the following line to your code:

query.ViewAttributes = "Scope=\"Recursive\"";

Monday, May 31, 2010

Customizing Sharepoint List's NewForm.aspx "OK" button click

Requirement: In a share point list, while adding a new item, a field value has to be validated depending on other field value in the list.

Solution:

A) Create a new aspx page for customizing newform.aspx.
  1. Open Share point Designer and Open the site.
  2. Go to the Share point list which you want to customize.(Lists => )
  3. Select "NewForm.aspx" file and copy it.
  4. Paste it under the same location where "NewForm.aspx" file exists and rename it to "Customized_NewForm.aspx".
B) Customizing newform.aspx.
  1. Open the "Customized_NewForm.aspx" file in designer in design mode.
  2. Select the "ListFormWebPart" and delete it.
  3. From Insert menu, click on "Sharepoint Controls" and then click on "Custom List Form".
  4. It will prompt you to select the List and content type. Select your list and Content type(Item). Also select "New Item Form" radio button for "Type of the form to create". Click on "OK" button.
  5. It will insert your default new item page. You can do your customizations on this page such as removing some fields, hiding some fields, renaming the field text displayed etc.
C) Adding JavaScript code for customizing "OK" button click event.
  1. Open the "Customized_NewForm.aspx" file in designer in Code/Split mode.
  2. Go to the Content Place holder, "PlaceHolderMain" and insert the following lines of Javascript code and save the file.
script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("StartUpCustomScript");
function StartUpCustomScript() {
ChangeOkButtonOnclickEvent("Input","SaveItem");
}
function ChangeOkButtonOnclickEvent(tagName, identifier) {
var len = identifier.length;
var tags = document.getElementsByTagName(tagName); /*find all Input type controls on page (ie. control with tag )*/
for (var i=0; i < tempstring =" tags[i].name;" func =" tags[i].attributes[" onclick =" null;" approvaltype =" document.getElementById(" selectedapptype =" ApprovalType.options[ApprovalType.selectedIndex].value;" smapprovers =" document.getElementById(" selectedapptype ="="" value ="="">

C) Setting Customized New Form as default new item page
  1. Open the list where "Customized_NewForm.aspx" file exists in Sharepoint designer and open the properties.(Right click the file and click on "Properties...").
  2. From "List Properties" window, select "Supporting Files" Tab.
  3. Select "Item" for "content type specific forms".
  4. For "New item form", click on Browse and select the customized file i.e. "Customized_NewForm.aspx" and click on "Ok".
  5. Now try to open the new form from list. Notice the url change to "Customized_NewForm.aspx" instead of "NewForm.aspx".
  6. Click on "Ok" and save the settings.

Wednesday, May 26, 2010

Unrecognized configuration section 'connectionStrings'

When I try to create a virtual directory for web service in IIS and try to browse the .asmx file, igot the following error
"Unrecognized configuration section 'connectionStrings'".
This is happening because by default the ASP.Net version selected is "1.1.4322" where as the code i have written is .Net version 2.0.
So, the solution is change the Asp.net version.
Go to the virtual directory, Properties. From ASP.NET tab, select "2.0.50727" for ASP.Net Version and click ok. Now it should work properly.