• Ron-LON
  • NEWBIE
  • 55 Points
  • Member since 2006

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 31
    Questions
  • 12
    Replies
I've learned something today about the following query:

Id sysAdminProfileId = [select Id from Profile where Name = 'System Administrator' limit 1].Id;

When this query is run as part of a trigger fired by a user whose language isn't English, the query doesn't return a result.  So how can I get a consistent result to this query no matter what language the user is set to?  I really don't want to hardcode in profile Id's.  I also don't want to put in a million "or" statements.

Thanks!!

Hi,

 

I've got a requirement for Visualforce emails to display Close dates in the email that the end user will understand based on his language.

 

A close date of 03.05.2014 in an email to a German user should show the month component for MAY as "MAI".

 

 

 

So I tried this in a Visualforce page for fun, putting year then month then day:

 

<apex:page standardController="Opportunity" language="de" >
<apex:outputtext value="{0,date,yyyy-MMMM-dd}"> <apex:param value="{!opportunity.CloseDate}" /> </apex:outputtext>

 

This prints the month in English even though the language = "de".  Disappointing but definitely not surprising.

 

To get a close date with the month in words in English, we've accomplished this in the past with a formula field.  

 

 

So I tried replacing this in the same formula with Custom Labels.   

 

CASE(MONTH(CloseDate), 
1, $Label.JAN, 
2, $Label.FEB, 
3, $Label.MAR, 
4, $Label.APR, 
5, $Label.MAY, 
6, $Label.JUN, 
7, $Label.JUL, 
8, $Label.AUG, 
9, $Label.SEP, 
10, $Label.OCT, 
11, $Label.NOV, 
12, $Label.DEC, 
"None") + " " + 
TEXT(DAY(CloseDate)) +" " + 
TEXT(YEAR(CloseDate))

If the page has language="de" it still comes up as English because my user settings are English.  So if this was a VF page to use while logged in, that would have taken care of it.

 

But this is a Visualforce email sent out by Batch Apex so the language of the user sending the batch will be different in most cases to the language of the recipient of the email.  We choose this from a language field on Contact.

 

So any good suggestions for having to do this without getting too clunky in a controller?  Up til now, we have been able to do all of our requirements for this without creating a controller for the Visualforce email. 

 

 

Hi,

 

I would like to put a bit of Visualforce at the top of the Opportunity page layout. 

 

I have two columns of data and I would like these two columns to line up with the columns where all the of the opportunity fields on the page layout are.

 

This is the code I have now:

 

<table>
<tr><td>
<apex:outputPanel rendered="{! NOT(ISBLANK(opp.Cannot_Autorenew_Reason__c))}" >
<img src="/img/msg_icons/error32.png" /> 
</apex:outputPanel>

</td>
<td width="50%">
<apex:dataList value="{!scoreTextLeft}" var="s" >
{!s}
</apex:DataList> 
</td>
<td width="50%">
<apex:dataList value="{!scoreTextRight}" var="s" >
{!s}
</apex:DataList> 
</td>
</tr>
</table>

 

I like the look of the <apex:dataList> as it bulletpoints each item from the list.

 

I've also tried a PageblockTable.  To make it even more difficult, I'd love for each one of these lists to line up with the side of the column on the standard page layout where the data values are, rather than the side where the field labels are.

Hi,

 

I created a visualforce page that I want displayed on the wide area of the homepage.  There are a few posts that suggest the following method as being the way.  So I do the following:

 

1. Go to Setup -> Customize -> Home -> Home Page Components

2. Click New->Choose HTML Area and->Input the Name for your component->Click Next

3. Select show HTML on the right upper hand side and place in the following:

 

<iframe

src="/apex/dateTester?core.apexpages.devmode.url=1"

width="100%" frameborder="0" height="100">

</iframe>

4. Then Click saves.

5. Now go into Setup -> Customize -> Home ->Home Page Layouts ->Click Edit next tothe Layout you would like to configure

Select the component from there

Click Next and order it where you want it to show.

Click Save.

 

It doesn't work for me.  When I go back to look at the new component, I edit it, then I check the box next to "show HTML".

 

And what I put in as this:

 

<iframe src="/apex/dateTester?core.apexpages.devmode.url=1" width="100%" frameborder="0" height="100">
</iframe>

 

 

ends up looking like this when I go back to view it:

 

<iframesrc=" apex="" datetester?core.apexpages.devmode.url="1&quot;width=&quot;100%&quot;" frameborder="0" height="100"></iframesrc=">

 

