• tchrisbaker
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 11
    Replies

I am trying to figure out why there is a large space between the field lavel and the checkbox on my VF page.

 

Here is a screenshot

 

https://www.evernote.com/shard/s80/sh/e37cf2d2-0661-497c-920d-bbb310c20511/bb77f2cd09e8c1b193fd56636187a4f4

 

 

 

Here is the code:

	<apex:pageBlockSectionItem helpText="{!$ObjectType.Professional_Development_Event__c.Fields.Recipient_Opt_Out__c.inlineHelpText}"  >						
						<apex:outputLabel value="Opt-Out?" for="recipientOptOut"/>
						<apex:inputField required="" style="width:80%;" id="recipientOptOut" value="{!pdEvent.Recipient_Opt_Out__c}" > 
						   <apex:actionSupport event="onclick" action="{!optOutChanged}" />
						</apex:inputField> 
					</apex:pageBlockSectionItem>

 

I am populating the Subject field on the Event object via code. Is there any  way to put a line break within that field? I specifically am looking for a line break when viewing the event on the calendar. In the screenshot below, I'd like to seperate Name & Phone on 2 different lines. This popup shows when you hover over the event on the calendar:

 

http://www.evernote.com/shard/s80/sh/19c3ed3f-6ed0-462c-bb4a-94a287f04145/02f66ce51730efd6d6ade16ac6794794

 

I have tried using \n. But that did not work

I have a controller for a page and I intermittantly get an out of bounds error on this line:

pdEvent = pdEventList[0]; 

 

Is there anything I am doing wrong? Since I get the out of bounds error I am assuming my query is sometimes producing 0 results which doesn't make sense since the Id will be in the URL.

 

Also, my VF page is not an embedded page in the UI, it overrides the whole page. So we use 

<apex:detail id="pdEventDetailsSection" subject="{!PD_Event.Id}" inlineEdit="false" 
reRender="pageBlockId" />

 

to show the regular page layout with our custom VF stuff up at the top. Maybe that has something to do with my controller not finding the Id

 

code snippet of my constructor for my apex controller

 public controller_PDEvent(ApexPages.StandardController stdController) {
        system.debug(LoggingLevel.INFO, ' --- begin - controller_PDEvent --- ');
        isSelectedActivePartnerPortalUsersRendered = false ;
        isSaveRendered = false ;
       
         Professional_Development_Event__c [] pdEventList = [ 
         	SELECT Id, Training_Location_Name__c, Training_Site_Room__c, Recipient_Group__c, Training_Location_Street__c, Training_Location_State__c ,  Training_Location_City__c , Training_Location_Zip__c , Training_Site__c 
         	FROM Professional_Development_Event__c 
         	WHERE Id = :stdController.getId() 
		];
		
		pdEvent = pdEventList[0]; 

 

I have an Apex class exposed as a web service. When our Cold Fusion based website calls this service, they get the following error:

 

Error: I/O Exception: Name in certificate 'na14.salesForce.com' does not match host name 'na14-api.salesForce.com'

 

It seems to me that SF has a certificate for na14.salesforce.com but not na14-api.salesforce.com. However the Sandbox had a certificate for cs9-api.salesforce.com and for cs9.salesforce.com

 

I have more details here:

https://www.evernote.com/shard/s80/sh/6e58fc8a-10f4-4b26-a4b9-a623947475fa/51a866d1a1e87bacb7a69962063747f1?noteKey=51a866d1a1e87bacb7a69962063747f1&noteGuid=6e58fc8a-10f4-4b26-a4b9-a623947475fa

 

Has anyone ran into this problem before?

 

Thanks,

Chris

I wrote an Apex Web Service which is going to get called from a web site running on Cold Fusion. The web developer was saying that typically to call a service he would be given a URL to the WSDL and it would return an object with all the methods for that service.

 

I don't see how to do this in Salesforce. Should we take the WSDL and save it on the web server that's calling it? Also, he has the Enterprise WSDL so should he save that to the server too? He could then use that to login and get his session ID. Then supply the session ID to my Apex web service? I looked for documentation on how to call an Apex web service but I am only finding information about how to call out from Salesforce. 

 

Thanks,

Chris

We have a custom object which has an embedded VF Page on it. This object is available on Customer Portal. When one of the buttons is pressed by the CP user, an email should go out. When I am logged into SF (not customer portal), this button works fine. However, when I am logged into Customer Portal the email does not work. The email is sent using Apex code. 

 

Is there something special I have to do to email someone from within the CP. 

 

public void sendDeclineEmail() {
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { 
            composeSingleEmailMessage(
                'tchrisbaker@gmail.com', null, null, 
                null, 'Test', 
                'test', 'test'
            )
        });
    }

 

 

 

