• augiewaz
  • NEWBIE
  • 25 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 12
    Replies

Hi,


I have been working on something all day where an outputPanel gets rendered on a page after a user does a search.
For some reason and I cannot work out why, a hidden outputPanel does not render after a user clicks on a commandButton.

 

Below is my code. I have taken things out which are not neccessary

 

Any help would be appreciated.

 

Thanks
Warren

 

<apex:page sidebar="false" showHeader="false" controller="SearchProjectsController">
   <apex:form id="form"> 
      <apex:commandButton value="Search Projects" action="{!searchProjects}" reRender="projectList" />
      <apex:outputPanel id="projectList" rendered="{!doneSearch}">
         OPEN PROJECTS
      </apex:outputPanel>
   </apex:form>
</apex:page>


public class SearchProjectsController {

   public boolean doneSearch {get; set;}

   public SearchProjectsController() {
      doneSearch = false;
   }

   public PageReference searchProjects() {
      doneSearch = true;
      projects = [SELECT Id, Name, Title__c FROM Project__c];
      return null;
   }
}

 

Hi,

 

The company I work for wants to create an online shopping tool/order form and the suggestion is currently to use the Salesforce Customer Portal or perhaps the Sites section.

 

Ideally, the order itself would go into Salesforce as a Opportunity or Quote and the products as line items to one of those objects. However, we are 99% certain that its not possible for a portal/authenticated site user to access these objects (even via an Apex script) since portal/site profiles do not provide access to these objects. Our current thought of a workaround is to simply duplicate the objects so we have our own custom versions of them. Even though this would work, it seems a bit odd that we are creating custom objects for something that Salesforce provides for you as standard. 

 

If anyone has any suggestions or tips on how to go around this, we would love to hear them.

 

Thanks

Warren

Hi,

 

I'm trying to implement a Visualforce page that is to be used on Customer Portals that is used by Contact to enter a new Order.

 

Where I am getting stuck is how to implement a Lookup field that will list the Products that the Contact is able to order. Not sure whether to reference the PriceBookEntry table or Product2 or is it best to run a query to only get entries linked to the right pricebookentry, etc.

 

For the Accounts/Contacts with portal access, there are different price books (though each Account is tied to only one price book).which they have access to but ideally also, the lookup field should bring in only the Products (and prices) that are linked to their specific price book.

 

Any help would be appreciated.

 

Thanks

Warren

Hello All,

 

I am writing a Java program that gets information from a database and will upload that information into Salesforce.

 

I have placed the Ids of the Accounts from the database into an Array and I want to query the Accounts object in Salesforce to get me the Account objects from Salesforce where there is a match found in the Array of Ids.

 

I have a query that reads something like this:

String[] accIds = new String[x];

binding.query("SELECT Id, Name, databaseId FROM Account WHERE databaseId IN " + accIds);

 

I am getting stuck with the query as I'm not 100% sure how to do it properly and I cannot find any information on how this should be done.

 

Any help is highly appreciated.

 

Thanks in advance!

Warren

Hi All,

 

I have a trigger that runs to verify an account can be deleted before it is actually deleted. If it can be deleted, that is ok. If the Account cannot be deleted, the trigger changes the Account Owner to a dummy user so the data is not lost but the Account cannot be seen by standard users.

 

Should the Account Owner change, what I would like is for the trigger to re-direct the user to the Home Page of Salesforce. At present, the user then sees the Account (Account Owner has changed and all) but I would like it to look like the Account has been deleted.

 

I have tried this with the PageReference class in my trigger but it does not seem to be working. 

 

Any ideas??

 

Thanks

Warren

Hi,

 

 

I have created an email template that generates a PDF document. The document gets data from an Object record which contains a Long Text field. Because of this field, it is impossible to know just how many pages the PDF document will be.

 

What I would like to do is have a way that for every page within the PDF document, the company logo appears in the background in the top left corner as well as another image appearing in the bottom right corner.

 

Does anyone know if something like this is possible? I am struggling to come up with a solution to this problem.

 

Thanks in advance

Warren

Has anyone had this issue before?

 

I have created some VisualForce pages in sandbox and I want to create a custom button for one of the pages.

 

I have gone to the object and page to create a custom button. I then specify 'Visualforce page' as the Content Source. However, the Content drop down list appears blank even though there are Visualforce pages available.

 