Why doesn't it work for me like others who have posted on here?

Hi All, 

 

 

Given a status field with values like "cancelled", "pending cancellation" , ... etc

 

I want to write this:

 

Subscription__c[] activeSubs = [select id from subscription__c where status__c not like '%cancel%'];

 

This doesn't work in real life and I'm sure Salesforce.com have some kind of reason for excluding such syntax from SOQL.

 

So does anyone have any suggestions for this other than rewriting my code every time a new status is added?

 

Thanks

Hi,

 

I'm looking to validate software version numbers to ensure they contain only one decimal and can be between

0 and 99.99.

 

At first I thought I could just use a number, but with versioning, 1.3 and 1.30 are different values.

 

I thought this should work:

 

REGEX( Version_Number__c, "(\\d){0,2}(\\.)(\\d){0,2}" )

 

It works for whole numbers, but fails once you add in a decimal point.

 

Any tips would be appreciated.

Hi, 

 

Can anyone help?  I've had approval procs in place for some months that locks records.  This is all well and good.  however I've got 8 years worth of records that never went through the approval process that consequently aren't locked.

 

So, what I'm after is coming up with a list of all closed won opportunities that aren't currently locked.  I've not been able to find a simple answer to this.

 

Anyone got any ideas?

 

Thanks in advance.

I've received the following eclipse error when creating a new Force.com Project:

 

Unable to fetch organization details

Force.com projects requrie a salesforce user with both 'Customize Application' and 'Modify All data' profile permissions.  Please change your credentials in project Properties > force.com

 

I'm receiving this on a full copy sandbox I've just refreshed and activated.  My profile is "System Administrator" so I already have the rights.  Also, I can connect just fine to the PROD org that I refreshed the sandbox from and the other sandboxes.

 

Does anyone have any insight?

 

Thanks

 

Is there an easy way to cast any null decimal/currency values of null to 0.00 so as to avoid a null pointer exception?

 

keepOLI.previous_price__c = keepOLI.Previous_price__c + i.Previous_price__c;

 

I want to say that if i.Previous_Price__c == null then cast to 0 without having to write an if statement for this, and for every other number that might come up null in the class.

 

I also want to avoid changing the Previous_price__c to default 0 and then going back and setting millions of null records to 0.

 

Is there a trick I'm missing here?

 

Or should I just write something like this

 

public long ifnull(long num ) {
if (num == null) num = 0;
return num;
}

 and then change my code to be this

 

keepOLI.previous_price__c = ifnull(keepOLI.Previous_price__c) + ifnull(i.Previous_price__c);

 

 

 

Hi, 

 

I want to write a VF page that will combine Opportunity closeOpp and Opportunity keepOpp by taking all the products from closeOpp and putting them on keepOpp, then setting the stage on closeOpp to 'Closed.' 

 

I've written a class to do this quite nicely and it all works the way I like.  Now, I want to have a VF page on the front to call it.  I want to put two lookup fields:  one for the Opportunity to close and one for the opportunity to keep.

 

How do I set the respective variables in the class by using the standard Lookup functionality?

 

I thought I could put something like:

 

<apex:inputField value="{!closeOpp.Id}"/> 

<apex:inputField value="{!keepOpp.Id}"/>

 

 

public with sharing class opportunityMerge {

	public Opportunity closeOpp {get; set;}
	public Opportunity keepOpp {get; set;}
	List<OpportunityLineItem> newLines = new List<OpportunityLineItem>();


	public opportunityMerge() {
	
		 // might have to do something here depending on the suggestions
	}
	
	public void mergeOpps() { 
		// do all the heavy lifting here
		// loop the line items on closeOpp, clone them
		// add them to a list and insert them
	}

	public PageReference next() {
		// call mergeOpps from here
		return null;

	}

	public Pagereference cancel() {
		// cancel me
		return null;
	}
}

 

Thanks for any suggestions!!

 

:smileyhappy:

Hi,

 

I have a Configuration sandbox and I want to write a trigger to post to chatter groups.  I created the group in PROD and then refreshed the sandbox.  After it was activated, it shows no groups.  So I tried to create the group by hand using the same name and it gives me an error that the group already exists or is in the process of being deleted.

 

I used the dataloader to dump the CollaborationGroup object's data and tried uploading that into the sandbox.  I got errors on all the entries.

 

