Symptoms
Step 1 : simulation of Development environment
A) Creation of a Custom list SharePoint with the following column in this order of creation:
- Workshop leader - CommentsA
- Workshop leader - CommentsB
B) Create the corresponding SmartObject (and Service) using the SharePoint Interface.
C) Generate a Editable List View that work on this columns.
D) Test: OK
E) Export these Views, SmartObjects and Services.
Step 2 Simulation of Staging environment
A) Creation of a Custom list SharePoint with the following column in this order of creation (DIFFERENT ORDER of point 1A):
- Workshop leader - CommentsB
- Workshop leader - CommentsA
B) Deploy the package created in step 1E
C) Test: Columns are reversed.
If the columns are not with the same type of data (String/DateTime) we get the following error :The string was not recognized as a valid DateTime. There is an unknown word starting
at index 0.Couldn't store andltCandgt in Chef_x0020_Atelier_x0020__x2013_0 Column. Expected type is DateTime.
Diagnoses
I notice that no issue appears if after the step 2-B, we create smartObject using SharePoint K2 Application and if we don't update SmartObject (Use Existing SmartObject) in the Deployment step.
I tested by use a SharePoint Template but I don't reproduce in this context:
After Step E, Inverse the column order in SharePoint (List Setting/Column ordering), and after export this list as template. And replace the Step 2-A by an import of the template.
Then, we think that the issue of the customer was only because they created manually the SharePoint Column manually in the Staging environment in a different order of the development one.
We already asked to customer what was the exact scenario but they are not able to remember (and found the good person that do this).
We already provided to customer and indication of best practice to not use SharePoint column name with lot of spaces.
The customer didn't raise the issue several time since April: only one SharePoint list was impacted.
Technically the issue appears because
1) We take "only" the first 32 characters of the column name.
2) The special characters like space are replaced by "_x0020_"
Example:
"Chef_x0020_atelier_x0020__x002d_0"
Please could you log as a bug in order to:
a) At least improve the documentation by explaining that it's recommended to not use special characters in the column name like space.
b) If possible, log this as an issue to fix by:
- Use a smaller characters for the special characters replacement (use "_ " instead of "_x0020_")
- And/or don't limit to 32 characters the column name.
Resolution
Analysis with the customer and fix by:
Drop the Sharepoint list from the staging environment and re-create it by import of the template list.
We open a change request on K2 product for update the documentation: Improve the documentation by explaining that it's recommended to not use special characters in the column name like space.
We link this ticket to a known issue.