A. Background
In this article I describe how to configure the following requirements:
- A list contains a
custom column which should be
filled by a workflow only.
- This column should be
read-only, i.e. it should neither appear on the New form nor on the Edit form.
B. List preparations:
1- Create a
custom list called
Student Marks.
2- Create the following
columns:
-
Student Name of type
Single line of text
-
English of type
Number
-
Math of type
Number
-
Total of type
Number
Now the
New form looks like this:

3-
Hide the Total field from the
New and
Edit form.
- Click
Settings >
List Settings >
Advanced Settings.
- Set
Allow management of content types? to
Yes.
- Click
OK to get back to the
Settings page.
- Under the
Content Types section, click
Item.
- Under the
Columns section, click the
Total column.
- In the
Column Settings, select
Hidden.

- Click
OK.
-
NOTE: If you have more than one content type defined on this custom list, then you have to repeat these steps for every Content Type.
Now the New form looks like this:
C. Workflow in SharePoint Designer:
1- Open
Microsoft Office SharePoint Designer 2007.
2- Click
File >
Open Site.
3- Enter the
URL of the site containing our custom list called Price List.
4- Now click
File >
New >
Workflow.
5- On the
Define your new workflow page, enter the following data:
- Name: Calculate Total
- Attachment List: Student Marks
- Start Options: Automatically start this workflow when a new item is created
- Click
Next, in order to start designing the workflow steps.
- Enter
Calculate the total as the
Step Name.
- In the
Actions section, select the action
Do Calculation.
- Click the
value link then click
fx. For the
source select
Current Item and for the
field select
English.
- Leave the
operator as
plus.
- Click the other
value link then click
fx. For the
source select
Current Item and for the
field select
Math.
- Click the
output variable link. Then
Create a new variable called
calculatedTotal.
- In the
Actions section, select the action
Set field in Current Item.
- Click the
field link and select
Total.
- Click the
value link then click
fx. For the
source select
Workflow Data and for the
field select
calculatedTotal.

- Click
Finish, in order to save and publish the workflow.
D. Test the solution
1. Create a new item in the Students Marks list.
2. Check that the workflow has completed successfully.
3. Check that the Total field contains the correct sum.
No comments:
Post a Comment