• angusgrant
  • NEWBIE
  • 160 Points
  • Member since 2009

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

Hi i have a developers account and i want to transfer the entire instances of my

developer account to some other edition like professional edition or group edition

.how can i   do it

Hi I've created a complete custom application using the Salesforceplatform. The only Standard objects that I'm using are Contacts andAccounts. I have had the following user questions and I wouldappreciate some help with?:

 

Can the heading "Messages and Alerts" be removed from the side bar as we will not need this for our application?

 

'CreateNew View' on all objects allows you to create two 'views' with the samename. Can it be changed so each 'view' must have a unique name?

 

First name on contacts object form needs to have a red line around it as it's mandatory can this be done?

 

How can I mark certain address details such as country, city on the Accounts and Contacts object as mandatory also?

 

Account and Contacts home page has links under the heading Tools and Reports that we don't need on there how can I edit these?

 

Thanks for your Time in advance.  :smileyhappy:

I have a fairly stright forward problem, but I'm not sure how I should solve it.  Basically, I need a new custom field on the Campaign table that is a count of the number of leads that have a particular status.  Unfortunately, I can't simply create a Roll-Up Summary field on Campaigns, because it's not the master in a master-detail relationship.  In other words, I need a field on Campaigns that is essentially a count of the number of leads associated with that campaign that have a particular status.  How should I approach this?

 

The one possibility that I can see is that I could add a trigger that fires on insert/update/delete of leads that performs the appropriate SOQL query and updates the associated Campaign record(s); however, this seems a bit round-about, and my have to be done for all Campaign records every time that a Lead record is updated.  Is there a better way to do this?

 

Thanks in advance,

Max

 

I'm trying to design a feature we need that will allow scheduling of various seminars that will have attendees.  I'm thinking of using the existing Event and EventAttendee objects but haven't figure out exaclty what you can do with them. 

 

From the API documentation, it looks like I can't insert record into EventAttendee directrly.

 

I did find that I could create an Event using the Calendar on my home page.  I also did it with a few lines of Apex code.

 

How does one add attendees to an event?  I can't find a way to do it in the application or with code?

 

Is there anywhere where the vanilla out-of-the-box functionality for this sort of built-in functionalty is documented?

 

Hi Every time I run this trigger. I get sent a Apex exception email with the following how do I add an error ?

 

System.Exception: SObject row does not allow errors  

 

trigger EventDuplicateTigger on SBS_Event__c (before insert) {

Set<string> eventnameSet = new Set<string>();

for (SBS_Event__c e : trigger.new){
eventnameSet.add(e.Name);
}

SBS_Event__c[] events = [select id from SBS_Event__c where Name in : eventnameSet];
if (events.size() > 0) {
for(SBS_Event__c e:events){
e.Name.addError('Event cannot be created - Event already exists');
}
}
}

 


Hi I have added a apex controller to my vf page in which I am trying to return a list of a related objects that I am then going to display in the vf page in a apex:datatable. I'm able to create the controller extension no problem but when I view the vf page I get this error:

 

Error: Unknown property 'VisualforceArrayList.Name'

Apex Code:

public class event_session {
private SBS_Event__c sbs_event;


public event_session(ApexPages.StandardController controller) {
this.sbs_event =
(sbs_event__c)controller.getRecord();
}

List<event_sessions__c> event_session = new List<event_sessions__c>();

public List<event_sessions__c> EventSession {
get{
event_session = [Select e.Lecture_Event_Period__c, e.Name from Event_Sessions__c e Where e.SBS_Event__c = :sbs_event.id Order by e.CreatedDate];
return event_session;
}
}




}

 

vf code:
 

//vf fragment<apex:page showHeader="false" standardController="SBS_Event__c" extensions="event_session" > <apex:composition template="StdOCEITemplate" > <apex:define name="pagebody"> <apex:pageBlock title="Event Registration Form"> <apex:form > <table width="100%" border="0" cellspacing="4" cellpadding="0"> <tr> <th width="20%" scope="col">&nbsp;</th> <th width="80%" scope="col">&nbsp;</th> </tr> <tr> <th scope="row" style="">Event:</th> <td style="text-align:left;padding-left:10px;"><strong>{!SBS_Event__c.name}</strong></td> </tr>

 

 

