I am getting below error when I tried to install the WSP in staging environment.     Add-SPSolution : Operation is not valid due to the current state of   the object. At line:1 char:1   + Add-SPSolution  -LiteralPath "D:\StagePackage\SharePoint.ServiceSett ...   + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       + CategoryInfo          : InvalidData: (Microsoft.Share...dletAddSolution:SPCmdletAddSolution) [   Add-SPSolution], InvalidOperationException       + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSolution   I am not sure what is the exact issue here, I tried to install the same package in my dev/test environment its working fine  Below is the ULS log     Deleting the SPPersistedObject, SPSolutionLanguagePack   Name=0.   5f1402fb-84e7-41d1-abeb-da9cdc500246      Deleting the SPPersistedObject, SPSolution   Name=sharepoint.mysettings.wsp.   5f1402fb-84e7-41d1-abeb-da9cdc500246      System.InvalidOperationException: Operation is not valid due to the   current state of the object.     at   Microsoft.SharePoint.Administration.SPConfigurationDatabase.Microsoft.SharePoint.Administration.ISPPersistedStoreProvider.GetParent(SPPersistedObject   persistedObject)     at   Microsoft.SharePoint.Administration.SPSolutionLanguagePack.get_DisplayName()   at   Microsoft.SharePoint.Administration.SPSolutionLanguagePack.SetSolutionFile(SPFarmSolutionPackage   solnPackage, String path, String solutionName, Boolean isRestore)   at   Microsoft.SharePoint.Administration.SPSolution.AddLanguagePack(SPFarmSolutionPackage   solnPackage, String path, UInt32 lcid, String name, Boolean isRestore)   at Microsoft.SharePoint.Administration.SPSolutionCollection.Add(String   path, String name, UInt32 lcid, Boolean isRestore)     at   Microsoft.SharePoint.Administration.SPSolutionCollection.Add(String   path, UInt32 lcid)     at   Microsoft.SharePoint.PowerShell.SPNewCmdletBase`1.InternalProcessRecord()   at   Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()  5f1402fb-84e7-41d1-abeb-da9cdc500246      Error Category: InvalidData    Target Object    Microsoft.SharePoint.PowerShell.SPCmdletAddSolution  Details  NULL    RecommendedAction NULL    5f1402fb-84e7-41d1-abeb-da9cdc500246   I tried deploying the package with stsadm command also and there also I am getting error. Its 2013 solution and scoped at farm level  I am completely running out of ideas can anyone please help me on this.
122386
I installed the August-2016 CU updates and then I upgraded the farm solutions after that i can't deploy any solutions in SharePoint 2013 by using visual studio  ?I got this error message Error occurred in deployment step 'Add Solution': Operation is not valid due to the current state of the object.
93329
i am trying to update a listitem in a event receiver on FeatureActivated in a document library.   public override void FeatureActivated(SPFeatureReceiverProperties properties)     {          SPSecurity.RunWithElevatedPrivileges(delegate()         {             using (SPSite site = SPContext.Current.Site)             {                 using (SPWeb myweb = site.OpenWeb())                 {                   SPList list = myweb.Lists.TryGetList("Document Library");                 SPListItemCollection items = list.GetItems();                  for (int i = 0; i &lt; items.Count; i++)                 {                      SPListItem item = items[i];                        Guid fieldID = item.Fields.GetFieldByInternalName("Age").Id;                      string valueField = item[fieldID].ToString();                     valueField = "";                     item.Update();                 }                 }             }         });                 }   My field does not get empty?
70546
When we try to send some data to an external web service (REST, POST, JSON), we get the next error:     System.CalloutException: sun.security.validator.ValidatorException:   PKIX path building failed:   sun.security.provider.certpath.SunCertPathBuilderException: unable to   find valid certification path to requested target   If we check the certificate, it's a valid "Go Daddy Secure Certificate Authority - G2".  Also, We have checked that this company is included as a valid Certificate Authority into Salesforce list ().
58736
When I try to redeploy an object that exists in source and destination orgs, the deploy fails with the cryptic and useless error message:  duplicate value found &lt;unknown&gt; duplicates value on record with id: &lt;unknown&gt;   This fails whether I deploy with Migration Tool or IDE. Note, individual fields are deployable, but not the object.
44772
I created Rest post method for inserting new lead record but in lead Sobject there is Campaign Lookup filed name is 'Campaign' but when i save this method i got the error "Error: Compile Error: Invalid field Campaign for SObject Lead at line 53 column 5"  @HttpPost  global static void CreateRecord()  {      RestRequest req = RestContext.request;     Blob body = req.requestBody;     String bodyString = body.toString();      //Deserializing the data sent into concrete SFDC objects     LeadUtils jsonwrap =(LeadUtils)JSON.deserialize(bodyString,LeadUtils.class);      //Initlize the lead object     Lead ledID = new Lead();     Campaign camp =new Campaign();     camp =[select Name from Campaign where Name =:'SmartQuote'];     //Get requested parameter one by one     ledID.SQ_Account_ID__c = jsonwrap.AccountID;     ledID.FirstName = jsonwrap.First_nm;         ledID.LastName = jsonwrap.Last_nm;     ledID.Phone = jsonwrap.Phone;     ledID.Interest_Type__c='Other';     ledID.Rating='Hot';     ledID.LeadSource='SmartQuote';     ledID.Campaign =camp.Name;     ledID.Industry='Other';     ledID.Email = jsonwrap.Email_id;     ledID.Company= jsonwrap.Company;      // insert lead record in salesforce      insert ledID;     RestContext.response.addHeader('Content-Type', 'application/json');      // Return a single Lead as an example      RestContext.response.responseBody =       Blob.valueOf(JSON.serialize((Lead)[Select ID from Lead where ID=:ledID.ID]));  }  }
120145
I am currently trying to write a Dynamics CRM 2011 plugin that creates a new SharePoint 2010 site (within an existing site collection) for every account that is created. I have the code for creating a library, which uses the following methods:          private static ClientContext CreateSharePointConnection()         {             try             {                 Uri spSiteUrl = new Uri(Constants.SharePointSiteName);                 using (ClientContext spcontext = new ClientContext(spSiteUrl))                 {                     spcontext.Credentials                         = new System.Net.NetworkCredential(Constants.UserName                             , Constants.Password, Constants.DomainName);                     return spcontext;                 }             }             catch (Exception ex)             {                 throw new Exception("SharePointMethods.CreateSharePointConnection (General Exception: "                     + ex.Message + ")");             }         }  private static void CreateDocumentLibrary(ClientContext _clientContext             , string _documentLibraryName, string _documentLibraryDescription)         {             try             {                 Web web = _clientContext.Web;                 _clientContext.Load(web);                 _clientContext.ExecuteQuery();                 ListCreationInformation lci = new ListCreationInformation();                 lci.Title = _documentLibraryName;                 lci.Description = _documentLibraryDescription;                 lci.TemplateType = 101;                 List newDocumentLibrary = web.Lists.Add(lci);                 newDocumentLibrary.ContentTypesEnabled = true;                 newDocumentLibrary.Update();                 _clientContext.ExecuteQuery();             }             catch (Exception ex)             {                 throw new Exception("SharePointMethods.CreateDocumentLibrary('" + _documentLibraryName                     + "') (General Exception: " + ex.Message + ")");             }         }   So I would like to write a method CreateSite instead of CreateDocumentLibrary. However, all examples I can find on the web for programmatically creating a Site are using SPSite, SPWeb, etc. Something like this:  private static void CreateSite(string _siteName, string _siteDescription) {     try     {         SPSite site = new SPSite(Constants.SharePointSiteName);         SPWeb web = site.OpenWeb();         SPWebCollection wc = web.Webs;         string siteTemplate = web.WebTemplate;         wc.Add(Constants.SharePointSiteName, _siteName, _siteDescription, 1043, siteTemplate, true, false);     }     catch (Exception ex)     {         throw new Exception("SharePointMethods.CreateSite('" + _siteName             + "') (General Exception: " + ex.Message + ")");     } }   However this is NOT a solution for my problem, because the SPSite, SPWeb, etc. only work on the local machine and I want to create a Site from a remote (in my case CRM) server. Anyone got an idea how to solve this.  PS: Code might still contain memory leaks, so please be carful when you use it for production purposes!
100775
There's a weird thing happening with my Windows application. I have created a Sharepoint utility to automate the creation of content-types and site-columns. At a point where I try to get my available fields, I get this error:     An unhandled exception of type 'Microsoft.SharePoint.Client.ServerException' occurred in Microsoft.SharePoint.Client.Runtime.dll   Additional information: Requested value 'CheckBoxes' was not found.   It is throwing an exception at:  ClientContext clientContxt = new ClientContext(clientContext.Url);         clientContext.Credentials = clientContext.Credentials;         Web web = clientContext.Web;          clientContext.Load(web, w =&gt; w.AvailableFields);         clientContext.ExecuteQuery(); //**exception thrown here**   Kindly please suggest what is wrong here?
72654
Environment: Windows Server 2003 R2 Enterprise 64bit, SP2 .NET framework is supposedly installed (2.0 SP2, 3.0 SP2, 3.5 SP1)  I say "supposedly" because they are listed as installed under Add/Remove programs. I'm not sure it's properly installed, because the "ASP.NET" tab isn't added to any of the sites in IIS.  In the IIS Web Service Extensions section, I have both "ASP.NET v2.0.50727" (Allowed), and "ASP.NET v2.0.50727 (32-bit)" (Prohibited).  The site in question has script-execute enabled.  Problem:  I created a super-simple ASP.NET/C# website: Default.aspx with a label id="Label1", and a code-behind with: Label1.text = "Hello World"; and the error I'm getting is:     %1 is not a valid Win32 application.
47201
I have two sites that were originally migrated from SPS2003.  It worked well in SharePoint 2007 and even on SharePoint 2010,  however when we migrated it to SharePoint 2013,  the home page throws following errors on the ULS Log.     5/24/2013 09:57:46.62  w3wp.exe (0x0D50)   0x1D24  SharePoint Foundation   Files   ak8dj   High   UserAgent not available, file operations may not be optimized.    at Microsoft.SharePoint.SPFileStreamManager.CreateCobaltStreamContainer(SPFileStreamStore spfs, ILockBytes ilb, Boolean copyOnFirstWrite, Boolean disposeIlb)     at Microsoft.SharePoint.SPFileStreamManager.SetInputLockBytes(SPFileInfo&amp; fileInfo, SqlSession session, PrefetchResult prefetchResult)        05/24/2013 09:57:46.62 w3wp.exe (0x0D50)   0x1D24  SharePoint Foundation   Cobalt  ajoii   Medium   Mapping Store error to Cobalt error. [Store Error: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedStreamBufferFactory.CreateFromDocParams(SqlSession session, Guid guidSiteId, Int32 cbContent, Nullable1 parentId, Guid docId, Nullable1 level, SPChunkedArray`1 rgbContent, Byte[] rgbRbsId, Int64 bsn, Byte partition, Int32 pageSize, Boolean bStartFilling)        05/24/2013 09:57:46.62 w3wp.exe (0x0D50)   0x1D24  SharePoint Foundation   Cobalt  aintx   High    Failed in CobaltStream.LockBytes: ErrorException --- Error: Unknown (Win32=0x80004003) --- Error message: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedStreamBufferFactory.CreateFromDocParams(SqlSession session, Guid guidSiteId, Int32 cbContent, Nullable1 parentId, Guid docId, Nullable1 level, SPChunkedArray`1 rgbContent, Byte[] rgbRbsId, Int64 bsn, Byte partition, Int32 pageSize, Boolean bStartFilling)     at         05/24/2013 09:57:46.64 w3wp.exe (0x0D50)   0x1D24  SharePoint Foundation   Files   ak8dj   High    UserAgent not available, file operations may not be optimized.    at Microsoft.SharePoint.SPFileStreamManager.CreateCobaltStreamContainer(SPFileStreamStore spfs, ILockBytes ilb, Boolean copyOnFirstWrite, Boolean disposeIlb)     at Microsoft.SharePoint.SPFileStreamManager.SetInputLockBytes(SPFileInfo&amp; fileInfo, SqlSession session, PrefetchResult prefetchResult)     at         05/24/2013 09:57:46.64 w3wp.exe (0x0D50)   0x1D24  SharePoint Foundation   Database    ab1a9   High    Failed to get document content data. System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedStreamBufferFactory.CreateFromDocParams(SqlSession session, Guid guidSiteId, Int32 cbContent, Nullable1 parentId, Guid docId, Nullable1 level, SPChunkedArray`1 rgbContent, Byte[] rgbRbsId, Int64 bsn, Byte partition, Int32 pageSize, Boolean bStartFilling)     at   I could not find any materials related to this on the internet,  I am not even sure if it has to do something with SPS2003 compatibility.  Any help pointers?
57387
I am attempting to upgrade my Drupal 8.9.2 multi-site installation to D9. I was hoping to work this all out on a development installation, that is located in a subdirectory of my home directory on my NameCheap Shared Hosting plan. When I first installed this installation, I did so using the tarball method from years ago. I then followed the instructions given here (). I was able to get the current running prod version converted to use composer with out an issue. Before I go and start messing with the files, and attempting to upgrade to D9 through composer on a prod installation, I wanted to copy these files over to another installation where I can use it as a sandbox. To do this I:  copied the files on my server to a new directory made clone databases for the new installation truncated all the cache tables in the cloned DB changed all the database settings in the settings files to point to the cloned databases  I've done this before without any issues, and now I seem to be getting a WSOD error on all the sites running from the new installation. The error I'm getting is  PHP Fatal error:  Uncaught Error: Class 'Drupal\Core\Cache\DatabaseBackend' not found in ~/{new installation dir}/public_html/index.php:16.  If anyone has any thoughts what's going on I am all ears. Thank you in advance
63247
I'm trying to work out a way to display the contents of the version column from SharePoint (i.e. the value that changes every time a file is checked in) as a field (or something similar) inside of a Word document.  Ideally, I'd like to know how to configure SharePoint so I could click something like "Insert > Quick Parts > Document Property > Version", and it would include the version in the document.  The goal is to make it easier for someone to correlate a printed version of a document with the version history of SharePoint.  I have been able to add editable text columns to the Document content-type and have them show up as document property quick parts.  I've also been able to add a calculated column which gets the version as a text string... however this calculated column isn't showing up in Word as a document property.  (Perhaps I'm missing a setting on the calculated column)
46641
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady); var listTitle = []; var listUrl = []; var listIsActive = []; var listOrder = [];  function sharePointReady(){ var siteUrl = mysite;     var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('Privacy Statements');  var camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml(''); this.collListItem = oList.getItems(camlQuery);  clientContext.load(collListItem);  clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));         }    function onQuerySucceeded(sender, args) {  var listItemEnumerator = collListItem.getEnumerator();   while (listItemEnumerator.moveNext()) {     var oListItem = listItemEnumerator.get_current();     listTitle.push(oListItem.get_item('Title'));     listUrl.push(oListItem.get_item('PrivacyStatementUrls').get_url());      listIsActive.push(oListItem.get_item('IsActive'));     listOrder.push(oListItem.get_item('SortOrder'));    } sessionStorage.setItem('Title', JSON.stringify(listTitle)); sessionStorage.setItem('Url', JSON.stringify(listUrl)); sessionStorage.setItem('IsActive', JSON.stringify(listIsActive)); sessionStorage.setItem('Order', JSON.stringify(listOrder)); var retrievedTitle = sessionStorage.getItem("Title"); var arTitle = JSON.parse(retrievedTitle); var retrievedUrl = sessionStorage.getItem("Url"); var arUrl = JSON.parse(retrievedUrl); var retrievedIsActive = sessionStorage.getItem("IsActive"); var arIsAct = JSON.parse(retrievedIsActive); var retrievedOrd = sessionStorage.getItem("Order"); var arOrd = JSON.parse(retrievedOrd);  var test = '' for(x=0; x&lt;arTitle.length+1;x++) {      for(i=0; i&lt;arTitle.length+1;i++)     {          if(arIsAct[i] == true){             if(arOrd[i] == x){                 test +='&lt;a href="'+arUrl[i]+'"&gt;'+arTitle[i]+'&lt;/a&gt;&lt;br&gt;';             }            }      } }  document.getElementById('test').innerHTML = test; }  function onQueryFailed(sender, args) {  alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); }   I am trying to use caching with sessionstorage when getting items from a list, so it doesn't have to keep querying the list over and over again. It can just check with the sessionstorage and if its in the list there is no need to get the item but if its not in sessionstorage get the item from the list. I am not sure how to do this, my code above shows my attempt
110175
I am receiving an error stated above on line 26**(listAccount1)**, can anyone guide me on how to solve it?  public class FRB_UpdateExceptionsforBatch {    public static void FRB_Exceptions(){    string FRBRecordTypeID = utility.getFRBProfileNameLabel();       List&lt;Account&gt; lstAccount = new List&lt;Account&gt;();         List&lt;Account&gt; lstAccount1 = new List&lt;Account&gt;();         List&lt;Account&gt; lstAccount2 = new List&lt;Account&gt;();         List&lt;Account&gt; lstAccount3 = new List&lt;Account&gt;();    lstAccount = [Select id,FRB_Firm_Check__c,Number_of_Exception__c,Number_of_exceptions_under_4_6_bucket__c,Number_of_exceptions_under_7_10_bucket__c,Number_of_exceptions_under_11_19_bucket__c,(select id,Account_Standing__c from Process_Adherence_Monitoring__r  where Status__C != 'Closed' AND  recordtypeId =: FRBRecordTypeID AND Account_Standing__c = '0-3 Days (Green - New Exception)' ) FROM Account WHERE FRB_Firm_Check__c = TRUE];     if(lstAccount.size()&gt;0){           for( Account acc : lstAccount )           {               List&lt;Process_Adherence_Monitoring__c&gt; lstCont = acc.Process_Adherence_Monitoring__r;                acc.Number_of_Exception__c = lstCont.size();               acc.FRB_Firm_Check__c = true;           }            update lstAccount;     }         //To update 4-6 bucket      lstAccount1 = [select Id, Name,FRB_Firm_Check__c, Number_of_exceptions_under_4_6_bucket__c,(select id,Account_Standing__c from Process_Adherence_Monitoring__r  where Status__C != 'Closed' AND  recordtypeId =: FRBRecordTypeID AND Account_Standing__c = '4-6 Days (Yellow - Outside Correction Timeframe)' ) from Account where FRB_Firm_Check__c = TRUE];        if(lstAccount1.size()&gt;0){           for( Account acc : lstAccount1 )           {               List&lt;Process_Adherence_Monitoring__c&gt; lstCont1 = acc.Process_Adherence_Monitoring__r;                              acc.Number_of_exceptions_under_4_6_bucket__c= lstCont1.size();               acc.FRB_Firm_Check__c = true;           }            update lstAccount1 ;       }         //To update 6-11 bucket         lstAccount2 =  [select Id, Name,FRB_Firm_Check__c, Number_of_exceptions_under_7_10_bucket__c,(select id,Account_Standing__c from Process_Adherence_Monitoring__r  where Status__C != 'Closed' AND  recordtypeId =: FRBRecordTypeID AND Account_Standing__c = '7-10 Days (Orange - Approaching Critical Timeframe)' ) from Account where FRB_Firm_Check__c = TRUE];        if(lstAccount2.size()&gt;0){           for( Account acc : lstAccount2 )           {               List&lt;Process_Adherence_Monitoring__c&gt; lstCont2 = acc.Process_Adherence_Monitoring__r;                acc.Number_of_exceptions_under_7_10_bucket__c= lstCont2.size();               acc.FRB_Firm_Check__c = true;           }           update lstAccount2 ;       }        //To update 11 bucket            lstAccount3 =  [select Id, Name,FRB_Firm_Check__c, Number_of_exceptions_under_11_19_bucket__c,(select id,Account_Standing__c from Process_Adherence_Monitoring__r  where Status__C != 'Closed' AND  recordtypeId =: FRBRecordTypeID AND Account_Standing__c = '11-19 Days (Red - Immediate Correction Required)' ) from Account where FRB_Firm_Check__c = TRUE];        if(lstAccount3.size()&gt;0){           for( Account acc : lstAccount3 )           {               List&lt;Process_Adherence_Monitoring__c&gt; lstCont3 = acc.Process_Adherence_Monitoring__r;                acc.Number_of_exceptions_under_11_19_bucket__c= lstCont3.size();               acc.FRB_Firm_Check__c = true;           }                              update lstAccount3 ;       }      }   }
86201
I was in the process of uninstalling all the Universal Apps from a new Windows 10 installation when I hit a roadblock.  It's not the first time I do this and it always goes well. However, this time, whenever I write in PowerShell Get-AppxPackage -allusers | Remove-AppxPackage or something more specific like Get-AppxPackage -allusers *windowscalculator* | Remove-AppxPackage I get the following message:     Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor. (Exception from HRESULT: 0x80073CFA)   error 0x80070032: AppX Deployment Remove operation on package Microsoft.WindowsCalculator_10.1605.1582.0_x64__8wekyb3d8bbwe from: C:\Program   Files\WindowsApps\Microsoft.WindowsCalculator_10.1605.1582.0_x64__8wekyb3d8bbwe failed.      This app is part of Windows and cannot be uninstalled on a per-user basis. An administrator can attempt   to remove the app from the computer using Turn Windows Features on or off. However, it may not be possible to uninstall the app.      NOTE: For additional information, look for [ActivityId] 75c5fc31-fb20-0001-77fd-c57520fbd101 in the Event Log or use the command line Get-AppxLog -ActivityID   75c5fc31-fb20-0001-77fd-c57520fbd101      At line:1 char:49      + Get-appxpackage -allusers *windowscalculator* | Remove-AppxPackage   +                                                ~~~~~~~~~~~~~~~~~~       + CategoryInfo          : WriteError: (Microsoft.Windo...__8wekyb3d8bbwe:String) [Remove-AppxPackage], IOException       + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand   I'm getting this message for every single app I try to uninstall, including those I know are perfectly uninstallable like the calculator or image viewer, which has never happened before. Powershell is running elevated and everything else works and seems normal. Is there something I can do besides reinstalling Windows?
118291
I’m trying to deploy custom objects, custom fields, page layouts, compact layouts, Lightning pages and Global value set (global picklist) , when uploading changeset it is giving me API version error as out production platform version 46.0 and SB version is 47.0 , I’m not sure how to bring the version down to 46.0 (There are no Apex triggers/classes in the changeset). Any help would be really appreciated.
18854
\documentclass{beamer}  %\usepackage{pstricks,auto-pst-pdf} % works \usepackage[pdf]{pstricks} \usepackage{pst-tree}  \begin{document} \begin{frame}{Test}     \begin{postscript}         $\pstree{\TR{S}}{}$     \end{postscript} \end{frame} \end{document}   I get the following error:  Error: /typecheck in --div-- Operand stack:    1   0   0.0   -0.00706883   a   65781.8 Execution stack:    %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostri ngval--   --nostringval--   false   1   %stopped_push   1926   1   3   %oparray_pop   1925   1   3   %oparray_pop   1909   1   3  %oparray_pop   1803   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   - -nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   --nostringval--   4   --nostringval--  %repeat_continue   --nostringval-- Dictionary stack:    --dict:1169/1684(ro)(G)--   --dict:0/20(G)--   --dict:123/200(L)--   --dict:100/300(L)-- Current allocation mode is local Current file position is 120580 MiKTeX GPL Ghostscript 9.05: Unrecoverable error, exit code 1   I use MiKTeX 2.9 and latest packages in Windows 7.
123171
I am getting an attachment via a Salesforce email service and in the Email service apex class logic, I query the user object by the email from address and set the ContentVersion owner as the user coming from the Query.  I am getting this error while performing this operation.  INVALID_STATUS, Documents in a user's private library must always be owned by that user.: [OwnerId]  Here is my code :  global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {          Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();          //Get users for the incoming email address and also community user         List&lt;User&gt; lstUsersFromCommunity = [SELECT Id                                              FROM User                                              WHERE Profile.UserLicense.Name = 'Partner Community';                                             AND Email =: email.fromAddress];          //Process only if the incoming email address is belongs to a valid community user         if(lstUsersFromCommunity.size() &gt; 0){             //Get the user from the results list             User user = lstUsersFromCommunity.get(0);             try{                 //Create a list of ContentVersion to store new ContentVersion records                 List&lt;ContentVersion&gt; lstVersion = new List&lt;ContentVersion&gt;();                  //Iterate over the incoming email attachments                 for (Messaging.Inboundemail.BinaryAttachment binaryAttachment : email.binaryAttachments) {                     //New ContentVersion record                     ContentVersion newContentVersion = new ContentVersion();                     newContentVersion.versionData = binaryAttachment.body;                     newContentVersion.OwnerId = user.Id;                     newContentVersion.ContentLocation = 'S';                     newContentVersion.SharingOption = 'A';                     newContentVersion.Origin = 'H';                     newContentVersion.title = email.subject;                     newContentVersion.pathOnClient = binaryAttachment.fileName;                     lstVersion.Add(newContentVersion);                 }                 insert lstVersion;             }catch(Exception ex){                 System.debug('### EXCEPTION :  ' + ex.getLineNumber() + ' : ' + ex.getMessage());             }         }else{             //No user in for the from email address         }          return result;     }