Others are doing what I'm trying to do.  Surely they must have developed in sandboxes?

 

Let me know if there's some dumb mistake I'm making.

 

Hi,

 

I've successfully written a trigger to automatically share Account records with related opportunities to partners.  I've written a second trigger on Opportunities that does the same thing.  This is so that once an account is shared, new opportunities also get shared.

 

The problem is now Opportunity Line Items.   After much fooling around, I've finally got it all configured nicely so that I can share opportunities and opportunity line items manually through the Salesforce UI and the product lines land nicely in the partner system.  However I want to do this by trigger as well, so that not just the opportunity goes, but also the line items.  I feel that if it works manually, the trigger should work but it doesnt.

 

Here's the trigger.  Any ideas??

 

Thanks!!

 

 

trigger shareOpportunity on Opportunity (after insert, after update) {

List<PartnerNetworkConnection> connMap = new List<PartnerNetworkConnection>([select Id, 
    ConnectionStatus, ConnectionName from PartnerNetworkConnection where ConnectionStatus = 'Accepted']);

List<PartnerNetworkRecordConnection> pncList = new List<PartnerNetworkRecordConnection>();



    for (Opportunity o : Trigger.new) {
        if (o.Originating_System__c == 'CRR' ) {
            for (PartnerNetworkConnection pnc : connMap) {
                
             PartnerNetworkRecordConnection newOpprecord = new PartnerNetworkRecordConnection(
                
                        ConnectionId = pnc.Id,
                        LocalRecordId = o.Id,
                        SendClosedTasks = false,
                        SendOpenTasks = false,
                        SendEmails = false,
                        ParentRecordId = o.AccountId,
                        RelatedRecords = 'OpportunityLineItem'
                    );
                        
                pncList.add(newOpprecord);
                
            }   
        }
    }
    
    
    
    if (!pncList.isEmpty()) {
        upsert pncList;
    }

 

}

 

 

Hi,

 

I'm hoping someone can help me with this because I can't seem to find any real documentation on Mailmerge templates in Salesforce nor can I find any samples.

 

In the past I've built Mailmerge templates for Opportunities that show all the Line Items for the opportunity.  I have custom objects related to an opportunity and I want to do a Mailmerge template that shows all the child records for an opportunity in a manner similar to Line Items.

 

I've tried doing this through Word and it returns the Opportunity items but it doesn't return the child object items.  So if anyone's got a sample Word document they'd be happy to pass along or tell me how I can address parent-child relationships in Mailmerge, I'd appreciate it.

 

Also I'm wondering if I can do a mailmerge for an Opportunity and show Line Items and also show Quotes and also show the records of custom child objects all in the same template.

 

Thanks in advance!!

 

 

Hi,

 

I'm trying to use a custom controller with a Visualforce Email Template.  My problem is pretty simple I think.  I'm taking in a value from the custom component and I want to use it in the constructor of the controller.  I think I'm only overlooking one tiny thing to make sure everything executes in order, but it's eluding me.

 

the visualforce email template:

 

 

<messaging:emailTemplate recipientType="User" relatedToType="DAM_Digital_Asset__c"  subject="Please Approve This">

<!-- <apex:page controller="DAM_approvalsEmailController">  -->

<!-- https://c.na7.visual.force.com/apex/testmail?id=00A00000064bh3  -->
<messaging:htmlEmailBody >

<c:DAM_approvalsEmail DA_Id="{!RelatedTo.Id}" />

</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

 

the component

 

 

<apex:component controller="DAM_approvalsEmailController" access="global">
  <apex:attribute name="DA_Id" type="String" description="the Digital Asset ID" assignTo="{!DA_Id}"  />

 

the controller

 

 

public class DAM_approvalsEmailController {

 public DAM_Digital_Asset__c da {get; set;}
 public String DA_Id {get; set;} 
 
