Thursday, February 24, 2011

Updating DataField Values within a K2 Process Instance without Admin Access

We had an issue while updating the datafield values without executing the action in the application form. If we use ProcessInstance Update method, it was obvious that we need to provide the admin rights for all the users which is not an ideal solution. So we found in the K2 Blackpearl Arcticles that we can update the Data Fields with an Action seperately created for that with in the workflow defintion. The information is described below.

 

Updating Values within a K2 Process Instance

KB Number:KB000307

Introduction

When updating values (i.e. a data field) of a process instance without completing the process in pre-0807 releases of K2 blackpearl it was possible to use the [WorkListItem].[ProcessInstance].Update() method. In K2 blackpearl 0807 the [WorkListItem].[ProcessInstance].Update() method now requires a user with process Admin rights.

The recommended way to update values of a process instance without completing it is to use the Actions["UpdateWorkItem"].Execute() method. The Action must be configured to support the updating of the work item in order to use the Execute method in the API.

Configure the Action in K2 Designer for Visual Studio

The Add Action dialogue screen contains a radio button option that enables the Action to be updated without the Worklist item being completed: Click here  to see the screen shot that shows the configuration for Save with action name UpdateWorkItem.
This radio button must be selected in order to programatically update the value within a process instance.

Update the Work Item Using the K2 API

The recommended method uses an "update" action, as opposed to firing the ProcessInstance.Update() method, so will work without Admin permissions:

SourceCode.Workflow.Client.WorklistItem wi;
wi.ProcessInstance.DataFields["TestDF"].Value = "2";
wi.Actions["UpdateWorkItem"].Execute();

Remember that the Action must be configured using the This action will update the work item option during the design of the process, as demonstrated in the K2 Designer for Visual Studio section above.

The following sample will now only work if it is called by a user with Admin permissions on the process:

SourceCode.Workflow.Client.WorklistItem wi;
wi.ProcessInstance.DataFields["TestDF"].Value = "2";
wi.ProcessInstance.Update();

 

 

 

Sunday, February 20, 2011

Add Additional Input controls to Telerik File Upload Control

We had a requirement to include additional input controls in Telerik fileupload control template. We spent more time looking into the HTML source of Telerik control on browser once it is renedered to find a way to add these controls with Javascript, but we could not find any solution for that. Later we realized that the Telerik controls provide the client script functions for its' controls, so for upload control also we found few events like OnClientAdded tha helped us to add additional inout controls like dropdown lists and lables etc. like shown in below.

Telerik FileUpload control with additional input control in it.

Below is the screen shot of Telrik file Upload control with extra input controls shown in a single line.

The code for this post is available here. Download

How to insert images into Gmail emails


I saw so many of my friends trying to find how to insert images (inline) into Gmail emails composing. So, I thought it would be helpful to post on this on my blog.

Here are the steps those will help you to figure this out.

1. After logging in to your Gmail account you can see a round icon at the top – right of your browser, and click on that, and then you can see the popup that shows Mail settings, click on that.

2. Once you click on the Mail settings it opens a setting page where you can see a lot of tabs, and click on Labs tab as shown below.
In the Labs tab search for a section called Inserting images (or click Cntrl + F and search with ‘Inserting images’), you can see a section like below, and now select Enable button, and finally click on Save Changes button to save your settings.

3. Once the changes to your settings are saved, go back to Composing email section and you can see an insert image button showing up as shown below ( make sure that the Rich formatting is enabled in your composing textbox).

Hope it helps!

Friday, January 7, 2011

Object Reference Exception in SharePoint Installer

We got the same error, I got the follwing solution from a blog and this solved our problem:

After checking the SolutionID GUID in the Setup.exe.config file with the SolutionId GUID in my project manifest.xml file, I realized that they were different. I created a new GUID  (just for peace of mind) and updated both SolutionIds. Before I could run setup again, I had to delete the wsp from the Sharepoint solution store. I ran this bat file to do so
(taken from Ted Pattison's WSS401 lab)

@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe"

%STSADM% -o retractsolution -name YourSilverlightApplication.wsp -immediate

%STSADM% -o execadmsvcjobs

%STSADM% -o deletesolution -name YourSilverlightApplication1.wsp

Feature Scope Error:

http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/dd328fce-6d16-434f-b4bf-a53deac8eaad/

Info:
http://arcadiaunlimited.com/blog/tag/sharepoint-solution-installer/

STSADM:
http://www.codebanking.com/articles/sharepoint/sharepoint-stsadm-command-for-deployment.asp

File not found error when you select New Webpart after installing SmartPart 1.3

We got this "File not found error....". The solution I found from one of a post somewhere, I have added the solution here:


Actual Error:
File Not Found. at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandle fieldHandle, RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Signature..ctor(RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Reflection.RuntimeMethodInfo.get_Signature()
at System.Reflection.RuntimeMethodInfo.GetParameters()
at Microsoft.SharePoint.WebPartPages.SPWebPartSerializer.GetPersonalizableProperties()
at Microsoft.SharePoint.WebPartPages.SPWebPartManager.GetEffectiveWebPartType(Type webPartType, SerializationTarget serializationTarget, Boolean ignoreSupportsAttributeMarkup)
at Microsoft.SharePoint.WebPartPages.SPWebPartManager.GetEffectiveWebPartType(Type aspWebPartType, SerializationTarget serializationTarget)
at Microsoft.SharePoint.ApplicationPages.NewDwp.Page_PreRender(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnPreRender(EventArgs e)
at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Solution from the below post:
http://www.codeplex.com/smartpart/WorkItem/View.aspx?WorkItemId=2708


SmartPart is binding to the older version of the System.Web.Extensions. If I had installed an earlier version of the framework and the separate AJAX extension 1.0, it may have worked.


The article does suggest a workaround.
1. Go the the web.config of your WSS.
2. Locate the section , and within that . There should be a list of entries.
3. Add the following entry
 3. Add the following entry as shown below




What the entry does is redirect binding to the old version of System.Web.Extensions to the new version. The 3.5.0.0 version should have been installed to the GAC when you install Framework 3.5 SP1.
After this change, you will be able to create a new web part in the web part gallery again.

Access to XMLHttpRequest at 'from origin has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. .net core angular

Issue: The angular application was getting error from API that the origin has been blocked by CORS policy. Solution: Make sure that the...