Hello everyone!!

 

My boss asked me if It's possible to install Wordpress (or joomla, drupal...) in Salesforce Sites!!

 

Is it?

 

Thanks in advance!!

Hi I have two custom objects they have a master detail relationship between them.

 

One is called SBS_Event__c the child object Event_session__c.

 

The SBS_Event Object has a date time start date and start date finish date.

 

I also want to add a date time start and finish fields to Event_session__c custom child object.

 

I want the date/time Start date to be populated with the SBS_Event__c start date time by default and likewise for the Finish date.

 

I have tried both creating a custom fomula field that takes the date/time from the SBS_Event object and then sets it as the default value for the date/time field in Event_session__c. But the value never appeares to be populated.

 

I have also tried creating a workflow that checks if the date time field is saved as NULL and then runs a fomula that should populate this field from date Time from SBS_Event__c into the date time field in  Event_session__c.

 

But in my tests this field never gets populated. Please help advise.

First Question:

 I have created a number of new users with a particular profile restricting there access to certain data. Before giving each user a login. I wanted to test logging in as the user. How can this be done it seems from the documentation as if I can only login as the user if they allow me permissions to do so? Surely there is a way of testing each user prior to giving each a login? Please help.

 

Second Question:

How do I change the address contact label names on the Contact object. In the developer account this is set to "mailing street", "mailing zip post code" etc.. however in the enterprise account it is set to "primary street" and "primary zip post code". I wish it to be the "mailing" address not "primary" address. Please advise.  

Message Edited by angusgrant on 07-27-2009 08:35 AM

Im having problems with my apex test method how can i test the following line highligted in red I know the test method is getting into the if statment. i guess what i need to do is test for the existance of a new account? How is this done? I also then need to test the population of this new (database) object account with data? pls advise.

 

 

I dont know if its just me but I found the test mehod documentation very poor. On the apex official documentation site it gives examples of test methods without giving the code that the test methods actually relates too. Pls wake up Salesforce there needs to be better documentation vote for idea

 

thanks for your time

 

Angus

Hi I have written this apex class for a visualforce page which displays a list of Contacts sorted into Alpahabetical order displayed on a (pdf) page. I know that the way that I have written it will probably result in me hitting some of those governor limits. What I really need to do it write one SOQL statment that I then put into one list  that then gets sorted by Surname 1st character and seperated into 26 sepaerate lists. My Apex knowledge is not there yet can somone point me in the right direction? Thanks in advance.

 

current vf page and result:

 

 

current Apex class:



public class attendeecheckinlist2 {
string eventID = System.currentPageReference().getParameters().get('id');


public List<App__c> getApplicant_A() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'A%' Order by a.Applicant__r.Firstname ];
}

public List<App__c> getApplicant_B() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'B%' Order by a.Applicant__r.Firstname ];
}

public List<App__c> getApplicant_C() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'C%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_D() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'D%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_E() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'E%' Order by a.Applicant__r.Firstname ];
}

public List<App__c> getApplicant_F() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'F%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_G() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'G%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_H() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'H%' Order by a.Applicant__r.Firstname ];
}

public List<App__c> getApplicant_I() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'I%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_J() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'J%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_K() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'K%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_L() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'L%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_M() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'M%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_N() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'N%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_O() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'O%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_P() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'P%' Order by a.Applicant__r.Firstname ];
}

public List<App__c> getApplicant_Q() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'Q%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_R() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'R%' Order by a.Applicant__r.Firstname ];
}

public List<App__c> getApplicant_S() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'S%' Order by a.Applicant__r.Firstname ];
}