private static Messaging.SingleEmailMessage composeSingleEmailMessage(
            string toAddress, string ccAddress, string replyToEmail, 
            string senderDisplayName, string subject, 
            string plainTextBody, string htmlBody
    ) {
        // Now create a new single email message object 
        // that will send out a single email to the addresses in the To, CC & BCC list. 
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        if(!DI_Helper.isValidEmail(toAddress)) {
            return mail;
        }
        
        // First, reserve email capacity for the current Apex transaction to ensure 
        // that we won't exceed our daily email limits when sending email after 
        // the current transaction is committed.
        integer numberOfEmails = 1;
        if(DI_Helper.isValidEmail(ccAddress)) {
            numberOfEmails++;
        }
        Messaging.reserveSingleEmailCapacity(numberOfEmails);
        
        // Processes and actions involved in the Apex transaction occur next, 
        // which conclude with sending a single email. 
        
        
        // Strings to hold the email addresses to which you are sending the email. 
        String[] toAddresses = new String[] {toAddress}; 
        String[] ccAddresses;
        if(numberOfEmails > 1) {
            ccAddresses = new String[] {ccAddress};
        }
          
        // Assign the addresses for the To and CC lists to the mail object. 
        mail.setToAddresses(toAddresses);
        mail.setCcAddresses(ccAddresses);
        
        // Specify the address used when the recipients reply to the email.  
        if(DI_Helper.isValidEmail(replyToEmail)) {
            mail.setReplyTo(replyToEmail);
        }
        
        // Specify the name used as the display name. 
        if(senderDisplayName != null && senderDisplayName.length() > 0) {
            mail.setSenderDisplayName(senderDisplayName);
        }
        
        // Specify the subject line for your email address.
        if(subject != null && subject.length() > 0) {
            mail.setSubject(subject);
        }
        
        // Set to True if you want to BCC yourself on the email. 
        //mail.setBccSender(false);
        
        // Optionally append the salesforce.com email signature to the email. 
        // The email address of the user executing the Apex Code will be used. 
        //mail.setUseSignature(false);
        
        // Specify the text content of the email.
        if(plainTextBody != null && plainTextBody.length() > 0) {
            mail.setPlainTextBody(plainTextBody);
        }
        if(htmlBody != null && htmlBody.length() > 0) {
            mail.setHtmlBody(htmlBody);
        }
        
        return mail;
    }

 

I am trying to figure out why there is a large space between the field lavel and the checkbox on my VF page.

 

Here is a screenshot

 

https://www.evernote.com/shard/s80/sh/e37cf2d2-0661-497c-920d-bbb310c20511/bb77f2cd09e8c1b193fd56636187a4f4

 

 

 

Here is the code:

	<apex:pageBlockSectionItem helpText="{!$ObjectType.Professional_Development_Event__c.Fields.Recipient_Opt_Out__c.inlineHelpText}"  >						
						<apex:outputLabel value="Opt-Out?" for="recipientOptOut"/>
						<apex:inputField required="" style="width:80%;" id="recipientOptOut" value="{!pdEvent.Recipient_Opt_Out__c}" > 
						   <apex:actionSupport event="onclick" action="{!optOutChanged}" />
						</apex:inputField> 
					</apex:pageBlockSectionItem>

 

I have a controller for a page and I intermittantly get an out of bounds error on this line:

pdEvent = pdEventList[0]; 

 

Is there anything I am doing wrong? Since I get the out of bounds error I am assuming my query is sometimes producing 0 results which doesn't make sense since the Id will be in the URL.

 

Also, my VF page is not an embedded page in the UI, it overrides the whole page. So we use 

<apex:detail id="pdEventDetailsSection" subject="{!PD_Event.Id}" inlineEdit="false" 
reRender="pageBlockId" />

 

to show the regular page layout with our custom VF stuff up at the top. Maybe that has something to do with my controller not finding the Id

 

