locked
External data column showing blank values on edit properties but shows values in view properties. RRS feed

  • Question

  • Hello,

    I am setting external data column value using code like

    ClientContext context = new ClientContext(txtDestinationSite.Text);
    
                    FileCreationInformation newFile = new FileCreationInformation();
    
                    newFile.Content = ReadToEnd(fileInfo.FileInf.OpenRead());
    
    
                    newFile.Url = "/" + cmbBxLibraries.Text + "/" + fileInfo.FileInf.Name;
                    List docs = context.Web.Lists.GetByTitle(cmbBxLibraries.Text);
                    Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
    
                    ListItem item = uploadFile.ListItemAllFields;
    
                
    
                    item["Document_x0020_Source"] = fileInfo.Source;
                    
                    item.Update();
                    context.Load(uploadFile);
                   
                    context.ExecuteQuery();
    


    this is uploading and setting value without error.

    but when i editing file property its value is not showing instead of showing it on View properties.

    and also is not showing in the document library view.

    Please tell where am doing wrong?

    Wednesday, January 4, 2012 10:58 AM

All replies

  • Hi SarveshSingh2011:

     

    About your question.If the value of the [fileInfo.Source] does not match the unique field values of your  External data,you will get the issue.

    You can try  to check it as following:

    Choose the Item you upload->Edit Properties-> Input the value(copy by View Properties)->Check if External Item exits(check if error)

    Also you can go to Select External Item(s) to find what value it can Identification. And decided to reassign the item value or change the External data source to resolve it.

     

     

    Thanks,

     

    Lhan Han



    • Marked as answer by Shimin Huang Monday, January 9, 2012 2:22 AM
    • Unmarked as answer by Mike Walsh FIN Tuesday, January 17, 2012 12:03 PM
    • Edited by Mike Walsh FIN Tuesday, January 17, 2012 12:05 PM I have removed the mark as answer as the OP has now said that it didn't answer his question
    Friday, January 6, 2012 1:02 PM
    Moderator
  • I have tried your approach to define Unique value.

    i have changed like this.

       item["Document_x0020_Source"] = 1;

    "1" is my unique ID value for the BCS data column.

    but when i am using this code ...its still not showing in the default view of the library which is the same thing as before.

     

     

    Tuesday, January 17, 2012 11:58 AM