• fgwarb_dev
  • 30 Points
  • Member since 2010
  • Salesforce.com Developer

  • Chatter
  • 1
    Best Answers
  • 0
    Likes Received
  • 4
    Likes Given
  • 6
  • 51
I'm trying to log the fact that a file has been downloaded out of a Salesforce Content Library.  This has been working for awhile, but one of our testers just managed to make it throw the error in the title "File already uploaded, please change title to proceed".

I can't find this error message documented anywhere, but it seems to occur if you have two contentversion records in the same library with the same name.  This shouldn't be an issue IMO since I was using the update and/or upsert command (upsert was matching against the ID field).

However, following the instruction and changing the title of the document in conjunction with the update call solved the problem.  So, future readers, just do as the error message suggests and change the title. 

We've had this happening for awhile, but it's now just started to spread to other systems.


We have VF buttons that execute Apex actions which result in record creation.  Sometimes (un-reproducably), a user clicking on a button will result on the Apex Action firing multiple times, creating duplicate or triplicate records.


From all of the testing and research that's been done my best guess is that it's a latency/lag issue.  Maybe the browser is POSTing the form until it gets a ACK from Salesforce, and Salesforce is receiving the POSTs but the ACKs aren't making it back to the browser in time???


If you can't tell, I'm grasping at straws.  I've posted no code, because of the time I've personally spent digging through it I've found nothing.  HELP???

We're integrating our portals (Salesforce & External portals) and want to deliver content inside Salesforce to the external portal.


So we've setup SAML SSO to provide a seamless data access.



However, I've just checked to ensure that our users (customer & partner portal users) can still use the traditional login URLs to gain access to the systems and not been able to login.