In case anyone is wondering, I am using IE 7.0 and the Enterprise version of Salesforce.

 

Does anyone know how to get this sorted?

 

Thanks

Warren

Hi,

 

If for example a user enters the following into the Description field on an Events object:

Agenda Note 1

Agenda Note 2

Agenda Note 3

 

I have created a pdf with Visualforce and I want the Description field to output the data as shown above. However, it appears like this:

Agenda Note 1 Agenda Note 2 Agenda Note 3

 

Does anyone know how to get around this (if its possible at all)?

 

Here is my code:

 

<apex:pageBlock title="Meeting Information" mode="edit" > <apex:pageBlockTable title="Bi-Weekly Meetings" value="{!events}" var="e" columns="1" width="95%" > <apex:column> <b>Meeting Date</b><br />{!e.StartDateTime} (Duration: {!e.DurationInMinutes} minutes)<br /> <p><b>Meeting Agenda</b><br />{!e.Description}</p> <p><hr width="100%" /></p> </apex:column> </apex:pageBlockTable> </apex:pageBlock>

 

Thanks in advance

Warren

 

Message Edited by augiewaz on 04-03-2009 06:24 AM

Hi,

 

I have a quick question.

 

If the Security Settings for Activities is set to 'Controlled by Parent' and an activity is tied to a Lead, do the Sharing Rules for a Lead get used for the activity?

 

This is what I would have thought be the case but it does not appear to be.

 

Thanks

Warren

Hi,

 

I am trying to create a test method for a trigger/apex class I have created on Event records

 

In the test method, when I have an Event that is an All Day Event, I am getting a FIELD_CUSTOM_VALIDATION_EXCEPTION error when trying to set the StartDateTime and EndDateTime.

 

The exact error message is:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, startTime: 2009-02-09 00:00:00

 

Here is a snippet of the code where the issue lies:

Event e = new Event(RecordTypeId=eventRecType.Id, Type='Other'); Date today = Date.today(); e.OwnerId = nonSrcMngUsers[0].Id; e.IsAllDayEvent = true; e.StartDateTime = DateTime.now(); e.EndDateTime = DateTime.now();

 

I have also tried things like this but without any luck:

 

e.StartDateTime = DateTime.valueOf(today + ' 00:00:00'); e.EndDateTime = DateTime.valueOf(today+1 + ' 00:00:00'); e.StartDateTime = DateTime.valueOf(today + ' 00:00:00'); e.EndDateTime = DateTime.valueOf(today + ' 23:59:59');

 

I actually do need to have values in these fields as I am testing them in my apex class and they cannot have a null value.

 

Any suggestions????

 

Thanks in advance

Warren

Hi,
 
I have created a customer portal in my developer account.
 
When I am logged in as the Contact from the account, I click on the Account tab and I get an Insufficient Priviledges message.
I am using the standard Customer Portal Profile and I cannot understand why this is happening.
 
Any suggestions????
 
Thanks in advance
Warren
We have a setup where there is a custom object called Competitor.
On our Opportunity page, we have a lookup table field called Primary Competitor (a required field) to the Competitor object called Primary Competitor.
 
I have written a trigger on the Opportunity object that does some evaluations when an Opportunity is inserted/updated.
 
I wrote up a test method to test the trigger. However, I get the following error:
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id
 
 
Basically, this is the code of the test method:
Integer size = 5;
List<Opportunity> opp = new List<Opportunity>();
for (Integer i = 0; i < size; i++)  {
   Opportunity o = new Opportunity();
   o.ownerId = '00530000000kFvU';
   o.name = 'Opportunity Test: ' + i;
   o.Primary_Competitor__c = 'a1K50000000Caz4EAC';
   o.accountId = '0015000000L3FPk';
   o.closeDate = System.today() + 150;
   o.stageName = 'Quotation';
   opp.add(o);
}
insert opp; 
 
When I run the test method I get the error listed above. If I comment out the line that adds the Primary Competitor to the Opportunity, then I do not have the error.
 
I've been looking around as to why the error is happening but I'm not having any luck in solving it. Any advice would be appreciated.
 
Thanks in advance
Warren
Hi,
 
I am running the following sql statement in my Apex code. However, it is not working correctly.
The issue is that the SQL statement is not returning account records where the name of the account contains the term 'new'
However, if I was to just have a string (WHERE name LIKE '%new%'), it does retrieve account records where at least the word "new" appears in the account name.
 