public List<App__c> getApplicant_T() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'T%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_U() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'U%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_V() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'V%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_W() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'W%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_X() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'X%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_Y() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'Y%' Order by a.Applicant__r.Firstname ];
}
public List<App__c> getApplicant_Z() {
return [Select a.Applicant__c, a.Applicant__r.FirstName, a.Applicant__r.LastName, a.Applicant__r.Salutation from App__c a Where a.SBS_Event__c = :eventID and a.Applicant__r.Lastname like 'Z%' Order by a.Applicant__r.Firstname ];
}

}

 

I have created the following database/object scheme: http://www.gliffy.com/publish/1673148/

 

I am trying to create a dynamic register to allow the marking of attendees(Contacts) as attending or not a given event session for an event.

 

I have writen some SOQL that returns the data that I require and have created a controller that reurns this data as a list.

 

However i have come to an issue when I try to use <apex:checkboxes> to allow the checking of applicants as attending a given event session.  I get an error Invalid selectOptions found. Use SelectOption type in Apex. How can I do this can I combine 2 lists together?

 

Controller Code:

 

public class attendeesbyeventcontroller {

string eventID = System.currentPageReference().getParameters().get('id');
public string eventsessions { get; set;}

public List<App__c> getApplicant() {
return [Select a.name, a.Applicant__r.Email, a.Applicant__r.FirstName, a.Applicant__r.LastName, (Select Attended_Session__c From App_Sessions__r) from App__c a Where a.sbs_event__c = :eventid Limit 40];
}
}

 

 Visualforce:

 

<apex:page controller="attendeesbyeventcontroller" tabStyle="App_Session__c" >
<apex:form >
<apex:pageblock id="thePage">
<apex:pageblocktable value="{!Applicant}" var="AE" id="candidateTable">
<apex:column value="{!AE.Applicant__r.FirstName}"/>
<apex:column value="{!AE.Applicant__r.LastName}"/>
<apex:column value=" {!AE.Applicant__r.Email}" />
<apex:column >
<apex:facet name="header">Event Sessions</apex:facet>
<apex:selectCheckboxes value="{!eventsessions}">
<apex:selectOptions value="{!AE.App_Sessions__r}"/>
</apex:selectCheckboxes>

</apex:column>
</apex:pageblocktable>
</apex:pageblock>

</apex:form>
</apex:page>

 

 

 

 

 My 2nd concern is regarding governor limits on my SOQL query. Can anyone give me an idea on how many records would need to be returned before I would be hitting those governor limits?

 

 

 


 

 

Hi I have this class below that I am trying to write a test method for:

 

// Decare Vars from Querystring
String accountrecordtypeid = ApexPages.currentPage().getParameters().get('AccountRecordTypeID');
String contactrecordtypeid = ApexPages.currentPage().getParameters().get('ContactTypeID');
String eventid = ApexPages.currentPage().getParameters().get('eventID');

/* Retrieve current Event name to be displayed in application form.
We also need to handle the circumstances when no event is returned in which case a */
public SBS_Event__c SelectedEvent{
get{
try {
sbs_event = [select Name from SBS_Event__c where ID = :eventid and Display_on_website__c = True and Event_Start_Date__c > Today limit 1];
}
catch (DmlException de){
System.debug('Data exception:'+ de.getMessage());
return null;
}
catch (Exception e) {
System.debug('General exception:'+ e.getMessage());
}
return sbs_event;
}

private set;}

 

 For some reason I cant return any rows from the SOQL marked in red above.

 

This is my test method in which I am passing in valid querystring paramters

 

//select random events to test Note there Must be an event in the system ApexPages.currentPage().getParameters().put('AccountRecordTypeID',[Select ID from RecordType Where SobjectType = 'Account' Limit 1].id); ApexPages.currentPage().getParameters().put('ContactTypeID',[Select ID from RecordType Where SobjectType = 'Contact' Limit 1].id); ApexPages.currentPage().getParameters().put('eventID',[select id from SBS_Event__c Where Display_on_website__c = True and Event_Start_Date__c > Today Limit 1].id); SBS_Event__c SBSEvent = extension.SelectedEvent; extension.picklistValue = '0';

 

 

 

 