 public DAM_approvalsEmailController() {
    this.da = [select id, Name, Process_Step__c, Location__c, Host_Domain__c from DAM_Digital_Asset__c where id = :DA_Id]; 
           

        }

 

 

What am I not doing correctly to get DA_Id from the component so that it can be constructed?

 

Thanks!!

 

Hi,

 

I've got a visualforce email that shows some fields from a custom object and I've placed a table in there to show related Note records.

 

This all works fine in test.  But I want to take it one step further and only show the table with the related Note records only if there are any.  Is there a way to do this without writing a custom controller?

 

Also, if anyone knows any good documentation with tips for using "render=" in creative ways like this.  If I want to find ways others use "render", such as putting in IF statements and the like, I have to scan through the boards here which isn't ideal

 

I'd love to say render="{! IF(COUNT({relatedTo.Notes}) > 0, TRUE, FALSE )}"

 

Any ideas?

 

 

<messaging:emailTemplate recipientType="User"
        relatedToType="DAM_Digital_Asset__c"
        subject="Asset Approval Needed: {!relatedTo.name} {!relatedTo.Content_Title__c}"
    replyTo="no-reply@makepositive.com" >

<messaging:htmlEmailBody >       
<html>
<body> 
      <style type="text/css">
            body {font-family: Arial; size: 8pt }

            table {
            font-family: Arial; size: 8pt
            border-width: 1px;
            border-spacing: 3px;
            border-style: none;
            border-color: #FFFFFF;
                   }

        td {
            font-family: Arial; size: 8pt
            border-width: 1px;
            padding: 3px;
            border-style: none;
            border-color: #000000;
            background-color: #FFF8C6;
        }

        th { 
            font-family: Arial; size: 8pt
            color: #FFEECC;
            border-width: 1px ;
            padding: 3px ;
            border-style: none ;
            border-color: #FFFFFF;
            background-color: #ECE5B6;
        }
        </style>
         <font face="arial" size="2">  
                         
<!-- <apex:image id="Logo" value="https://na1.salesforce.com/servlet/servlet.ImageServer?id=015A0000001IO1X&oid=00DA00000009Ts6" />  -->

      <p>Dear {!recipient.Name},</p>
      <p>Your approval is needed for the following Asset: {!relatedTo.name} {!relatedTo.Content_Title__c}.
      Click here to view: {relatedTo.Link}
      </p>
     

      
<table border="0" >
    <tr>
    <th style="border:none windowtext 1.0pt; font-family: Arial; font-size: 10pt">Note</th>
 <!--   <th style="border:solid windowtext 1.0pt; font-family: Arial; font-size: 10pt">Created Date</th>  -->
    <th style="border:none windowtext 1.0pt; font-family: Arial; font-size: 10pt">Creator Email</th>
    </tr>
    
