• JustinMcNally21
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies

So the problem im having is when a user on my applicaiton clicks to download a file attached to a chatter post it prompts them to login. is there a way to add the session id or oauth token to the request to allow the file to be served the file to people.

I am trying to set the password of a newly created use via the API, I can create the user fine which returns the ID for the user record but when i run the SOAP call to set the user's password i get an invalid ID error. Any ideas?

 

 

SOAPAction: "setPassword", Content-Type: text/xml;charset=UTF-8
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:wsdl="urn:partner.soap.sforce.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ins0="urn:partner.soap.sforce.com"
 xmlns:ins1="urn:fault.partner.soap.sforce.com" xmlns:ins2="urn:sobject.partner.soap.sforce.com" xmlns:ns1="urn:partner.soap.sforce.com" xmlns:ns2="urn:partner.soap.sforce.com" x
mlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><ns1:SessionHeader><ns2:sessionId>##REDACTED##</ns1:SessionHeader></env:Header><env:Body><ins0:setPassword><ins0:password
 xsi:nil="true"/><wsdl:userID>00530000004pWrD</wsdl:userID></ins0:setPassword></env:Body></env:Envelope>

SOAP response (status 500):
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://w
ww.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>sf:INVALID_ID_FIELD</faultcode><faultstring>INVALID_ID_FIELD: invalid userId</faultstring><detail><sf:I
nvalidIdFault xsi:type="sf:InvalidIdFault"><sf:exceptionCode>INVALID_ID_FIELD</sf:exceptionCode><sf:exceptionMessage>invalid userId</sf:exceptionMessage></sf:InvalidIdFault></det
ail></soapenv:Fault></soapenv:Body></soapenv:Envelope>


Recently I had the most agrevating problem with salesforce yet, hopefull this will help if you have the same:

 

In my case I had a VF Page using a standard controller with an extension that subclasses a virtual class.

 

The Superclass needed to be upgraded from API version 16 to 19 to accomodate making a SOQL call on a Rich Text Area. I upgraded the super class file to API 19.0 and everything compiled, this is when things started to break. After trying to debug the JS and controllers i was going nuts because every time my APEX:Function fired the page was redirected to the Insuffience privleges page, a very misleading error as i check through all the profile and field level security and various other access audits. The error was infact caused by my VF page and subclass still using API Version 16.0 on a hunch I changed them to 19.0 and everything worked as expected. I would plead with salesforce to give better error messages in such situations as their Insufficient Priveleges error is in no way helpful and the Debug Logs returned nothing about the error.

I am trying to set the password of a newly created use via the API, I can create the user fine which returns the ID for the user record but when i run the SOAP call to set the user's password i get an invalid ID error. Any ideas?

 

 

SOAPAction: "setPassword", Content-Type: text/xml;charset=UTF-8
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:wsdl="urn:partner.soap.sforce.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ins0="urn:partner.soap.sforce.com"
 xmlns:ins1="urn:fault.partner.soap.sforce.com" xmlns:ins2="urn:sobject.partner.soap.sforce.com" xmlns:ns1="urn:partner.soap.sforce.com" xmlns:ns2="urn:partner.soap.sforce.com" x
mlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><ns1:SessionHeader><ns2:sessionId>##REDACTED##</ns1:SessionHeader></env:Header><env:Body><ins0:setPassword><ins0:password
 xsi:nil="true"/><wsdl:userID>00530000004pWrD</wsdl:userID></ins0:setPassword></env:Body></env:Envelope>

SOAP response (status 500):
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://w
ww.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>sf:INVALID_ID_FIELD</faultcode><faultstring>INVALID_ID_FIELD: invalid userId</faultstring><detail><sf:I
nvalidIdFault xsi:type="sf:InvalidIdFault"><sf:exceptionCode>INVALID_ID_FIELD</sf:exceptionCode><sf:exceptionMessage>invalid userId</sf:exceptionMessage></sf:InvalidIdFault></det
ail></soapenv:Fault></soapenv:Body></soapenv:Envelope>


What is the appropriate value for the accept attribute on the inputFile standard component? I tried "text/plain", "*.txt" and "txt" but none of that works, the browse dialog always shows all files of all types, IE and FireFox.

  • August 05, 2010
  • Like
  • 0