code snippet of my constructor for my apex controller

 public controller_PDEvent(ApexPages.StandardController stdController) {
        system.debug(LoggingLevel.INFO, ' --- begin - controller_PDEvent --- ');
        isSelectedActivePartnerPortalUsersRendered = false ;
        isSaveRendered = false ;
       
         Professional_Development_Event__c [] pdEventList = [ 
         	SELECT Id, Training_Location_Name__c, Training_Site_Room__c, Recipient_Group__c, Training_Location_Street__c, Training_Location_State__c ,  Training_Location_City__c , Training_Location_Zip__c , Training_Site__c 
         	FROM Professional_Development_Event__c 
         	WHERE Id = :stdController.getId() 
		];
		
		pdEvent = pdEventList[0]; 

 

I wrote an Apex Web Service which is going to get called from a web site running on Cold Fusion. The web developer was saying that typically to call a service he would be given a URL to the WSDL and it would return an object with all the methods for that service.

 

I don't see how to do this in Salesforce. Should we take the WSDL and save it on the web server that's calling it? Also, he has the Enterprise WSDL so should he save that to the server too? He could then use that to login and get his session ID. Then supply the session ID to my Apex web service? I looked for documentation on how to call an Apex web service but I am only finding information about how to call out from Salesforce. 

 

Thanks,

Chris

I'm trying to write a Trigger that will automatically populate a lookup field with the Partner User's account when the partner creates a new record in a custom object. The Trigger I tried is thus:

 

trigger UpdateAccountName on Change_Request__c (after update) {
    for(Change_Request__c a : Trigger.old)
{a.Customer_Name__c = a.CreatedBy.Contact.AccountID; }
}

 I've tried various combinations of "old" and "new" and "before", "after", "update" and "insert", but I either get the error message below, when attempting to actually utilise the Trigger (there are no compiling errors), or the Trigger simply does nothing, but with no error message. Can anyone offer any guidance? Thanks!

 

Apex trigger UpdateAccountName caused an unexpected exception, contact your administrator: UpdateAccountName: execution of AfterUpdate caused by: System.FinalException: Record is read-only: Trigger.UpdateAccountName: line 8, column 1

We have a custom object which has an embedded VF Page on it. This object is available on Customer Portal. When one of the buttons is pressed by the CP user, an email should go out. When I am logged into SF (not customer portal), this button works fine. However, when I am logged into Customer Portal the email does not work. The email is sent using Apex code. 

 

Is there something special I have to do to email someone from within the CP. 

 

public void sendDeclineEmail() {
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { 
            composeSingleEmailMessage(
                'tchrisbaker@gmail.com', null, null, 
                null, 'Test', 
                'test', 'test'
            )
        });
    }

 

 

 

private static Messaging.SingleEmailMessage composeSingleEmailMessage(
            string toAddress, string ccAddress, string replyToEmail, 
            string senderDisplayName, string subject, 
            string plainTextBody, string htmlBody
    ) {
        // Now create a new single email message object 
        // that will send out a single email to the addresses in the To, CC & BCC list. 
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        if(!DI_Helper.isValidEmail(toAddress)) {
            return mail;
        }
        
        // First, reserve email capacity for the current Apex transaction to ensure 
        // that we won't exceed our daily email limits when sending email after 
        // the current transaction is committed.
        integer numberOfEmails = 1;
        if(DI_Helper.isValidEmail(ccAddress)) {
            numberOfEmails++;
        }
        Messaging.reserveSingleEmailCapacity(numberOfEmails);
        
        // Processes and actions involved in the Apex transaction occur next, 
        // which conclude with sending a single email. 
        
        
        // Strings to hold the email addresses to which you are sending the email. 
        String[] toAddresses = new String[] {toAddress}; 
        String[] ccAddresses;
        if(numberOfEmails > 1) {
            ccAddresses = new String[] {ccAddress};
        }
          
        // Assign the addresses for the To and CC lists to the mail object. 
        mail.setToAddresses(toAddresses);
        mail.setCcAddresses(ccAddresses);
        
        // Specify the address used when the recipients reply to the email.  
        if(DI_Helper.isValidEmail(replyToEmail)) {
            mail.setReplyTo(replyToEmail);
        }
        
        // Specify the name used as the display name. 
        if(senderDisplayName != null && senderDisplayName.length() > 0) {
            mail.setSenderDisplayName(senderDisplayName);
        }
        
        // Specify the subject line for your email address.
        if(subject != null && subject.length() > 0) {
            mail.setSubject(subject);
        }
        
        // Set to True if you want to BCC yourself on the email. 
        //mail.setBccSender(false);
        
        // Optionally append the salesforce.com email signature to the email. 
        // The email address of the user executing the Apex Code will be used. 
        //mail.setUseSignature(false);
        
        // Specify the text content of the email.
        if(plainTextBody != null && plainTextBody.length() > 0) {
            mail.setPlainTextBody(plainTextBody);
        }
        if(htmlBody != null && htmlBody.length() > 0) {
            mail.setHtmlBody(htmlBody);
        }
        
        return mail;
    }

 

How to get server url and session id in apex class - i can not use visual force page to get that one.

 

your help is appreciated..