    <apex:repeat var="nt" value="{!relatedTo.Notes}">
    <tr>   
<td width="2000" style="border:none windowtext 1.0pt; font-family: Arial; font-size: 10pt">{!nt.Title} {!nt.Body}</td>
<!-- <td width="300" style="border:solid windowtext 1.0pt; font-family: Arial; font-size: 10pt">{!nt.CreatedDate}</td>  -->
<td width="300" style="border:none windowtext 1.0pt; font-family: Arial; font-size: 10pt">{!nt.CreatedBy.Email}</td></tr>
       
</apex:repeat>                
     </table>
      <p />
      
      

</font>
</body>
</html>

</messaging:htmlEmailBody>

<messaging:plainTextEmailBody >
    Dear {!recipient.name},
      
Below is a list of related notes:
     
<apex:repeat var="nt" value="{!relatedTo.Notes}">

-----------------------
[ {!nt.Title} ] - [ {!nt.CreatedDate} ] - [ {!nt.CreatedBy.email} ]
[ {!nt.Body} ]

</apex:repeat>
     
</messaging:plainTextEmailBody>   
</messaging:emailTemplate>

 

 

 

 

Hi,

 

Does anyone have any good sample programming exercises they use as tests when screening possible candidates to use as ability tests?

 

I feel this particular discussion board would be the best place on earth to get these things.

 

In addition to that, I'd be interested in something that's in the same style as what Salesforce.com ask for in the programming exercise for DEV501 Advanced Developer certification exam.  So if anyone has any fake business requirements documents for practice purposes for use in staff development,  I'd appreciate that too!!

 

Thanks!!

 

 

Hi,

 

I'm trying to avoid building a Visualforce page for something where the regular Salesforce pages would ordinarily work fine.

 

I start out a simple wizard with a VF page with a few Account fields.  I want to then create a child record in Meeting_Notes__c and I want the Account__c field filled in and the rest blank for editing.

 

I thought the following excerpt should work to achieve this, meaning create a new Meeting_Note__c in the controller, add Account.Id, and then pass it to the page reference.

 

Instead of bringing up a new Meeting_Notes__c page, it's bringing up the Account page.  I know I can solve this easily by marking up the entire page in Visualforce but I feel that if the page is already good without using VF, to not use VF.

 

Is there some little tiny mistake I'm making?

 

public PageReference next() {


		Meeting_Note__c mn = new Meeting_Note__c(Account__c = acct.Id);	

		PageReference mnPage = new ApexPages.StandardController(mn).edit();
		mnPage.setRedirect(true);
		return mnPage; 
		

Hi,

 

I've got a custom object called "Meeting Note" on a parent-child relationship off of Account.  In the related list area there's the usual "New Meeting Note" button.  When you press it, you get a new Meeting Note record in edit mode, with the account information populated in already.

 

I would like to launch a visualforce page there instead, but I also want the behavior to be the same -- where the parent account info is already populated.

 

Just for comparison's sake, I added a new button called "Meeting Note 2."   I tried to make the Content Source "Visualforce Page" but then my page (markup below) doesn't come up as a choice in the dropdown list.  Is there something missing?

 

So what I did instead just for giggles was I made the Content Source "URL" and put in /apex/meetingnote as the URL.  I'm sure I can take this a step further and pass in the Account.Id value into the URL and maybe go from there.  But I get the feeling there's just something small missing that's keeping it from working the way I'd have expected it to??

 

Any help is appreciated!! :smileyhappy:

<apex:page standardController="Meeting_Note__c" extensions="meetingNoteAccountController">
 <apex:form >
        <apex:pageBlock mode="edit" title="Meeting Note Detail">
            <apex:pageBlockButtons location="top">
               <apex:commandButton value="Next" action="{!next}"/>
            </apex:pageBlockButtons>
            <apex:pageMessages /> 

          <apex:pageBlockSection id="Section1a" columns="2">
            <apex:inputField required="true" value="{!Meeting_Note__c.Name}" />
            <apex:inputField required="true" value="{!Meeting_Note__c.Account__c}" />
          </apex:pageBlockSection>


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

 

Hi,

 

I'm looking at using the partner portal.  We have a partner who will be selling only about six of our products out of the hundreds we'd normally sell.

 

When the partner adds an opportunity through the partner portal, how can I restrict the list down to ensure they don't book any products they're not supposed to see or sell?

 

Can I build a pricebook with just those and restrict the pricebooks the partner can use?

 

Thanks!!

Hi,

 

I'm quite frustrated by my current problem with Eclipse.  Hopefully someone's seen this?

 

I've been getting this error with Eclipse when trying to save back to Salesforce on the production instance.  I had two Force.com projects, one that pointed to my production instance and one that pointed to my developers account.

 

I was only getting the error for prod and not the dev.  So I deleted the Force.com project and created new.  That didn't work.  So I got rid of everything eclipse on my pc.  Then I went  to http://community.salesforce.com/t5/forums/postpage/board-id/apex and followed the directions for downloading, installing and configuring Eclipse from scratch.

 

No luck with that either.

 

The steps I'm taking to repeat the error:

 

I open up one of my unit test classes and somewhere in the middle on an empty line I add "//comment" into the code.  Then I save.

 

In the Problems area, I get "Save error: Unable to perform save on all files.  An unexpected error has occurred. Check the logfile for details."

 

Does anyone know how I remedy these errors from the log below, or even some guidance as to what they are??

 

Thanks!!!

 

 

!SESSION 2010-01-29 17:40:16.132 ----------------------------------------------- eclipse.buildId=M20090211-1700 java.version=1.6.0_18 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB Command-line arguments: -os win32 -ws win32 -arch x86 !ENTRY org.eclipse.equinox.p2.metadata.repository 2 0 2010-01-29 17:44:57.978 !MESSAGE Error parsing metadata repository !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 9, column 99: Missing required attribute in "repository": url !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 9, column 99: Illegal value for attribute "url" of element "repository": null !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 10, column 99: Missing required attribute in "repository": url !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 10, column 99: Illegal value for attribute "url" of element "repository": null !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 11, column 97: Missing required attribute in "repository": url !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 11, column 97: Illegal value for attribute "url" of element "repository": null !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 12, column 97: Missing required attribute in "repository": url !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 12, column 97: Illegal value for attribute "url" of element "repository": null !SESSION 2010-01-29 17:49:18.286 ----------------------------------------------- eclipse.buildId=M20090211-1700 java.version=1.6.0_18 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB Command-line arguments: -os win32 -ws win32 -arch x86 !ENTRY com.salesforce.ide.core 2 0 2010-01-29 17:50:44.730 !MESSAGE WARN [2010-01-29 17:50:44,730] (IntroEditorInput.java:loadDocument:130) - org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference. !ENTRY com.salesforce.ide.core 2 0 2010-01-29 17:56:15.365 !MESSAGE WARN [2010-01-29 17:56:15,365] (ProjectService.java:handleDeployResult:1928) - Save failed! !ENTRY com.salesforce.ide.core 2 0 2010-01-29 17:56:15.381 !MESSAGE WARN [2010-01-29 17:56:15,381] (ProjectService.java:handleRetrieveResult:2073) - Nothing to save to project - retrieve result is empty !ENTRY com.salesforce.ide.core 4 0 2010-01-29 17:56:15.396 !MESSAGE ERROR [2010-01-29 17:56:15,381] (BuilderController.java:handleException:134) - Unable to perform save on all files. !STACK 0 java.lang.NullPointerException at com.salesforce.ide.core.services.ProjectService.setRunTestFailureMarker(ProjectService.java:2335) at com.salesforce.ide.core.services.ProjectService.handleRunTestMessages(ProjectService.java:2310) at com.salesforce.ide.core.services.ProjectService.handleRunTestResult(ProjectService.java:2230) at com.salesforce.ide.core.services.ProjectService.handleDeployResult(ProjectService.java:1940) at com.salesforce.ide.core.project.BuilderController.handleSaves(BuilderController.java:118) at com.salesforce.ide.core.project.BuilderController.build(BuilderController.java:95) at com.salesforce.ide.core.project.BuilderController.build(BuilderController.java:75) at com.salesforce.ide.core.project.OnlineBuilder.incrementalBuild(OnlineBuilder.java:79) at com.salesforce.ide.core.project.OnlineBuilder.build(OnlineBuilder.java:49) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

 

 

 

Hi,

 

I created a visualforce page that I want displayed on the wide area of the homepage.  There are a few posts that suggest the following method as being the way.  So I do the following:

 

1. Go to Setup -> Customize -> Home -> Home Page Components

2. Click New->Choose HTML Area and->Input the Name for your component->Click Next

3. Select show HTML on the right upper hand side and place in the following:

 

<iframe

src="/apex/dateTester?core.apexpages.devmode.url=1"

width="100%" frameborder="0" height="100">

</iframe>

4. Then Click saves.

5. Now go into Setup -> Customize -> Home ->Home Page Layouts ->Click Edit next tothe Layout you would like to configure

Select the component from there

Click Next and order it where you want it to show.

Click Save.

 

It doesn't work for me.  When I go back to look at the new component, I edit it, then I check the box next to "show HTML".

 

And what I put in as this:

 

<iframe src="/apex/dateTester?core.apexpages.devmode.url=1" width="100%" frameborder="0" height="100">
</iframe>

 

 

ends up looking like this when I go back to view it:

 

<iframesrc=" apex="" datetester?core.apexpages.devmode.url="1&quot;width=&quot;100%&quot;" frameborder="0" height="100"></iframesrc=">

 

Why doesn't it work for me like others who have posted on here?

Hi All,

 

I have a query on profile like

 

  profile =[Select p.Name From Profile p where p.Name=: 'System Administrator' ];

 

If the user  language is english it works fine but if the language is different other than english then the query is not working.

 

Please suggest me any work around on this. Any help is appreciated.

Hi,

 

I'm looking to validate software version numbers to ensure they contain only one decimal and can be between

0 and 99.99.

 

At first I thought I could just use a number, but with versioning, 1.3 and 1.30 are different values.

 

I thought this should work:

 

REGEX( Version_Number__c, "(\\d){0,2}(\\.)(\\d){0,2}" )

 

It works for whole numbers, but fails once you add in a decimal point.

 

Any tips would be appreciated.

I've received the following eclipse error when creating a new Force.com Project:

 

Unable to fetch organization details

Force.com projects requrie a salesforce user with both 'Customize Application' and 'Modify All data' profile permissions.  Please change your credentials in project Properties > force.com

 

I'm receiving this on a full copy sandbox I've just refreshed and activated.  My profile is "System Administrator" so I already have the rights.  Also, I can connect just fine to the PROD org that I refreshed the sandbox from and the other sandboxes.

 

Does anyone have any insight?

 

Thanks

 

Hi,

 

I'm hoping someone can help me with this because I can't seem to find any real documentation on Mailmerge templates in Salesforce nor can I find any samples.

 

In the past I've built Mailmerge templates for Opportunities that show all the Line Items for the opportunity.  I have custom objects related to an opportunity and I want to do a Mailmerge template that shows all the child records for an opportunity in a manner similar to Line Items.

 

I've tried doing this through Word and it returns the Opportunity items but it doesn't return the child object items.  So if anyone's got a sample Word document they'd be happy to pass along or tell me how I can address parent-child relationships in Mailmerge, I'd appreciate it.

 

Also I'm wondering if I can do a mailmerge for an Opportunity and show Line Items and also show Quotes and also show the records of custom child objects all in the same template.

 

Thanks in advance!!

 

 

I have a Global class exposed as a webservice that is called by users who do not have the "Add Content" Workspace Permission, and am using "without sharing" to try to make it possible for that class to update fields on Content records. However, when I try to call the methods in this class, I receive insufficient access exceptions:

 

12:18:32.091|EXCEPTION_THROWN|[23]|System.DmlException: Update failed. First exception on row 0 with id 068M00000004G5HIAU; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []

 

If I try the same thing with a user that does have the "Add Content" workspace permission, everything works as expected. Is it possible to have a method run in the system context when updating content records?

 

Thanks,

Tom

Hi,

 

I'm trying to write unit tests for Content. It seems that it is impossible to create a Workspace record in Apex, so I guess we have to use an existing one in the org?

 

Bigger question: If I create a Content record, relate it to an existing workspace using FirstPublishLocationId, and insert it, and then try to make an update to that Content record, I get this error:

 

Document with ID: 06930000000YPbp already has an owning Workspace

 

I get the same error whether or not this is in a test class. If I do it outside of a test class, and just use the record Id a few seconds later to do my update, it will work. So, it seems to be time-based... Is it not possible to update a newly created Content record from within a test class?

 

Thanks,

Tom

Hi,

 

I'm trying to avoid building a Visualforce page for something where the regular Salesforce pages would ordinarily work fine.

 

I start out a simple wizard with a VF page with a few Account fields.  I want to then create a child record in Meeting_Notes__c and I want the Account__c field filled in and the rest blank for editing.

 

I thought the following excerpt should work to achieve this, meaning create a new Meeting_Note__c in the controller, add Account.Id, and then pass it to the page reference.

 

Instead of bringing up a new Meeting_Notes__c page, it's bringing up the Account page.  I know I can solve this easily by marking up the entire page in Visualforce but I feel that if the page is already good without using VF, to not use VF.

 

Is there some little tiny mistake I'm making?

 

public PageReference next() {


		Meeting_Note__c mn = new Meeting_Note__c(Account__c = acct.Id);	

		PageReference mnPage = new ApexPages.StandardController(mn).edit();
		mnPage.setRedirect(true);
		return mnPage; 
		

Hi,

 

I'm quite frustrated by my current problem with Eclipse.  Hopefully someone's seen this?

 

I've been getting this error with Eclipse when trying to save back to Salesforce on the production instance.  I had two Force.com projects, one that pointed to my production instance and one that pointed to my developers account.

 

I was only getting the error for prod and not the dev.  So I deleted the Force.com project and created new.  That didn't work.  So I got rid of everything eclipse on my pc.  Then I went  to http://community.salesforce.com/t5/forums/postpage/board-id/apex and followed the directions for downloading, installing and configuring Eclipse from scratch.

 

No luck with that either.

 

The steps I'm taking to repeat the error:

 

I open up one of my unit test classes and somewhere in the middle on an empty line I add "//comment" into the code.  Then I save.

 

In the Problems area, I get "Save error: Unable to perform save on all files.  An unexpected error has occurred. Check the logfile for details."

 

Does anyone know how I remedy these errors from the log below, or even some guidance as to what they are??

 

Thanks!!!

 

 

!SESSION 2010-01-29 17:40:16.132 ----------------------------------------------- eclipse.buildId=M20090211-1700 java.version=1.6.0_18 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB Command-line arguments: -os win32 -ws win32 -arch x86 !ENTRY org.eclipse.equinox.p2.metadata.repository 2 0 2010-01-29 17:44:57.978 !MESSAGE Error parsing metadata repository !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 9, column 99: Missing required attribute in "repository": url !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 9, column 99: Illegal value for attribute "url" of element "repository": null !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 10, column 99: Missing required attribute in "repository": url !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 10, column 99: Illegal value for attribute "url" of element "repository": null !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 11, column 97: Missing required attribute in "repository": url !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 11, column 97: Illegal value for attribute "url" of element "repository": null !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 12, column 97: Missing required attribute in "repository": url !SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2010-01-29 17:44:57.978 !MESSAGE Error at line 12, column 97: Illegal value for attribute "url" of element "repository": null !SESSION 2010-01-29 17:49:18.286 ----------------------------------------------- eclipse.buildId=M20090211-1700 java.version=1.6.0_18 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB Command-line arguments: -os win32 -ws win32 -arch x86 !ENTRY com.salesforce.ide.core 2 0 2010-01-29 17:50:44.730 !MESSAGE WARN [2010-01-29 17:50:44,730] (IntroEditorInput.java:loadDocument:130) - org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference. !ENTRY com.salesforce.ide.core 2 0 2010-01-29 17:56:15.365 !MESSAGE WARN [2010-01-29 17:56:15,365] (ProjectService.java:handleDeployResult:1928) - Save failed! !ENTRY com.salesforce.ide.core 2 0 2010-01-29 17:56:15.381 !MESSAGE WARN [2010-01-29 17:56:15,381] (ProjectService.java:handleRetrieveResult:2073) - Nothing to save to project - retrieve result is empty !ENTRY com.salesforce.ide.core 4 0 2010-01-29 17:56:15.396 !MESSAGE ERROR [2010-01-29 17:56:15,381] (BuilderController.java:handleException:134) - Unable to perform save on all files. !STACK 0 java.lang.NullPointerException at com.salesforce.ide.core.services.ProjectService.setRunTestFailureMarker(ProjectService.java:2335) at com.salesforce.ide.core.services.ProjectService.handleRunTestMessages(ProjectService.java:2310) at com.salesforce.ide.core.services.ProjectService.handleRunTestResult(ProjectService.java:2230) at com.salesforce.ide.core.services.ProjectService.handleDeployResult(ProjectService.java:1940) at com.salesforce.ide.core.project.BuilderController.handleSaves(BuilderController.java:118) at com.salesforce.ide.core.project.BuilderController.build(BuilderController.java:95) at com.salesforce.ide.core.project.BuilderController.build(BuilderController.java:75) at com.salesforce.ide.core.project.OnlineBuilder.incrementalBuild(OnlineBuilder.java:79) at com.salesforce.ide.core.project.OnlineBuilder.build(OnlineBuilder.java:49) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

 

 

 

Hi,

 

Does anyone know what this is about?  I'm trying to save a class that has an @future in it.  I've been working with it for many days and doing lots of different unit test scenarios.  I've been using a development org.

 

I've been able to save it before for all these days, but now I'm getting this error: "Batchable class has jobs pending or in progress" when I try to save it.  It's been in that state for at least an hour.

 

How long should these jobs pending usually take?  How long should I wait to do something about it .... and then what exactly would I then do??

 

Any help is appreciated!!

 

Thanks!!

Hi,

 

I'm getting some strange behaviour using Eclipse with a SOQL query in a class.  I'm using the schema section to test the query out and just for sanity, building the query using the checkboxes to ensure the relationships are correct.

 

I'm trying to query the Lead object and show the Lead Owner's Division.

 

To do this, you join with User.  The field "Division" is a standard Salesforce.com field, as is Username, Lastname,Firstname, Fullname, Street, City, State, Email, Phone, and so on.

 

The following example queries work:

 

Select l.Owner.Name, l.OwnerId, l.Company From Lead l

Select l.Owner.Username, l.OwnerId, l.Company From Lead l

Select l.Owner.Phone, l.OwnerId, l.Company From Lead l

Select l.Owner.Email, l.OwnerId, l.Company From Lead l

Select l.Owner.ProfileId, l.OwnerId, l.Company From Lead l

 

 

These are some that don't work:

 

Select l.Owner.Division, l.OwnerId, l.Company From Lead l

Select l.Owner.Country, l.OwnerId, l.Company From Lead l

Select l.Owner.City, l.OwnerId, l.Company From Lead l

Select l.Owner.Department, l.OwnerId, l.Company From Lead l

 

 

The error message:   

 

Unable to open Schema Browser. Reason: INVALID_FIELD - Select l.Owner.Division,l.OwnerId,l.Company from Lead l ^ ERROR at Row:1:Column:8 No such column 'Division' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

 

If they're all non-custom fields on a non-custom object, the relationship name should work? 

 

Is there anything I'm missing?