• jpizzala
  • NEWBIE
  • 164 Points
  • Member since 2007

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

Hello Friends,

 

Can any one tell me that the following requirement can be done or not?

 

I have 2 custom objects Company, Contacts. In the Contacts object I have  a custom picklist ContactName

consists of names like 'CEO','Manager','employee'

 

The thing is while creating contacts for a single company , i need the users to select the ContactName 'CEO' only for one time. I do not want to use Apex class to save the records, using the native save functionality can we achieve this kind of functionality.

 

Please let me know,

 

 

Thanks,

 

 

 

  • December 11, 2009
  • Like
  • 0

Has anyone figured out a way to show a last activity date on accounts for both open and completed activities?  Basically I am just trying to find a way to show the last time someone did any kind of task work on an account.

 

Thanks in advance for any help!

  • December 10, 2009
  • Like
  • 0

I have a lookup relationship between Object A and B, in object A I have a lookup field, while in Object B I have a related list.

 

I would like to be able to limit the number of Object A that reference Object B to 3, how can this be done?

 

Thanks

I have a trigger which prepopulate a filed before insert, but it does not work.

 

 

trigger GetLastAssocID on Obj__c (before insert) {

 

for (Obj__c ori: System.Trigger.New){

 

  if (ori.ObjName__c == ''){

  ori.Obj_ID__c = [Select Obj_ID__c from

                         Obj__c

                         Order by Obj_ID__c Desc

                         Limit 1];

  }

 }

}

 

 

Obj__c is an object I created and Obj_ID is a number(Double) field.

  • January 29, 2009
  • Like
  • 0
I thought that when you created a force.com site a profile corresponding to this site was automatically created so that you could control FLS, CRUD, etc for the unauthenticated guest user. I have created a site called "demo". When I edit the security for the pages in this site I see a profile called "demo profile" but when I navigate to Manage Users > Profiles this profile is not there.

So far this was the only doc I could find and it doesn't mention anything about the profiles:

http://www.adnsandbox.com/df08/workbook-sites.pdf

Thanks,
Jason
  • November 07, 2008
  • Like
  • 1
Hi,

Does anyone had this requirement. If yes, please help me. And btw, I am kind of new to SFDC.

I need to show a custom field on the account page layout which should default the value to following.

"Sale Number # "
& "Amount $ "
& "One-Times $ "
& "Terms of Sale "
& "Cashier's check?___ "
& "Credit Card?___ "

That sounds simple right ? But I need them in multiline.. like below

Sale Number #
Amount $
One-Times $
Terms of Sale
Cashier's check?___
Credit Card?___

I tried "\n" but didnt help.

Thanks

We have been developing an application that utilizes the following XML pulling concept to gather report data:

 

http://sfdc-heretic.warped-minds.com/2006/04/10/progmatic-access-to-salesforcecom-reports/

 

Prior to the Summer '10 release, we were able to grab this information just fine.  Now, however, all we can get is the login screen when we request a specific report.  Did something change in this (unsupported) process?  Is there another way we can programmatically get to this information?

Three or four days ago, I started experiencing difficulties logging into Salesforce from Linux (Ubuntu).  My machine is dual-booted with Windows Vista, which was not having any problems logging in.
 

Firefox 3.5.5, Chrome Beta and Opera 10.00 all reflect the same problem, which originally led me to believe that maybe there was something in a recent Linux update (however unlikely) that caused the conflict.  I couldn't find anything out of the ordinary as I was able to navigate all other sites just fine.  The only sites I had any problems with at all were the ones on the Salesforce domains (i.e. ideas.salesforce.com, login.salesforce.com, developer.salesforce.com, www.salesforce.com, etc.).  When I would go to https://login.salesforce.com, it would just spin forever and never resolve.  I am able to ping these subdomains just fine and lynx (text browser) doesn't appear to have the issue so much.
 