String accName = 'New'
List<Account> acc = [SELECT id, name FROM Account WHERE name LIKE :accName]; // only returns accounts if the name matches 100%
List<Account> acc = [SELECT id, name FROM Account WHERE name LIKE '%new%']; // returns any accounts where the name contains the word 'new'
 
Any help on this is appreciated. From what I understand, how I have written the SQL statement is correct. Its just not doing what it is supposed to do.
 
Thanks
Warren

Hi guys

 

Hope someone can help me here.  I read from a few places the steps I have carried out are not wrong but I somehow got a list of over 100 error messages when I'm trying to:

 

File -> New -> Project -> Android -> Android Project from Existing Code

and root directory in the "Import Projects" was set to

C:\King\Salesforce\SalesforceMobileSDK-Android\native\TemplateApp

 

and I checked the "Copy projects into workspace".

 

The following is  a list of some errors I got.  I thought I have followed this page:

http://wiki.developerforce.com/page/Getting_Started_with_the_Mobile_SDK_for_Android

 

but I just couldn't escape the errors.  What have I done wrong?  This is a list of all my configurations:

Java SDK7u9

Android SDK r20.0.3

Salesforce Mobile SDK for Android (I used GitHub to clone, and which I cscript install.vbs afterwards)

Eclipse 3.6.2

and I also installed the ADT Plugin,

and I also used Android SDK Manager to include API8 and API11.

 

Anyone have any ideas?  Many many thanks.

 

 

Description Resource Path Location Type
AsyncRequestCallback cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 174 Java Problem
ClientManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 100 Java Problem
ClientManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 100 Java Problem
Encryptor cannot be resolved TemplateApp.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 50 Java Problem
error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/sf__icon'). AndroidManifest.xml /com.salesforce.samples.templateapp.MainActivity line 8 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'resource' with value '@xml/authenticator'). AndroidManifest.xml /com.salesforce.samples.templateapp.MainActivity line 19 Android AAPT Problem
EventsObservable cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 73 Java Problem
EventsObservable cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 115 Java Problem
EventType cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 73 Java Problem
EventType cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 115 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 67 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 91 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 94 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 104 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 139 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 191 Java Problem
ForceApp cannot be resolved to a type TemplateApp.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 39 Java Problem
LoginOptions cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 92 Java Problem
LoginOptions cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 92 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 58 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 67 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 88 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 123 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 128 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 70 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 81 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 85 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 95 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 96 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 112 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 172 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 38 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 39 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 40 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 41 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 42 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 43 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 44 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 45 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 46 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 47 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 48 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 49 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 50 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 51 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 52 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 53 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 55 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 56 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 57 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 58 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 59 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 60 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 61 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 62 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 63 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 64 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 65 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 66 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 67 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 68 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 69 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 71 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 72 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 73 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 74 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 75 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 76 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 77 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 78 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 79 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 80 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 81 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 82 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 83 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 84 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 85 Java Problem

Hi,


I have been working on something all day where an outputPanel gets rendered on a page after a user does a search.
For some reason and I cannot work out why, a hidden outputPanel does not render after a user clicks on a commandButton.

 

Below is my code. I have taken things out which are not neccessary

 

Any help would be appreciated.

 

Thanks
Warren

 

<apex:page sidebar="false" showHeader="false" controller="SearchProjectsController">
   <apex:form id="form"> 
      <apex:commandButton value="Search Projects" action="{!searchProjects}" reRender="projectList" />
      <apex:outputPanel id="projectList" rendered="{!doneSearch}">
         OPEN PROJECTS
      </apex:outputPanel>
   </apex:form>
</apex:page>


public class SearchProjectsController {

   public boolean doneSearch {get; set;}

   public SearchProjectsController() {
      doneSearch = false;
   }

   public PageReference searchProjects() {
      doneSearch = true;
      projects = [SELECT Id, Name, Title__c FROM Project__c];
      return null;
   }
}

 

Has anyone had this issue before?

 

I have created some VisualForce pages in sandbox and I want to create a custom button for one of the pages.

 

I have gone to the object and page to create a custom button. I then specify 'Visualforce page' as the Content Source. However, the Content drop down list appears blank even though there are Visualforce pages available.

 