see error log below:

 

 

20090613120908.297:Class.appExtensionTestClass.testappExtension: line 15, column 74: SOQL query with 1 row finished in 5 ms
20090613120908.297:Class.appExtensionTestClass.testappExtension: line 16, column 68: SOQL query with 1 row finished in 2 ms
20090613120908.297:Class.appExtensionTestClass.testappExtension: line 17, column 62: SOQL query with 1 row finished in 4 ms
20090613120908.297:Class.appExtension: line 38, column 18: SOQL query with 0 rows finished in 2 ms
20090613120908.297:Class.appExtension: line 45, column 4: General exception:List has no rows for assignment to SObject

 

If I cut and paste the IDs passed through the page to the actual form it works perfectly.

Any ideas?

How can i convert the firstname and Lastname first character to uppercase?

Sorry I am not a Java coder so am not sure how this is done.

Nomal behaviour in vf tables is to display one object per row of a table, with your desired fields as columns.

I'm trying to create a page where only one field per object is shown but they are displayed horizontally.

 

<apex:dataTable id="teamtable" value="{!MyTeam}" var="person">
  <apex:column > <apex:image url="{!person.Photo_URL__c}" height="150" width="200" /> </apex:column>
  <apex:column > <apex:outputText value="{!person.Name__c}" /> </apex:column>
</apex:dataTable>

 

So this is displaying all the team members vertically with a lot of white space on the right. Ideally I'd like to have 4 or 5 team members photos on a line each with their name underneath. Is this possible in VF ?

 

It would be great to use the SF cloud for website data and forgo the local DB completely. Is this a recommended approach? Are slow responses or timeouts ever an issue?

 

Thanks.

 

- James 

I wrote the following Visualforce page to be used on our asset object.  It works as designed, but the records that are retruned are in a random order.  So two questions in reguard to this;

  • First, what determines the sort order of the dataTable tag?
  • Second, is there an attribute or command that I can use to specify which field is used to sort the data in the dataTable?

 

 

 <apex: page standardController="Company_Asset__c" standardStylesheets="true" standardStylesheets="true">

   <apex:dataTable value="{!Company_Asset__c.Loaner_Instruments__r}" var="LDI"  
         style="font-family:Arial,helvetica,sans-serif" style="font-size:11px" bgcolor="#F3F3fC" >
         

         <apex:column width="25"  rendered="{!Company_Asset__c.Loaner__c}" >
         </apex:column>
         <apex:column width="85"  rendered="{!Company_Asset__c.Loaner__c}" >{!LDI.Name} </apex:column>
         <apex:column width="60"  rendered="{!Company_Asset__c.Loaner__c}" style="color:red" >

                 <b>Status:</b> 

         </apex:column>
         <apex:column width="150" rendered="{!Company_Asset__c.Loaner__c}">
                   {!IF(Contains(LDI.Instrument_Status__c,"flag_red.gif" ), "Checked Out   "  ,"Checked In   " )}
         </apex:column>
         <apex:column width="150" rendered="{!Company_Asset__c.Loaner__c}" >

                  <b>Loaner Returned Date:</b>   

         </apex:column>
         <apex:column width="150" value="{!LDI.Loaner_Returned_Date__c}"

                     rendered="{!Company_Asset__c.Loaner__c}">
         </apex:column>
         <apex:column width="120" rendered="{!Company_Asset__c.Loaner__c}" style="color:green">

                    <b>Trade Show Ready:</b>
         </apex:column>
         <apex:column width="15" value="{!LDI.Inspected__c}" rendered="{!Company_Asset__c.Loaner__c}">
         </apex:column>
         <apex:column width="100"  rendered="{!Company_Asset__c.Loaner__c}">
         </apex:column>
    </apex:dataTable>
</apex: page>

 

Any help would be appreciated.