Today, I tried clearing all cache and cookies from the three browsers and tried again.  I was able to access the https://login.salesforce.com page once in each browser, but when I put my credentials in, it would never actually redirect me to my org.  I tried this with multiple orgs with the same result (clearing cache and cookies before each attempt).  If I fail to clear the cache and cookies and try to load the login page a second time, it will not resolve.

 
To further compound this oddity, I was able to successfully login to a couple orgs by explicitly specifying the node in the login URL (i.e. https://na3.salesforce.com).  I have been playing around with the cookies that are created during these sessions and the problem seems to reside in the "salesforce.com" domain set of cookies.  Each subdomain has its own set of cookies (i.e. these community boards store cookies under the "community.salesforce.com" label) which don't appear to be the root of the problem.

 

The only way I am able to login and make this post was if I keep the cookies window open (I'm using FF at the moment) and delete the "salesforce.com" folder whenever it popped up.  The "community.salesforce.com" folder remains and doesn't appear to be causing any harm from what I've noticed so far.  In Ubuntu, I am only able to get as far as creating this message.  In order to post it, I've had to switch to Vista, paste what I wrote in Ubuntu and press the Post button from here.  Ubuntu would not complete the posting transaction.


This still may be some obscure bug in my own configuration, but I figured I'd throw it out there to see if anyone else was experiencing similar symptoms.

We are coming across the "Failed to send request" error (pictured below) when importing data via Data Loader UI.  This seems to be happening anywhere between records 5,000 and 5,600 (out of a 6,000+ record CSV file).  On the SF end, we have an after insert/update trigger on this object (just something to keep in mind since the trigger is processing these records as they are imported).

 

It appears that this is an issue outside of the data set since the errors would otherwise be written to the resulting failure file generated by Data Loader. The import process takes ~15 minutes to get to the 5,000 record mark so I wouldn't think that the connection is timing out or anything.

 

Anyone have any ideas?

 

 Data Loader Failed To Send Request Error

We have developed some Apex code that is executed upon insert/update of an object (foo__c).  In order to appropriately fullfil the client's requirements, the code must be able to handle over 500,000 records in a "single insert/update" (the records will be inserted/updated via an automated process using the web services API).  The Apex class method contains iterators, which compounds the number of script statements executed, but they are necessary.

 

We have tested the code with sample data and have found that it complies with most of the governor limitations with the exception of "Too many script statements".  First off, does anyone know how the script statment count is generated?  What is the scope of the count (i.e., per API insert/update command, per trigger execution, per class method execution, etc.?  What exactly defines a statement (i.e. is 1 statement == 1 line of code, 1 statement == 1 logical process like an IF statement, etc.)?

 

I have heard that there is a certification process that will alleviate some of the governor limitations, specifically for apps posted on AppExchange.  Is it possible to enable this on a private package, such as ours for a single client?

 

Thanks in advance!

EDIT: I have updated this posting with a subject that is more indicative of what I am trying to achieve.

 

End Goal

Automatically escalate a custom object record if it has not been approved after 24 hours (approval process escalation).  When this record is created, it is automatically submitted into an approval process.  If the original approvers have not approved/rejected the record after 24 hours, the record should be automatically reassigned to a different approver where it will sit for however long it takes for approval/rejection.

 

Note: Status field has the following values: New, Pending Approval, Approved, Rejected

 

Current Implementation

  1. Record created in custom Visualforce GUI
  2. Upon save, Apex extension submits the record to an approval process
  3. First step of the approval process updates a Status field on the record, changing it from "New" to "Pending Approval"
  4. 24-hour time-based workflow in place which updates a checkbox, "Escalated", if the record is still in the "Pending Approval" Status (Currently, does not fire)
  5. Apex trigger fires after record is updated calls Apex class method if "Escalated" checkbox is true.  This Apex method should have the ability to:
    1. Cancel current approval process and resubmit to escalation approval process - OR-
    2. Manipulate the record's current state in the existing approval process so that a different User/Group is responsible for approval/rejection
    3. (I think the first method is possible with Apex, but I'm not too sure about the second method)


I believe the problem lies in the order of execution between steps 3 and 4.  For whatever reason, the workflow in step 4 never fires after the record is updated via approval process.  However, it will fire when I manually change a "New" record's Status to "Pending Approval".

 

I was hoping that there was a better way to go about this auto-escalation (perhaps within the point-and-click configuration) but haven't found a solution.  Is there a better approach (ideally, a working approach :smileyhappy:) out there?

 

Thanks in advance!

Message Edited by jpizzala on 02-25-2009 11:05 AM

I have created a custom object with lookups to various standard SF objects (Account, Contact, Opportunity, Lead and Case).  My Visualforce page contains a very basic form with all available fields set up as <apex:inputField> elements and this works as expected - as Visualforce.  Now my intention for this page is to make it available via Sites.  However, when I expose this VF page on my site, the lookups fail (and give me the error in the subject line).  It appears that some common SF components are not made available for Sites usage.  Is this true?  I hope I am just missing something simple.

 

This is a very basic proof-of-concept implementation.  The Sites profile has read/write access to my custom object, read access to all standard objects listed above and no custom extensions have been implemented yet so no additional Apex classes are necessary for this page.

 

My code is below:

 

 

<apex:page standardController="Foo__c" showHeader="false">
<apex:messages />
<apex:form >
<apex:outputPanel layout="block">
<apex:outputLabel for="subject" value="Subject"/>
<apex:inputText id="subject" value="{!Foo__c.Subject__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="body" value="Body"/>
<apex:inputField id="body" value="{!Foo__c.Body__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="case" value="Case"/>
<apex:inputField id="case" value="{!Foo__c.Case__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="account" value="Account"/>
<apex:inputField id="account" value="{!Foo__c.Account__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="opportunity" value="Opportunity"/>
<apex:inputField id="opportunity" value="{!Foo__c.Opportunity__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="contact" value="Contact"/>
<apex:inputField id="contact" value="{!Foo__c.Contact__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="lead" value="Lead"/>
<apex:inputField id="lead" value="{!Foo__c.Lead__c}"/>
</apex:outputPanel>
<apex:commandButton id="save" action="{!save}" value="Save"/>
</apex:form>
</apex:page>

 

 

 Any ideas would be much appreciated!

I have a "contact me" form on a dev site that, upon submission, creates a Task for me.  This works perfectly well inside of SF as a standard Visualforce page, however I get the following error when trying to submit the form on a sites page:

Code:
j_id0:j_id1:contactForm:j_id12: An error occurred when processing your submitted information.
j_id0:j_id1:contactForm:j_id15: An error occurred when processing your submitted information. 

Where j_id12 is the Subject input box and j_id15 is the Message input textarea (code below):

Code:
<apex:page standardController="Task" extensions="ActivityController" showHeader="false">
 <apex:composition template="PersonalTemplate">
  <apex:define name="body">
   <div id="contact" class="sectiontitle"/>
   <apex:outputPanel layout="block" styleClass="errorDisplay">
    <apex:messages />
   </apex:outputPanel>
   <apex:form id="contactForm">
    <fieldset>
     <legend>Send questions, comments, or suggestions here</legend>
     <apex:outputPanel layout="block">
      <apex:outputLabel for="subject" value="subject:"/>
      <apex:inputText value="{!Task.subject}"/>
     </apex:outputPanel>
     <apex:outputPanel layout="block">
      <apex:outputLabel for="message" value="message:"/>
      <apex:inputTextArea value="{!Task.description}"/>
     </apex:outputPanel>
     <apex:outputPanel layout="block" rendered="true">
      <apex:commandButton action="{!saveTask}" value="Send" styleClass="submit" style=""/>
     </apex:outputPanel>
    </fieldset>
   </apex:form>
  </apex:define>
 </apex:composition>
</apex:page>

Code:
public class ActivityController {
 
 private ApexPages.StandardController controller = null;
 
 public ActivityController( ApexPages.StandardController controller ) {
  
  this.controller = controller;
  
 }

 public PageReference saveTask() {

  controller.save();
  
  PageReference page = new PageReference( '/apex/PersonalContactSuccess' );
  page.setRedirect( true );
  
  return page;
  
 }

}


As far as I know, all Visualforce pages and Apex classes are available for the site and the site profile.  It acts like there is a security barrier between sites and activities that I cannot change via the site profile.

Any ideas would be much appreciated!



I am trying to display Facebook images on a test page and noticed that the generated <fb: photo/> tags were missing the pid attribute.  In looking at the fbComponentController class, I noticed that the following was currently in place:

Code:
<apex:attribute name="pid" type="String" assignTo="{!pid}" required="true"
description="An API-supplied pid of the photo, or any pid found in the query string of a photo URL on Facebook." />

However, the fbPhoto component was assigning the pid value to f_pid.  In changing the fbComponentController to the following, the pid was appropriately output in the generated html (or fbml):

Code:
<apex:attribute name="pid" type="String" assignTo="{!f_pid}" required="true"
description="An API-supplied pid of the photo, or any pid found in the query string of a photo URL on Facebook." />

Is this a bug or am I misinterpreting the relationship between the class and component?
I have created an app in Facebook to test out the new integration with Force.com via Visualforce.  However, whenever I try to execute a page with the FacebookConnection controller class, I get an error message saying "api_key is not set".  I followed the tutorial on the wiki, which I assume is the most recent, up-to-date version.  I have put the FB API Key and FB Secret values into a FacebookAppList__c record as demonstrated in the tutorial.

I also noticed that there is another object included in the Facebook package called FacebookApp__c.  Is this a deprecated object?  I notice that there are still multiple occurances of this in the existing Apex classes included with the package.  What is this for?  Do I need to create a FacebookApp__c record as well as the FacebookAppList__c record?  They both hold very similar information yet both are present in the existing Apex classes - including the FacebookConnection class.
I'm trying to install the Facebook toolkit as is described in the wiki.  However, when I try to connect to SVN repository location http://forcefacebook.googlecode.com/svn/trunk/, I get a popup window that says "Folder '' does not exist remotely" and the console displays "General filesystem error svn: Repository access denied."

Has anyone successfully checked out these resources using the aforementioned respository?
From the sounds of it, this will be a great tool once Summer '08 rolls out. However, I have a couple questions and haven't been able to find any pre-release documentation to clarify them. Hopefully someone else has figured them out or can shed some insight.

  1. I noticed that snapshots can only be scheduled at 11 pm. I have to assume that this is just a pre-release limitation? Once the update rolls out will we have access to the full 24-hour spectrum?
  2. Where are the snapshot objects actually stored? I figured it would be on the object tab (the reported object, that is) since it doesn't necessarily apply to specific records - although I have checked the records as well. Didn't see the analytic history as a related list option, didn't see anything in the object setup, I tried creating a report on the custom object that I had a snapshot on and encountered an internal server error (actually, this happened on all objects). I know an object is created for these snapshots but finding them has proven quite a task.
Any help will be much appreciated!
Since the introduction of the Winter '08 release, we have come across this peculiar situation. It seems that the WSDL (we are using the Enterprise WSDL) only includes fields that are displayed in the object's page layout. When fields that we want to completely remove from the page layout for all users (utility fields or other unimportant-to-the-user fields), but still want access to via the API so we may continue to associate the info with the object are not present in the page layout, we lose all ability to access them.

Here is the error I receive:
INVALID_FIELD: Field name provided, Custom_Field__c is not readable for Object__c

Is this a Winter '08 update? If so, why would this limitation be imposed now? Is this documented anywhere in the release notes? Is there any way to get around this so we may access all fields, not just the ones included in the page layout?

Thanks in advance!

Message Edited by jpizzala on 11-09-2007 04:09 PM

We have been developing an application that utilizes the following XML pulling concept to gather report data:

 

http://sfdc-heretic.warped-minds.com/2006/04/10/progmatic-access-to-salesforcecom-reports/

 

Prior to the Summer '10 release, we were able to grab this information just fine.  Now, however, all we can get is the login screen when we request a specific report.  Did something change in this (unsupported) process?  Is there another way we can programmatically get to this information?

Three or four days ago, I started experiencing difficulties logging into Salesforce from Linux (Ubuntu).  My machine is dual-booted with Windows Vista, which was not having any problems logging in.
 

Firefox 3.5.5, Chrome Beta and Opera 10.00 all reflect the same problem, which originally led me to believe that maybe there was something in a recent Linux update (however unlikely) that caused the conflict.  I couldn't find anything out of the ordinary as I was able to navigate all other sites just fine.  The only sites I had any problems with at all were the ones on the Salesforce domains (i.e. ideas.salesforce.com, login.salesforce.com, developer.salesforce.com, www.salesforce.com, etc.).  When I would go to https://login.salesforce.com, it would just spin forever and never resolve.  I am able to ping these subdomains just fine and lynx (text browser) doesn't appear to have the issue so much.
 

Today, I tried clearing all cache and cookies from the three browsers and tried again.  I was able to access the https://login.salesforce.com page once in each browser, but when I put my credentials in, it would never actually redirect me to my org.  I tried this with multiple orgs with the same result (clearing cache and cookies before each attempt).  If I fail to clear the cache and cookies and try to load the login page a second time, it will not resolve.

 
To further compound this oddity, I was able to successfully login to a couple orgs by explicitly specifying the node in the login URL (i.e. https://na3.salesforce.com).  I have been playing around with the cookies that are created during these sessions and the problem seems to reside in the "salesforce.com" domain set of cookies.  Each subdomain has its own set of cookies (i.e. these community boards store cookies under the "community.salesforce.com" label) which don't appear to be the root of the problem.

 

The only way I am able to login and make this post was if I keep the cookies window open (I'm using FF at the moment) and delete the "salesforce.com" folder whenever it popped up.  The "community.salesforce.com" folder remains and doesn't appear to be causing any harm from what I've noticed so far.  In Ubuntu, I am only able to get as far as creating this message.  In order to post it, I've had to switch to Vista, paste what I wrote in Ubuntu and press the Post button from here.  Ubuntu would not complete the posting transaction.


This still may be some obscure bug in my own configuration, but I figured I'd throw it out there to see if anyone else was experiencing similar symptoms.

Hello Friends,

 

Can any one tell me that the following requirement can be done or not?

 

I have 2 custom objects Company, Contacts. In the Contacts object I have  a custom picklist ContactName

consists of names like 'CEO','Manager','employee'

 

The thing is while creating contacts for a single company , i need the users to select the ContactName 'CEO' only for one time. I do not want to use Apex class to save the records, using the native save functionality can we achieve this kind of functionality.

 

Please let me know,

 

 

Thanks,

 

 

 

  • December 11, 2009
  • Like
  • 0

Has anyone figured out a way to show a last activity date on accounts for both open and completed activities?  Basically I am just trying to find a way to show the last time someone did any kind of task work on an account.

 

Thanks in advance for any help!

  • December 10, 2009
  • Like
  • 0

Hi,

 

I am developing an BI application. I would like to access to Salesforce sample data for Opportunities, Leads and Accounts.

 

Pls let me know where I can get this.

 

Thanks.

 

Sunil

I'd like to have a picklist field that does not allow a user to enter text not in the picklist options.  Can this be done?  If so.....how?  I came across the restrictedPickList attribute in the API docs, but no info on how to set this.

 

Thanks

  • May 02, 2009
  • Like
  • 0

I'm curious if anybody knows how to simulate a document "attachment" to a case object?  I'm trying to write a test method that is attaching a document to the case.  Here is what I have for the test so far...

 

 

static testMethod void ContactNullTest() { test.starttest(); Case testCase = new Case(); testCase.ContactId = null; ApexPages.StandardController sc = new ApexPages.StandardController(testCase); hdWebForm scExt = new hdWebForm(sc); testCase = (Case)sc.getRecord(); Contact objContact; String UserDepartment; String UserLocation; ID currUserID = UserInfo.getUserID(); //UserID = currUserID; Boolean blnHasContactAssociated; test.stoptest(); }

 

 

 

When I try to open a file in Excel 2007 exported from Salesforce Report, I receive the following warning message:
The file you are trying to open, xxxx.xls is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?

Help text from Excel 2007 reveals that "The warning message is a user-notification function that was added to Excel 2007. The warning message can help prevent unexpected problems that might occur because of possible incompatibility between the actual content of the file and the file name extension."

 

A case logged with Salesforce replied that they do not have such problem. Does anyone encounter the same issue? Is there any compatibility issue on MS Office 2007 with Salesforce? Any advise is greatly appreciated.

 

We have parent child account relationships. I currently calculate the RMR rollup on child accounts.

I want the parent account to also display of all RMR rollups on child accounts.

 

How can I achieve this?

 

Thanks 

Hi,

 

I am querying custom objects in SF using webservices. Is there a way I can fetch only the nth batch of records from a select statement.

 

For example -there are 100 results for "select id from account order by created date". I want only results numbering 21-30.  Is there any way I can achieve this?

 

There is a limit command I can use with the select statement, but that only gives me the first n records.

 

Thanks,

Odie

  • April 22, 2009
  • Like
  • 0

Hi

 

I am using the getSelected() function from the standard controller in a apex class and it breaks when a annual revenve filter is inserted for eg: 70000000 which is automatically converted to 7.0E7

 

The error I get is:

 

Account WHERE ((AnnualRevenue < 7.0E7)) ORDER BY Name ASC LIMIT 10000 ^ ERROR at Row:1:Column:51 unexpected token: E7

 

I am not sure how to fix this as the error is returned by a internal function. No help in debug logs and no error email either.

 

Any help would be greatly appreciated.

 

We are coming across the "Failed to send request" error (pictured below) when importing data via Data Loader UI.  This seems to be happening anywhere between records 5,000 and 5,600 (out of a 6,000+ record CSV file).  On the SF end, we have an after insert/update trigger on this object (just something to keep in mind since the trigger is processing these records as they are imported).

 

It appears that this is an issue outside of the data set since the errors would otherwise be written to the resulting failure file generated by Data Loader. The import process takes ~15 minutes to get to the 5,000 record mark so I wouldn't think that the connection is timing out or anything.

 

Anyone have any ideas?

 

 Data Loader Failed To Send Request Error

I have a lookup relationship between Object A and B, in object A I have a lookup field, while in Object B I have a related list.

 

I would like to be able to limit the number of Object A that reference Object B to 3, how can this be done?

 

Thanks

I built a custom object that is going to basically be clone or very similar to cases.  It is related to the account and i want the ability to close out just like a case.  I am attempting to create a custom button for close that brings you to a different page layout where you would put in the resolution etc.  then the status would be changed to close.  Once the object is closed that would be the default page layout people see when they go to that particular record. 

 

Anyone have any suggestions on the java script i would need to do this?  I am sure it is fairly simple as it is done on cases.  Thanks in advance for the help.

I have created a custom object with lookups to various standard SF objects (Account, Contact, Opportunity, Lead and Case).  My Visualforce page contains a very basic form with all available fields set up as <apex:inputField> elements and this works as expected - as Visualforce.  Now my intention for this page is to make it available via Sites.  However, when I expose this VF page on my site, the lookups fail (and give me the error in the subject line).  It appears that some common SF components are not made available for Sites usage.  Is this true?  I hope I am just missing something simple.

 

This is a very basic proof-of-concept implementation.  The Sites profile has read/write access to my custom object, read access to all standard objects listed above and no custom extensions have been implemented yet so no additional Apex classes are necessary for this page.

 

My code is below:

 

 

<apex:page standardController="Foo__c" showHeader="false">
<apex:messages />
<apex:form >
<apex:outputPanel layout="block">
<apex:outputLabel for="subject" value="Subject"/>
<apex:inputText id="subject" value="{!Foo__c.Subject__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="body" value="Body"/>
<apex:inputField id="body" value="{!Foo__c.Body__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="case" value="Case"/>
<apex:inputField id="case" value="{!Foo__c.Case__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="account" value="Account"/>
<apex:inputField id="account" value="{!Foo__c.Account__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="opportunity" value="Opportunity"/>
<apex:inputField id="opportunity" value="{!Foo__c.Opportunity__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="contact" value="Contact"/>
<apex:inputField id="contact" value="{!Foo__c.Contact__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block">
<apex:outputLabel for="lead" value="Lead"/>
<apex:inputField id="lead" value="{!Foo__c.Lead__c}"/>
</apex:outputPanel>
<apex:commandButton id="save" action="{!save}" value="Save"/>
</apex:form>
</apex:page>

 

 

 Any ideas would be much appreciated!

I have a trigger which prepopulate a filed before insert, but it does not work.

 

 

trigger GetLastAssocID on Obj__c (before insert) {

 

for (Obj__c ori: System.Trigger.New){

 

  if (ori.ObjName__c == ''){

  ori.Obj_ID__c = [Select Obj_ID__c from

                         Obj__c

                         Order by Obj_ID__c Desc

                         Limit 1];

  }

 }

}

 

 

Obj__c is an object I created and Obj_ID is a number(Double) field.

  • January 29, 2009
  • Like
  • 0

Hello

 

Is it possible to package Force.com sites? I cannot see any simple way to do it besides packaging the pages etc. and then setting up sites post installation.

I have a "contact me" form on a dev site that, upon submission, creates a Task for me.  This works perfectly well inside of SF as a standard Visualforce page, however I get the following error when trying to submit the form on a sites page:

Code:
j_id0:j_id1:contactForm:j_id12: An error occurred when processing your submitted information.
j_id0:j_id1:contactForm:j_id15: An error occurred when processing your submitted information. 

Where j_id12 is the Subject input box and j_id15 is the Message input textarea (code below):

Code:
<apex:page standardController="Task" extensions="ActivityController" showHeader="false">
 <apex:composition template="PersonalTemplate">
  <apex:define name="body">
   <div id="contact" class="sectiontitle"/>
   <apex:outputPanel layout="block" styleClass="errorDisplay">
    <apex:messages />
   </apex:outputPanel>
   <apex:form id="contactForm">
    <fieldset>
     <legend>Send questions, comments, or suggestions here</legend>
     <apex:outputPanel layout="block">
      <apex:outputLabel for="subject" value="subject:"/>
      <apex:inputText value="{!Task.subject}"/>
     </apex:outputPanel>
     <apex:outputPanel layout="block">
      <apex:outputLabel for="message" value="message:"/>
      <apex:inputTextArea value="{!Task.description}"/>
     </apex:outputPanel>
     <apex:outputPanel layout="block" rendered="true">
      <apex:commandButton action="{!saveTask}" value="Send" styleClass="submit" style=""/>
     </apex:outputPanel>
    </fieldset>
   </apex:form>
  </apex:define>
 </apex:composition>
</apex:page>

Code:
public class ActivityController {
 
 private ApexPages.StandardController controller = null;
 
 public ActivityController( ApexPages.StandardController controller ) {
  
  this.controller = controller;
  
 }

 public PageReference saveTask() {

  controller.save();
  
  PageReference page = new PageReference( '/apex/PersonalContactSuccess' );
  page.setRedirect( true );
  
  return page;
  
 }

}


As far as I know, all Visualforce pages and Apex classes are available for the site and the site profile.  It acts like there is a security barrier between sites and activities that I cannot change via the site profile.

Any ideas would be much appreciated!



Can you have a Record Type Dependent Validation Rule? If so, what would a sample Formula look like for an Opportunity Record Type Validation.
 
Thank you for any assistance to this topic.