Showing posts with label SharePoint Designer. Show all posts
Showing posts with label SharePoint Designer. Show all posts

2011-06-11

How to Customize Default Approval Workflow (Part.2)

In Part. 1 blog post, I introduced how to add Person or Group TextBox as CC form in Change Request Task Form. Only adding CC form, It doesn't work. So, in this blog post, I introduce how to add logic in custom Approval workflow to use CC form.



The Steps are here.

  • In Approval - Copy05 Top, click "Edit Workflow" and click "Approval Workflow Task (en-US) Copy".


  • Click "Change the behavior of a single task".


  • Add "Set Workflow Variable" in "When a Task Completes" section's top.


  • Click "workflow variable" and click "Create a new variable..." from pulldown. Fill in arbitrary name and choose String Type. Press OK.


  • Click value and click fx. Fill bellow parameters.


  • Click "Current Task:Assigned To" in "When a Task is Pending".


  • Click icon besides CC. Select "Workflow Lookup for a User...". And Fill in bellow parameters.


  • Click OK and publish the workflow.

The steps were finished. Please confirm that you can get CC email when you run the workflow.

Tips:
In the steps, I created a workflow variable in "When a Task Completes" section to get CC form content. And I added the workflow variable as a CC address in "When a Task is Pending" section. The important point is that you can't directly get CC form content in "When a Task is Pending" section. When you fill in CC form and click Send in Change Request form of a workflow task, The workflow task is completed and new workflow task is created. CC form content is associated the completed task. So you need to get CC form content in "When a Task Completes" section.

2011-06-02

How to Customize Default Approval Workflow (Part.1)

I'm sorry it has been taken long time since previous blog post.
Today I'd like to introduce how to customize default approval workflow using only SharePoint Designer (with non code).
This is new feature in SharePoint 2010. In SharePoint 2007, we couldn't customize default approval workflow. So you needed to make new own workflow from zero base if you want to customize approval workflow.


I introduce these steps in two blog posts.



OK, I introduce Part1 first, add bellow Person or Group TextBox as CC in ChangeRequest in Task Form.




The Steps are here.

  • First create a copy of default Approval Workflow in SPD. Click Copy and Modify and create new copy of default Approval Workflow.


  • Click Approval Workflow Task.

  • Click New in Task Form Fields to create CC as Person or Group Field.


  • Fill in these TextBox, choose Person or Group in Information type, and click Next.



  • Click Finish.


  • Save and Publish the .Approval Workflow.
  • Back to Approval - Copy05 page. Click Approval Workflow Task in Form.


  • Task Form is opened in InfoPath 2010. Check the CC form which was created previous step. 

  • Select CC Row and copy it(Control + C). Delete CC Row from default form.

Tips : You can also add CC from Fields property menu. But you can't resolve names in CC by using Enter key if you drag & drop CC from Fields property menu to ChangeRequest form. So you had better use the copy from default form.

  • Click Page Design Tab and choose ChangeRequest from View pulldown.

  • Add new Row and paste CC Row (Control + V) in ChangeRequest form.


  • Save the InfoPath form to local and Publish it.


Steps were finished.
I'll introduce how to use the CC in next blog post.


2011-05-05

Setting Default Value in List's NewForm.aspx Using Javascript

I introduced how to get column data on each list items row in a Xslt List View WebPart in the previous blog post.



Today, I'd like to introduce how to create "links" by using column data and enable to copy the column data to textboxes. When the link is clicked and opened, another list's NewForm.aspx page will appear.


The scenario is like this :


  • If you click the link on each list items


  • "Title" value and "Categories" value of each list items are copied in another list's NewForm.aspx textboxes.   


In inside I created "Notice the Announce" link with URL's parameters which has "Title" value and "Categories" value.

http://sp2010/Lists/Notice/NewForm.aspx?title=Let's go to drink with us !!&category=invitation

And I copied URL's parameters to textboxes on NewForm.aspx using Javascript.



So, I'll show you steps ! Please check its !

  • Open AllItems.aspx and enable "Advanced Mode" and display xslt view. (see previous post.
  • Drag & Drop the ASP.NET HyperLink in a column.


  • You can check if the code is added in code view and design view.



  • Create a link in asp:HyperLink tag using NavigateURL property and change link name from "HyperLink" to "Notice the Announce".  (also see previous post.)

 http://sp2010/Lists/Notice/NewForm.aspx?title=&category=
Notice the Announce



  • Open another list's NewForm.aspx of the link target and enable "Advanced Mode".
  • Add Javascript code under the asp:content tag.





////////


The Javascript code details :
First, I added column data from URL's parameters to Array class instance.
Second, I made "copyColumnData" function and added column data from Array class instance to textboxes. "aspnetForm" means the name property in Form tag in html. "ctl00_m_g_f3ae55fa_9a6e_4277_b7b3_e011e50d2977_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" means the id property in its textbox's input tag in html. You can check it in NewForm.aspx html source.




Third, I added "copyColumnData" function as a listener in window.attachEvent method. "onload" means  window.attachEvent method is called after page load is finished.


  • Steps are done ! Save aspx pages and check the motion !



I see bellow blog post by reference. It's very understandable.
Passing default values to a SharePoint list's NewForm.aspx page.




I usually go to cafe on a weekend. I can concentrate a few hours.


2011-04-30

How To Get Column Data On Each List Items row in a Xslt List View WebPart

In SharePoint 2007, We can get all column data bellow xslt code.
This sample is getting "Title" column value in "Modified" column.


Also we can get same result bellow code.


The Bellow image is result.



In SharePoint 2010, we cannot use the above code. We should use bellow code.



The Bellow image is result.


Then, I introduce how to add this code easily in SharePoint Designer.


  • Open AllItems.aspx or other new view page in SharePoint Designer.
  • Click "Advanced Mode" in Home tab to enable to edit entire page.



  • Click List View Web Part in Design View.

  • Click "Customize XSLT" - "Customize Entire View" in Design Tab. 



  • Drag & Drop "Title" from Data Source Detail to Xslt List View Web Part.

  • You can check the code in Code View.


After cherry blossoms, we can see a lot of field mustard !