Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

lookup field (multiple value) more than seven values on copying from one library to another using extension method SPFileCollection.Add throws error

$
0
0

I have  a lookup field which is multiple value field. If I use less than seven values and copy from one library to another using extension method spfilecollection.add I do not face any problem.

However if I a use more than seven values in lookup field it throws below error

Microsoft.SharePoint.SPException: The URL 'Labinal_FrontOffice_Documents/Manufacture/MFG0701IN310F007.xlsx' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web. ---> System.Runtime.InteropServices.COMException (0x81020030): The URL 'Labinal_FrontOffice_Documents/Manufacture/MFG0701IN310F007.xlsx' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web. at Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object varFile, PutFileOpt PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage) at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object varFile, PutFileOpt PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage) --- End of inner exception stack trace --- at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object varFile, PutFileOpt PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage) at Microsoft.SharePoint.SPFileCollection.AddInternal(String urlOfFile, Object file, PutFileOpt fileOpt, String createdBy, String modifiedBy, Int32 createdByID, Int32 modifiedByID, DateTime timeCreated, DateTime timeLastModified, Object varProperties, String checkInComment, SPVirusCheckStatus& virusCheckStatus, String& virusCheckMessage) at Microsoft.SharePoint.SPFileCollection.Add(String urlOfFile, Byte[] file, Boolean overwrite, String checkInComment, Boolean checkRequiredFields, SPVirusCheckStatus& virusCheckStatus, String& virusCheckMessage) at Microsoft.SharePoint.SPFileCollection.Add(String urlOfFile, Byte[] file, Boolean overwrite, String checkInComment, Boolean checkRequiredFields) atMicrosoft.SharePoint.SPFileCollection.Add(String urlOfFile, Byte[] file, Boolean overwrite) at Labinal.IMS.Library.Parameters.Extensions.CopyToList(SPFile theFile, SPList destinationList, String relativeDestinationUrl, String fileName, Boolean overwrite, Int32 previouslyPublishedFrontOfficeItemId) at Labinal.IMS.Library.Helpers.DocumentTools.<>c__DisplayClass1.b__0()

SPFileCollection.Add Method

            copiedFile = filesInDestinationFolder.Add(fileName, binFile,true);

tried using all overloaded methods but still does not work.


Viewing all articles
Browse latest Browse all 11508

Trending Articles