In case anyone is wondering, I am using IE 7.0 and the Enterprise version of Salesforce.

 

Does anyone know how to get this sorted?

 

Thanks

Warren

Hi,

 

If for example a user enters the following into the Description field on an Events object:

Agenda Note 1

Agenda Note 2

Agenda Note 3

 

I have created a pdf with Visualforce and I want the Description field to output the data as shown above. However, it appears like this:

Agenda Note 1 Agenda Note 2 Agenda Note 3

 

Does anyone know how to get around this (if its possible at all)?

 

Here is my code:

 

<apex:pageBlock title="Meeting Information" mode="edit" > <apex:pageBlockTable title="Bi-Weekly Meetings" value="{!events}" var="e" columns="1" width="95%" > <apex:column> <b>Meeting Date</b><br />{!e.StartDateTime} (Duration: {!e.DurationInMinutes} minutes)<br /> <p><b>Meeting Agenda</b><br />{!e.Description}</p> <p><hr width="100%" /></p> </apex:column> </apex:pageBlockTable> </apex:pageBlock>

 

Thanks in advance

Warren

 

Message Edited by augiewaz on 04-03-2009 06:24 AM

Hi,

 

I am trying to create a test method for a trigger/apex class I have created on Event records

 

In the test method, when I have an Event that is an All Day Event, I am getting a FIELD_CUSTOM_VALIDATION_EXCEPTION error when trying to set the StartDateTime and EndDateTime.

 

The exact error message is:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, startTime: 2009-02-09 00:00:00

 

Here is a snippet of the code where the issue lies:

Event e = new Event(RecordTypeId=eventRecType.Id, Type='Other'); Date today = Date.today(); e.OwnerId = nonSrcMngUsers[0].Id; e.IsAllDayEvent = true; e.StartDateTime = DateTime.now(); e.EndDateTime = DateTime.now();

 

I have also tried things like this but without any luck:

 

e.StartDateTime = DateTime.valueOf(today + ' 00:00:00'); e.EndDateTime = DateTime.valueOf(today+1 + ' 00:00:00'); e.StartDateTime = DateTime.valueOf(today + ' 00:00:00'); e.EndDateTime = DateTime.valueOf(today + ' 23:59:59');

 

I actually do need to have values in these fields as I am testing them in my apex class and they cannot have a null value.

 

Any suggestions????

 

Thanks in advance

Warren

We have a setup where there is a custom object called Competitor.
On our Opportunity page, we have a lookup table field called Primary Competitor (a required field) to the Competitor object called Primary Competitor.
 
I have written a trigger on the Opportunity object that does some evaluations when an Opportunity is inserted/updated.
 
I wrote up a test method to test the trigger. However, I get the following error:
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id
 
 
Basically, this is the code of the test method:
Integer size = 5;
List<Opportunity> opp = new List<Opportunity>();
for (Integer i = 0; i < size; i++)  {
   Opportunity o = new Opportunity();
   o.ownerId = '00530000000kFvU';
   o.name = 'Opportunity Test: ' + i;
   o.Primary_Competitor__c = 'a1K50000000Caz4EAC';
   o.accountId = '0015000000L3FPk';
   o.closeDate = System.today() + 150;
   o.stageName = 'Quotation';
   opp.add(o);
}
insert opp; 
 
When I run the test method I get the error listed above. If I comment out the line that adds the Primary Competitor to the Opportunity, then I do not have the error.
 
I've been looking around as to why the error is happening but I'm not having any luck in solving it. Any advice would be appreciated.
 
Thanks in advance
Warren
Hi,
 
I am running the following sql statement in my Apex code. However, it is not working correctly.
The issue is that the SQL statement is not returning account records where the name of the account contains the term 'new'
However, if I was to just have a string (WHERE name LIKE '%new%'), it does retrieve account records where at least the word "new" appears in the account name.
 
String accName = 'New'
List<Account> acc = [SELECT id, name FROM Account WHERE name LIKE :accName]; // only returns accounts if the name matches 100%
List<Account> acc = [SELECT id, name FROM Account WHERE name LIKE '%new%']; // returns any accounts where the name contains the word 'new'
 
Any help on this is appreciated. From what I understand, how I have written the SQL statement is correct. Its just not doing what it is supposed to do.
 
Thanks
Warren