I have encountered a situation of saving the custom task form(Infopath) in workflow, the challenge here was to maintain the persistence of the data entered by the users, so that they can view the data saved when opened for the next time.
This is how i achieved it .
1. Add fields to be saved in ItemMetaData file .For eg if Comments is the field to be saved add this line in ItemMetaData file.
<z:row xmlns:z=”#RowsetSchema” ows_Comments_=””/>
2. Assign ows_Comments as the default value for the Comments fields. (check Secondary data source to assign).
3. Add Save Button .
4. Add rule to the button .(Add Submit connection and Submit data using the connection).
5. Add UpdateTask activity on completion of OnTaskChanged in workflow.cs file.
6. Declare a variable called approverComments in workflow.cs source file .
7. Assign approverComments in onTaskChanged method,
if (On_Task_Changed_AfterProperties.ExtendedProperties[“Comments”] != null)
approverComments = On_Task_Changed_AfterProperties.ExtendedProperties[“Comments”].ToString();
This will get the Comments entered by the approver and assigns to a variable.
8. Add this line of code in UpdateTask activity.
this.Update_Task_TaskProperties = new SPWorkflowTaskProperties();
Update_Task_TaskProperties.ExtendedProperties[“ows_Comments”] = scpoShoppingCartNo;
This will assign the Comments entered by the approver to the Secondary Data Source we added in Step 1, that has been set the Default value for Comments field(Step 2). Now open the form to see the saved value .
I recommend one to read this blog if he/she is working on spgridview control.
I had a requirement of grouping the records in the grid based on a column, grouping is straight forward and can be achieved with just few lines of code.However, this used to generate duplicate grouping headers for the records in the grid.
I was trying to create a site programatically based on the template that i have designed , i thought this should be straight forward and passed the site template name as a parameter for the creation. Unfortunately, this wasn’t successful as the code was unable to recognize the site template name.
This blog speaks how to pass site template name as parameter.
I have been working on sharepoint-sap integration off late and have faced several challenges. One of those that i would like to share is extracting the windows account name from the firstname and lastname that you get it from SAP.
The windows account that you get from , can then be used to add users to the site. Enclosed is the snippet .
The concept of Site template gallery and .STP file doesn’t exists in sharepoint 2010 anymore, rather they have replaced with Solution gallery and .wsp file respectively.
Save site as a template link disappears when the publishing feature is enabled and the work around seems to be navigating manually to /_layouts/Savetmpl.aspx. To have a look at the repository of the site templates we have to navigate to Site Settings >Galleries >Solution Gallery.It can be noticed that our site would have saved with .wsp extension, that can be activated/deactivated like any other sandbox solution for usage.This on activation will be available for site creation. Thw .wsp[site template] file on click can also be downloaded as any other file and can be used as site template across web applications in sharepoint.
This blog speaks about an overview on Jquery , it covers various questions on jQuery.
What is Jquery ?
Why to use Jquery ?
When to use Jquery ?
Jquery can be used on following ocassions
2.Attaching events to HTML elements.
5.Dynamic CSS manipulations.
How to use ?
Jquery syntax is a combination of XPATH and CSS . The basic syntax looks like :
When not to use jQuery
1. When jQuery consumes plenty of client resources , it is not recommended to use jQuery. For instance : If we have 1000’s of items in a list, it is recommended to avoid jQuery as we have look through each items in the list.
2.jQuery can’t be used when there is no web service interface , for instance it can’t be used on workflows , event receivers .