The last time we discussed the composition of list form operation links before a workflow is attached. In this article, let's take a look at the changes that have taken place after the workflow is created.
To continue the last unfinished operation, create a simple workflow with all the form fields required. (It doesn't matter what you do. You only need to use all the form fields. Because in any case, we need to modify the workflow operation .)
Now we have created a workflow. Let's take a look at the JavaScript call in the HREF link.
After
<A href = "javascript: {ddwrt: GenFireServerEvent (concat ('_ workflowStart = {A50B3A56-0C82-43E3-917E-D37E2E036F3B}, New, {F6244C84-AAE5-45E0-9C71-60F6AB31F584}, ff1_x007b _ x0024_Pos_x007d _ = {ff1 ', $ Pos, '} * ff2_x007b _ x0024_Pos_x007d _ = {ff2', $ Pos, '} * ff3_x007b _ x0024_Pos_x007d _ = {ff3', $ Pos, '} * ff4_x007b _ x0024_Pos_x007d _ = {ff4', $ Pos, '} * ff5_x007b _ x0024_Pos_x007d _ = {ff5', $ Pos, '} * ff6_x007b _ x0024_Pos_x007d _ = {ff6', $ Pos, '} * ff7_x007b _ x0024_Pos_x007d _ = {ff7', $ Pos ,'}*}; __commit ')} "> Save the file </a>
Wow! There is a lot of code. But let's split it up and check it out.
There is actually only one more concat () function. The purpose is to pass some variables to trigger custom operations (_ workflowStart) while running the commit function ):
1. ddwrt: GenFireServerEvent ()-this is also seen in the previous code. Previously, it received a string. Here, it still receives a string, but this time the string has become a little long.
2. concat ()-concatenates a large number of strings and/or variables separated by commas and outputs them into a long string. In this function, we can see that all operations are part of the connector and arranged in the order we set when creating the workflow:
The I. _ workflowStart-workflowStart function requires four parameters:
I. GUID of the workflow
Ii. A string: 'new' (does anyone know which options are available here ?)
Iii. Another GUID (does anyone know what it represents ?)
Iv. A long string of several name-value pairs separated by asterisks represents the fields in the form and the values they contain-thank God, this part is what we care about. The long string parameters use the following syntax:
Fieldname1=Value1*Fieldname2=Value2 *... FieldnameN=ValueN *
II. _ commit-this is a simple function used to submit our changes back to the database.
Therefore, the fourth parameter is as follows:
ff1_x007b__x0024_Pos_x007d_={ff1',$Pos,'}*ff2_x007b__x0024_Pos_x007d_={ff2',$Pos,'}*ff3_x007b__x0024_Pos_x007d_={ff3',$Pos,'}*ff4_x007b__x0024_Pos_x007d_={ff4',$Pos,'}*ff5_x007b__x0024_Pos_x007d_={ff5',$Pos,'}*ff6_x007b__x0024_Pos_x007d_={ff6',$Pos,'}*ff7_x007b__x0024_Pos_x007d_={ff7',$Pos,'}*
Or re-layout as follows to make it easier to read:
ff1_x007b__x0024_Pos_x007d_={ff1',$Pos,'}*ff2_x007b__x0024_Pos_x007d_={ff2',$Pos,'}*ff3_x007b__x0024_Pos_x007d_={ff3',$Pos,'}*. . .ff7_x007b__x0024_Pos_x007d_={ff7',$Pos,'}*
Each name-value pair has the following rules:
A long field name generated by SharePoint starts with ff and a number (n. The number indicates the order in the page = {ffn_1}
The part of "_ 1" comes from the parameter $ Pos, which is replaced with "_ 1" on the client ". After it is passed to the workflow, the actual value of the form field ffn_1 will be inserted because it is located inside, the content in {} is replaced by the actual value of the corresponding field on the page.
In other words, if ff1 represents the Name column and the value of the form field is "John"... when the Name value pair is passed to the workflow, it should look like the following:
Ff1_x007b _ x0024_Pos_x007d _ = John
(Do not worry about symbols like x00XX. It is only the converted string, and also for the convenience of workflow use. From the perspective of convenience for human reading, the conversion should be ff1 (_ $ Pos), but this does not seem to make it more readable .)
Failed to set the processor style ???
Have you encountered such an error?
Next time: In the subsequent expansion of the DVWP series, we will discuss why such an error occurs, where the key points are, and how to fix it.
References
SharePoint: Extending the DVWP-Part 8: Creating a Form Action Workflow-The After Math