SharePoint: Extended DVWP-Part 2: workflow automatically creates titles based on other fields

Source: Internet
Author: User
Document directory
  • Use a workflow to create a title
  • Notes

When we implement the cascade drop-down box function, it is very important to create a link list, which can associate the website columns with each other. The title bar of the Link List is irrelevant to cascade. However, from the perspective of human nature, if there is a title, it will make maintenance easier. Last time, we used jQuery to automatically create the title content. I know that not all people like jQuery. So here is the good news...

You can achieve almost the same effect through the workflow.

Use a workflow to create a title

Of course, we will use SharePoint Designer to create a workflow. Therefore, run SPD and open our website:

 

1. Click the arrow next to "new document" and select "workflow"

The workflow designer wizard is displayed.

 

2. Start a name

3. Select a list

 

4. deselect "allow manual start of this workflow from a project" and select "automatically start this workflow when a new project is created"

 

5. Click "Next"

 

6. Click "operation" and select "other operations ..."

 

Select "generate dynamic string ".

7. Click "dynamic string"

 

8. Click "add search"

 

9. Keep "Source" as "Current Project", and set "Domain" as the first field used for splicing the title. In this example, it is "Contries"

10. Click "OK"

Enter a space, a minus sign, and a space (or any split information you designed)

11. Click "add search" again"

This time, select the field used for the second splicing title (here I select States)

12. Click "OK"

13. Click "variable: variable"

Then click "create variable ..."

14. Name it

15. Click "operations" and select "update list items"

16. Click "This list"

17. Click "add" and select the title in "set this domain.

18. Click "fx ".

Change "Source" to "workflow data" and "Domain" to txtTitle.

19. Click "OK" three times

20. Click "finish"

You will see a message:

... Wait a moment and the workflow will be created.

Now, we have completed the workflow design for creating titles dynamically.

Notes

There are many shortcomings in using workflows, which may not necessarily lead to errors, but are quite uncomfortable.

1. The most obvious disadvantage is that the title is not set immediately. Workflow execution takes some time. During this period, the title will be empty, which is dizzy, making the field sorting look messy.
2. Any fields required for splicing titles must be required, or you must check them in the workflow. If there is no value, assign a default value. If you have used a workflow before, you will know that using conditional statements and branches is not that simple.
3. If a workflow error ends, our title will never be set.
4. If the field used to splice the title changes, such changes cannot be synchronized. To be synchronized back, you must write a workflow that is automatically started during creation and modification. However, in this way, you must constantly track and check the field to determine whether it has changed before modifying the title.
5. If you have enabled version control, you will get a new version after each setting or resetting the title.
6. flaw: If the Creator does not have the editing permission (for example, the author who removes the editing permission), the workflow will fail because the workflow runs under the user ID, therefore, access is denied when the list item is updated.

 

Next time: We will learn how to use SPServices to create list items.

 

References

SharePoint: Extending the DVWP-Part 23: Creating Title Based on Other Fields with a Workflow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.