Adding user to SharePoint Person or group column with smartform

  • 26 October 2015
  • 2 replies
  • 1 view

Userlevel 3
Badge +9

 

I am uploading document using smartoobject in sharepoint document library. I want to add current user name to person or group column in document library.

I am using sharepoint content service. Getting below error.

 

 

Error occurred trying to Execute (SmoSPDocument) - System.Exception: Invalid data has been used to update the list item. The field you are trying to update may be read only.
at SourceCode.SharePoint.Client.FileFunctions.uploadDocument(String fileName, Folder folder, Byte[] documentStream, ContentType contentType, RuntimeField[] metadataFields, Boolean overwrite)

at SourceCode.SharePoint.Client.DocumentFunctions.UploadDocument(String fileName, ContentType contentType, String fileContents, String subfolderPath, Boolean overwrite, String versionComment, RuntimeField[] metadataFields)

at SourceCode.SmartObjects.Services.SharePoint.Content.SmoSPDocument.executeUploadDocument(Property[] inputs, MethodParameters methodParams)

at SourceCode.SmartObjects.Services.SharePoint.Content.SmoSPDocument.callCreateMethod(Property[] inputs, Property[] returns, Method method)

at SourceCode.SmartObjects.Services.SharePoint.Content.SmoSPDocument.Execute(Property[] inputs, RequiredProperties required, Property[] returns, Method method) Error occurred trying to Execute (SmoSPDocument) - System.Exception: Invalid data has been used to update the list item. The field you are trying to update may be read only.

at SourceCode.SharePoint.Client.FileFunctions.uploadDocument(String fileName, Folder folder, Byte[] documentStream, ContentType contentType, RuntimeField[] metadataFields, Boolean overwrite)

at SourceCode.SharePoint.Client.DocumentFunctions.UploadDocument(String fileName, ContentType contentType, String fileContents, String subfolderPath, Boolean overwrite, String versionComment, RuntimeField[] metadataFields)

at SourceCode.SmartObjects.Services.SharePoint.Content.SmoSPDocument.executeUploadDocument(Property[] inputs, MethodParameters methodParams)

at SourceCode.SmartObjects.Services.SharePoint.Content.SmoSPDocument.callCreateMethod(Property[] inputs, Property[] returns, Method method)

at SourceCode.SmartObjects.Services.SharePoint.Content.SmoSPDocument.Execute(Property[] inputs, RequiredProperties required, Property[] returns, Method method)


2 replies

Badge +9

It's not the "Created by" or "Modified by' columns by any chance, is it?

Userlevel 3
Badge +9

No, its not Sharepoint system column. Created column called "Doc Created By". Document is getting upload with no issue. 

SharePoint content service has 2 columns Doc Created By  and Doc Created By (Value). 

thried to set value in Doc Created By (Value) column, doesnt throw any error and donesnt show user in sharepiont column.

Tried to set all vaues from current user in smartform (smartform-> system values -> current user) FQN, name, Display name, email.

Also tried to set field manualy.

getting same error.

 

 

 

Reply