(a la: https://tapp0.salesforce.com/secur/login_portal.jsp?orgId=xyz&portalId=xyz)


The error returned is "Your company's Single Sign-On configuration is invalid. Please contact the administrator at your company for more information."


How do we configure Salesforce to allow both SAML login AND "traditional" login?

I'm looking for something like this:





I've got a VisualForce page on tapp0 that when i put <apex:form></apex:form> on it i get our favorite "Insufficient Privileges" error.


Remove the tag and the page renders!


Any insight?

I have a class which is not using the with sharing modifier.


I need to ensure that people aren't enabled to delete opportunities they shouldn't.


All of the people who aren't supposed to delete opportunities share a profile, and the Delete CRUD setting is switched off.



How do I query the CRUD to determine if the current user is enabled to delete an Opportunity?


I know about how to determine current context access to deletion:


 //current context does not permit opportunity deletion.



but since we aren't using the with sharing modifier, this won't work.... Help?


I'm trying to implement a logic for Product Category Status Channel but I'm stuck with this error: ReferenceError: label is not defined at eval.

This is the code I'm developing:

getFilters() {
        var action = initFilters
        var arrExisting = !(this.productsAlreadyInCart === undefined || this.productsAlreadyInCart === null) ? this.productsAlreadyInCart : []
            doInit : true,
            productsAlreadyInCart : JSON.stringify(arrExisting),
            existingFiltersStr : null
        }).then(response => {
            var vals = [
                this.indicatorElements = vals
                this.filterObjs = response.filters
                this.mainObj = response
                this.triggerGetProds = true
                if (localStorage.getItem("showSaveSuccess") != null) {
                    this.showSaveSuccess = true
                    var mainObj = this.mainObj
                    mainObj.messageType = 'success'
                    mainObj.messageToDisplay = label.Saved_Date
                    this.mainObj = mainObj
                console.log('mainObj ', this.mainObj)
            }).catch(response => {
                var errors = response
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        this.showToast(label.ErrorMessage, errors[0].message)
                    this.error = errors
                    console.log('Errors ', this.error)
                } else {
                    this.showToast(label.ErrorMessage, label.UnknownError)

How canI fix it?


Hello All,
I am trying to pass a value from @wire to the connectedCallback
import PRICE_FIELD from '@salesforce/schema/Order__c.Price__c';
@wire(getRecord, { recordId: '$recordId', fields: [PRICE_FIELD] })
I tried this within the connectedcallback but no value
this.priceId = this.record.data ? getFieldValue(this.record.data, PRICE_FIELD) : '';

So process flow is 
  1. @wire
  2. callback
  3. @wire

So at step 3 the @wire gets a value but not a step 1
What am I doing wrong?

Thank you,
Apex Class===

public class LoginController {
    public static String FinalString;
    public static String userEmail;
    Public String UserName{get;set;}
    Public String Password{get;set;}
    Public Boolean IsLoggedIn{get;set;}
    Public String PortalOwnerId{get;set;}
    Public String LogInPlace{get;set;}
    Public Boolean UserNamePasswordMatched{get;set;}
    public String AccountRecordTypeId{get;set;}
    public Account acc{get;set;}
    public String accId{get;set;}
    public Account acc1{get;set;}
    public Account accConfirmPassword{get;set;}
    public Account accIdToChangePassword{get;set;}
    public list<account> accList{get;set;}
    public static list<String> setToAddresses{get;set;}
    public String PortalUserType{get;set;}
    public Boolean isBlankPassword{get;set;}
    public String accIdToGetCurrentPage{get;set;}
     public Boolean isActive{get;set;}
    public LoginController(){
        acc=new Account();
        acc1=new Account();
        accConfirmPassword=new Account();
        accList = new list<account>();
        isBlankPassword = true;
        if(ApexPages.currentPage().getCookies().get('Username') != null && ApexPages.currentPage().getCookies().get('PassWord') != null && ApexPages.currentPage().getCookies().get('Type') != null){
            String CookieUserName=ApexPages.currentPage().getCookies().get('Username').getValue();
            String CookiePassWord=ApexPages.currentPage().getCookies().get('PassWord').getValue();
            Boolean IsVerifiedUser=false;
            for(Account acc:[SELECT Id,Name,User_Name__c,Password__c,Portal_User_Type__c FROM Account WHERE User_Name__c=: CookieUserName AND Password__c=: CookiePassWord AND RecordTypeId=:AccountRecordTypeId]){
                PortalUserType=acc.Portal_User_Type__c ;
                    if(PortalUserType.contains('Pioneer') && !PortalUserType.contains('PathFinder')){
                        Cookie portaltypeStore = new Cookie('Type','Pioneer',null,900,true);
                        ApexPages.currentPage().setCookies(new Cookie[]{portaltypeStore});
                        Cookie portaltypeStore = new Cookie('Type','PathFinder',null,900,true);
                        ApexPages.currentPage().setCookies(new Cookie[]{portaltypeStore});
                Cookie UserStore = new Cookie('Username',acc.User_Name__c,null,900,true);
                Cookie passwordStore = new Cookie('PassWord',acc.Password__c,null,900,true);
                ApexPages.currentPage().setCookies(new Cookie[]{UserStore});
                ApexPages.currentPage().setCookies(new Cookie[]{passwordStore});   
    public Pagereference SubmitPage(){
        if(String.IsNotBlank(UserName) && String.IsNotBlank(PassWord)){
            for(Account acc:[SELECT Id,User_Name__c,Password__c,Portal_User_Type__c,isActivate__c FROM Account WHERE User_Name__c=: UserName AND Password__c=: PassWord AND RecordTypeId=:AccountRecordTypeId]){
                if(acc.Portal_User_Type__c != null && acc.Password__c !=null){
                    UserNamePasswordMatched = true;
                    isActive = true;
                    Cookie UserStore = new Cookie('Username',UserName,null,900,true);
                    Cookie passwordStore = new Cookie('PassWord',PassWord,null,900,true);
                    ApexPages.currentPage().setCookies(new Cookie[]{UserStore});
                    ApexPages.currentPage().setCookies(new Cookie[]{passwordStore});
                    PortalUserType=acc.Portal_User_Type__c ;
                        if(PortalUserType.contains('Pioneer') && !PortalUserType.contains('PathFinder')){
                            Cookie portaltypeStore = new Cookie('Type','Pioneer',null,900,true);
                            ApexPages.currentPage().setCookies(new Cookie[]{portaltypeStore});
                            Cookie portaltypeStore = new Cookie('Type','PathFinder',null,900,true);
                            ApexPages.currentPage().setCookies(new Cookie[]{portaltypeStore});
                        //isActive = true;
                            PageReference pg = new PageReference('/Portal/PathFinderLinksVf');
                                pg = new PageReference(ApexPages.CurrentPage().getParameters().get('retUrl'));
                                return pg; 
                            PageReference pg = new PageReference('/apex/PathFinderLinksVf');
                                pg = new PageReference(ApexPages.CurrentPage().getParameters().get('retUrl'));
                                return pg; 
                        return null;
        return null;
    public PageReference VerifyPassword() {
        System.debug('isLoggedIn:- '+isLoggedIn);
                PageReference pg = new PageReference('/Portal/PathFinderLinksVf');
                return pg; 
                PageReference pg = new PageReference('/apex/PathFinderLinksVf');
                return pg; 
        return null;
I am creating a visualforce email template that needs to include the case thread id in it so end users are able to reply. 

I am reading that I should be using {!Case.Thread_Id} but when I use this, I get the following error: Unknown property 'core.email.template.EmailTemplateComponentController.Case' 

If I change this to {!relatedTo.Thread_Id} then I get Invalid field Thread_Id for SObject Case

Can someone please help me on this?    I would assume if I was using default templates that SalesForce could actually just input the ThreadID for me as it is an option on the Case > Settings options page but since were using custom VF templates, this wont work.


VF Code

---{!subTypeIdToFormId[subType.Id] != subType.Id}---<br />
---{!subTypeIdToFormId[subType.Id]}---<br />
---{!subType.Id}---<br />

 VF Output



Variable definitions:

public map<Id, Id> subTypeIdToFormId {get; set;}
public map<Id, Custom_Object__c[]> typeIdToSubTypes {get; set;}
public Id typeId {get; set;} 

<apex:repeat value="{!typeIdToSubTypes[typeId]}" var="subType" >



Can some one help me on this by explaining the reasons:


Given the following Force.com page markup and assuming the controller and each extension include an action method named “go,” which class method will be invoked when the user clicks on the commandButton?
A. theController
B. ext1
C. ext2
D. ext3



  • July 18, 2013
  • Like
  • 0

The basic question: Is Jitterbit Data Loader for Salesforce a better data loader than Apex Data Loader?

The deciding factors for us would be performance, stability, ease of configuration, and vendor support

I am looking for insight from someone who has used both and would like to get your opinion about which one you prefer and why

This is how we use Apex Data Loader today...
- Bulk Load .csv files into the cloud
- Insert, Update, Upsert, Delete, Export
- Called via Shell script from SSIS

A key feature of the Apex data Loader that makes it work for us today is this:
The ability to edit the "config.properties" file

For example...
We have found it necessary to tweak the following settings on an object by object, operation by operation basis to achieve the required level of performance and still stay within Salesforce API usage metering limits:

Does Jitterbit allow for this same level of configuration?

Thank you in advance for any insight you can offer!

Hi All,


I am creating a SAML assertion for the Salesforce SSO. I used OPEN SAML for creating the assertion.

Used keytool to create the certificates.


I am getting the following error when I validate my SAML response against the SAML validator in Salesforce 


11. Validating the Signature
  Is the response signed? false
  Is the assertion signed? true
  Is the correct certificate supplied in the keyinfo? true
  An exception was thrown on signature validation: java.security.SignatureException: Signature encoding error
  Certificate specified in settings: CN=dev.comityworks.com Expiration: 21 Oct 2012 07:15:05 GMT
  Certificate specified in this assertion: CN=dev.comityworks.com Expiration: 21 Oct 2012 07:15:05 GMT


The SAML Response is below


<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Version="2.0" IssueInstant="2012-07-20T06:5:17.364Z" Destination="https://login.salesforce.com">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">dev.com

<samlp:Status xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<samlp:StatusCode xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"

<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="1234" IssueInstant="2012-07-20T06:5:17.364Z" Version="2.0">


<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#1234">
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>

<saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" >sachin@cloudsquads.com

<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData NotOnOrAfter="2013-07-20T05:23:17.364Z" Recipient="https://login.salesforce.com"/> </saml:SubjectConfirmation>

<saml:Conditions NotBefore="2012-07-20T05:23:17.364Z" NotOnOrAfter="2013-07-20T05:23:17.364Z">





<saml:AuthnStatement AuthnInstant="2012-07-20T06:5:17.364Z" SessionIndex="1234"><saml:AuthnContext><saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef></saml:AuthnContext></saml:AuthnStatement></saml:Assertion></samlp:Response>


Hi All,


Following is the error that i have been facing 

"System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element".

i have the class defined for the element being pointed out in the above error. And also i dont have any invalid types in the wsdl like <s:any .... . So can you please let me know if there are any such  points that needs to be checked?






I've written a test that creates a new user using the system admin profile. I select the proflie with this query in my test 


Profile p = [SELECT Id,Name FROM Profile WHERE Name='System Administrator'];


The problem is that if the running user is not english the profile name is different. So if I change my language setting and run the same test I get List has no rows for assignment to SObject because the Name is now 'Administrador del sistema'. So my question is, how can I select the standard System Administrator profile in my test in a way that is language independent? I thought I might be able to use the license key but the key is the same for all standard profile licenses. 


Thanks for any help!

Is there any way to access Content Workspace Members through the API. I need to get a list of memebers for a specified Workspace.



I've been trying to get a Visualforce page to output a PNG image.  For example, you hit the URL and the picture displays in the browser window.  The content-type setting appears to allow this sort of thing.  For example I was able to output a BMP with code similar to this:


VF page:

<apex:page controller="TileRedirector" contentType="image/bmp"  showHeader="false" sidebar="false">{!Content}</apex:page>



Controller snippet:

public string getContent()


    string content = 'BM:6( ##Ÿˇ';    

    return content;




When I try this with a PNG I get an invalid image.  My current thinking is that the content type for the page is outputs as image/png; charset=UTF-8;


I can force different charset's by adding the charset to my VF page without effect.  I'm reading the image from another source and can successfully view that image from their web site.  The difference is that the content type for those requess always respond as "image/png" without a char set specified.


Has anyone successfully returned a PNG from a VF page before?




Is it something like this?


// every 5 minutes
String sch = '0 5 * * * ? ';


I need to push a single file of size 250MB to Content Folder using the Java API, but while trying to do this I got a error message mentioned below:


<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>Maximum size of request reached. Maximum size of request is 52428800 bytes.</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>


Can someone please help how can I overcome this limitation.  I need this to work as the business requirement.




I am using Apex Data Loader 17.0.

Is there a way to upload data into SFDC using Data Loader without specifying the column names/header in the input csv data file?

This is a knowledge repository sort of posting.  No help is needed.  I put it here because it would have been nice to find it when I was trying to figure out what was happening.


If you're coding Apex in Eclipse and you make a change to an Object via the Salesforce UI and you forget to refresh the Object in your Eclipse workspace, you may get a message with this obscure reference to a MetadataELAdapter which I presume has something with Metadata elements.


In my case I was passing an instance of the object to a constructor of another class.  There may be other circumstances which give rise to this message, but that's what I was trying to do and I couldn't understand why it was failing.  Note, that it compiled fine, and the VF page started up fine, etc.  I ran into this in the Controller constructor where I was pre-loading data.


So, just refreshing the Object in Eclipse clears it all up.  Unclear to me why the state of the Eclipse object should effect code that's being uploaded and then compiled on the server, but...


Either way, I hope this saves someone some time.  Steve.



Has anyone had success in calling Salesforce metadata API functions from Apex code? We tried just simply importing the metadata WSDL using the auto-import functionality, but there was a namespace conflict.

Is this possible? Any suggestions would be most apprecaited. Right now, we're looking at putting java code on a separate webserver to programatically update the metadata of a number of orgs. We'd really like to package some code up that would update it from within the app.

  • January 15, 2009
  • Like
  • 0
Does anyone know of a way to query on the deleted by field?  An example of what I am looking for is:

var queryResult = sforce.connection.queryAll("Select Id, Name, DeletedBy from Lead where IsDeleted = true");
Any ideas?



I have written an inbound email handler service to process data stored in a text file attachment in the email. When I test the functionality by sending the email from my outlook client with the attached text file, the email handler reads the subject matter and body and processes the attached text document correctly.


However when a database application creates the email with a data attachment and sends it to the same salesforce address, the email subject matter and body is read correctly but Salesforce doesnt find any email attachments. No exceptions are being raised. The database application also sends a copy of the email to my email account so I can verify that the attachment is present and correct. When I try to forward the email copy from my outlook client to salesforce, the email handler still dosnt find any attachments. However if I compose a new email from my outlook client and paste the text file attachment from the email copy into the new message and then send that to salesforce, the email handler finds the attachment and processes it .


Has anyone else experienced this problem ?



I am using Apex Data Loader 17.0.

Is there a way to upload data into SFDC using Data Loader without specifying the column names/header in the input csv data file?

Does anyone have any simple ways of decoding quoted-printable emails within an Apex class.


Some emails that we receive are in the form:


 This is a multi-part message in MIME format. ------_=_NextPart_001_01C9D327.CEE8F1C3Content-Type: text/plain;      charset="us-ascii"Content-Transfer-Encoding: quoted-printable 







Some, are not depending on the mail client.


Thanks in advance,



The Inbound Email object doesn't decode MIME-Header encoded subject lines if they use spaces (instead of underscores, as the spec demands).

So this subject line:


Will be received by Email Services and parsed correctly into "My Company™"

But the same subject line is not decoded if it uses a space instead of a _:

=?UTF-8?Q?My Company=E2=84=A2?=

So the Apex code that processes the email is presented with the encoded format, instead of the proper decoded content.

While this is strictly correct behavior per the spec (RFC 2047), it doesn't fit the real world.  In particular, GMail uses spaces instead of underscores ... so any email sent from GMail (or Google Apps) that has an encoded subject line won't be decoded by Email Servies.

Many other RFC 2047 decoders (eg, Perl's Encode::MIME::Header) are tolerant of spaces in the encoded-text.

(Salesforce support - I created case 02325915 to track this issue).

Message Edited by jhart on 12-25-2008 01:05 PM
  • December 25, 2008
  • Like
  • 1