• Ems
  • NEWBIE
  • 0 Points
  • Member since 2008

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

I have a component that I want to render based on the opposite of a checkbox setting...

 

THis works fine:

<apex:pageblock rendered="{!pitem.Sold__c}">

 

But I can't figure out how to NOT (or !) pitem.Sold__c

 

This doesn't work (nor do many different combinations of quotes and !s that I've tried.

<apex:pageblock rendered=NOT(pitem.Description)>

 

 

Anybody have a solution to this simple problem???

  • January 08, 2010
  • Like
  • 0

The basic goal is to select a category on the left hand side of the page, and reload the entire page with content based on that category.  For some weird reason this works the first time the user selects a category, but never again! Page loads with category "all" selected, first selection of category reloads page with data just for that category, and all succesive selects reload the page with whatever the last selection was!!!

 

Visualforce:

 

<apex:datatable value="{!Categories}" var="cat" styleClass="catalog_menu"> <apex:column headerValue="Categories"> <apex:commandLink action="{!selectCategory}" value="{!cat}"> <apex:param name="ctgry" value="{!cat}"/> </apex:commandLink> </apex:column> </apex:datatable>

 

Controller:

 

public PageReference selectCategory() { setCtgry(); setItems(); //executes the SOQL that selects the content to show on the page PageReference pageref = ApexPages.currentPage(); pageref.setRedirect(true); return pageref; } public void setCtgry() { String cat = ApexPages.currentPage().getParameters().get('ctgry'); if(cat == null) cat = 'All'; currCategory = cat; } public void setItems(){ if (currCategory != null && currCategory != 'All') Items = [Select o.Id from Opportunity o where o.Auction_Category__c = :currCategory order by o.Item_Number__c]; else Items = [Select o.Id from Opportunity o order by o.Item_Number__c]; }

 

 

 

 My best guess is I'm not understanding how the SelectCategory PageReference returned is being handled - I THINK that the page reference returned by SelectCategory is used to reload the page.... but given that I am setting parameters for the page, whydo they never show up in the address bar of the browser?

 

Any help greatly appreciated!

 

 

  • January 01, 2010
  • Like
  • 0

I have a datatable  with a column of command links - each link sets a parameter that I want to use to drive a data source for a different datatable on the page (basically select the category should drive what items display).

 

For some reason ALL of the parameters show up as whatever the first selection is!

 

Mind - if you insert the category parameter in the URL everything works fine - I'd just rather do this without refreshing the page every time.

 

... <apex:form> <apex:datatable value="{!Categories}" var="cat" > <apex:column headerValue="Categories"> <apex:commandLink action="{!selectCategory}" value="{!cat}" rerender="goodstuff"> <apex:param name="ctgry" value="{!cat}"/> </apex:commandLink> </apex:column> </apex:datatable> </apex:form> <apex:outputPanel id="goodstuff"> ...other data table showing items here...

 

Thank you community!

  • December 14, 2009
  • Like
  • 0

I have a data table exposing Opportunity fields on a visual force page. It works fine within Salesforce.  I created a site, set the page as the home page for my site, and no data shows.  The page title and column headers show fine, so I know it's not a security issue with the entire page.

 

I have set the field accesibility of every field I am referencing, used the Public Access button to make sure the opportunities object is readable, and checked everything I can think of.

 

The only thing that I can imagine is affecting this is that I am using record types on Opportunities, but I can't find any settings to change behavior based on record types. My visual force code doesn't reference record types at all, and all records are shown when I access the page within salesforce.com

 

Any suggestions would be greatly appreciated - I'm excited about getting my first site up and running, and if I can't expose data it won't be much use!

  • December 02, 2009
  • Like
  • 0

Hi all,

 

I've got a custom object set up to hold analytic snapshot results, and I'd really like to name the records in a more user-friendly way than an autonumber.

 

Currently - I've got the record name = {mm}/{dd}/{yy} - {0}

 

What I'd like to do is have record name = {mm}/{dd}/{yy} - {Custom field in record}

 

Because this object is used in an analytic snapshot I can't write a trigger to do this.  Any other suggestions?

 

(I couldn't find any documentation to suggest you can't use a text field for the name of the record, but I can't figure out what would set this value when the snapshot runs)

 

Thanks,
Emily

  • July 15, 2009
  • Like
  • 0

I have 1,042,367 records that need to be deleted in SF (please don't ask how I got here!)

 

I've written code which works perfectly in the sandbox and deletes 10,000 records at a time, but I can't get it to deploy to production... I keep getting the error "System exception: Too many query rows: 1002" when I validate the deployment, although all tests run beautifully in sandbox, even with large amounts of data.

 

Heres the code, it literally deletes listings for a particular MLS if they have a checkbox marked that indicates they should be deleted. (I'm trying to get it to work from a button on the MLS page layout for now, the hope it to set it off in a trigger designated as @future once this is working)

 

 Webservice static integer CleanListingObjectNOW(String db_name)

 

 

    integer cnt = 0;    List<Listing__c> to_del = new List<Listing__C>();

    MLS__c mls = [select id from MLS__C where Database_Name__c =: db_name limit 1];

     for(Integer x=0; x<10;x++){    to_del = new List<Listing__c>([select ID from Listing__c where MLS__C =: mls.id AND Delete_Row__c = true limit 1000]);

    integer sz = to_del.size();

    cnt += sz;

     if (sz > 0)

         delete to_del;

     else

           break;

    to_del.clear();

    }

 

return cnt;

}

 

Any ideas why this would hit governor limits in enterprise production environment but not in our sandbox???

 

THanks,

EMily

 

  • April 19, 2009
  • Like
  • 0

I have a component that I want to render based on the opposite of a checkbox setting...

 

THis works fine:

<apex:pageblock rendered="{!pitem.Sold__c}">

 

But I can't figure out how to NOT (or !) pitem.Sold__c

 

This doesn't work (nor do many different combinations of quotes and !s that I've tried.

<apex:pageblock rendered=NOT(pitem.Description)>

 

 

Anybody have a solution to this simple problem???

  • January 08, 2010
  • Like
  • 0

I have a data table exposing Opportunity fields on a visual force page. It works fine within Salesforce.  I created a site, set the page as the home page for my site, and no data shows.  The page title and column headers show fine, so I know it's not a security issue with the entire page.

 

I have set the field accesibility of every field I am referencing, used the Public Access button to make sure the opportunities object is readable, and checked everything I can think of.

 

The only thing that I can imagine is affecting this is that I am using record types on Opportunities, but I can't find any settings to change behavior based on record types. My visual force code doesn't reference record types at all, and all records are shown when I access the page within salesforce.com

 

Any suggestions would be greatly appreciated - I'm excited about getting my first site up and running, and if I can't expose data it won't be much use!

  • December 02, 2009
  • Like
  • 0

Is it possible to define sub sections of my root domain?   So, if my root domain is http://www.mydomain.com and I need sections for products, blogs, and profiles, how do I setup http://www.mydomain.com/products, http://www.mydomain.com/blogs, and http://www.mydomain.com/profiles?

 

Also, is there anyway to use masking for the detail page urls so i can use SEO friendly names rather than the querystring parameters?

 

Thanks!

 

Adam

Hi all,

 

I've got a custom object set up to hold analytic snapshot results, and I'd really like to name the records in a more user-friendly way than an autonumber.

 

Currently - I've got the record name = {mm}/{dd}/{yy} - {0}

 

What I'd like to do is have record name = {mm}/{dd}/{yy} - {Custom field in record}

 

Because this object is used in an analytic snapshot I can't write a trigger to do this.  Any other suggestions?

 

(I couldn't find any documentation to suggest you can't use a text field for the name of the record, but I can't figure out what would set this value when the snapshot runs)

 

Thanks,
Emily

  • July 15, 2009
  • Like
  • 0

Hi

 

Unfortuneately I have stumbled at the first hurdle, but I am sure there is an easy explanation. Using eclipse .4.2 i am trying to create a new salesforce.com project and get an error when trying to login. I can login manually absolutely fine via the web. The password includes the security token. but i get a dialog

 

" Uable to connect to hostname www.salesforce.com:

 

invalid Username, password, security token or user is locked out.

 

Any ideas?

I have 1,042,367 records that need to be deleted in SF (please don't ask how I got here!)

 

I've written code which works perfectly in the sandbox and deletes 10,000 records at a time, but I can't get it to deploy to production... I keep getting the error "System exception: Too many query rows: 1002" when I validate the deployment, although all tests run beautifully in sandbox, even with large amounts of data.

 

Heres the code, it literally deletes listings for a particular MLS if they have a checkbox marked that indicates they should be deleted. (I'm trying to get it to work from a button on the MLS page layout for now, the hope it to set it off in a trigger designated as @future once this is working)

 

 Webservice static integer CleanListingObjectNOW(String db_name)

 

 

    integer cnt = 0;    List<Listing__c> to_del = new List<Listing__C>();

    MLS__c mls = [select id from MLS__C where Database_Name__c =: db_name limit 1];

     for(Integer x=0; x<10;x++){    to_del = new List<Listing__c>([select ID from Listing__c where MLS__C =: mls.id AND Delete_Row__c = true limit 1000]);

    integer sz = to_del.size();

    cnt += sz;

     if (sz > 0)

         delete to_del;

     else

           break;

    to_del.clear();

    }

 

return cnt;

}

 

Any ideas why this would hit governor limits in enterprise production environment but not in our sandbox???

 

THanks,

EMily

 

  • April 19, 2009
  • Like
  • 0

I would like to send an email using an HTML email template to a contact as follows:

 

30 days prior to each appointment scheduled

1 day prior to each appointment scheduled

 

For example, if I schedule an event with a contact on April 30th, I want an email to be sent out April 1st and on April 29th. Both emails would use the same email template.

 

I have used workflow rules with immediate and time-dependent workflow actions with no success. My evaluation criteria on the workflow rule is everytime a contact is created or edited and when the previous criteria were not successful. I am using the contact object as the basis for the workflow rule, because I cannot send out workflow email alerts on events. I am trying to use the Last Activity field on the Contact object as a basis for the date on which to base on the workflow rule. So, the latest scheduled event would be the basis on which the event email gets triggered.

 

Has anyone ever configured anything like this before.

Hello, Sirs.

 

I have such Email template:

 

Dear {!Contact.FirstName},
Secret code is - {!??????????}

 

I must insert into email message my specific text message ( instead ???????? ).

 

 

 

Apex Code:

//AcID - Contact ID


//Eml - Email Template ID

 

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

mail.setReplyTo('support@force.com');
mail.setSenderDisplayName('Salesforce Support');
mail.setTargetObjectId(AcId);
mail.setTemplateId(EmlId);

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

 

Which way I can do it ?


Thank you.

 

Message Edited by Olbrest on 03-04-2009 06:59 PM
Would you please help me to display Notes & Attachments on a Visual Force page having CUSTOM controller ?
Is there any tag for it ?

I am integrating salesforce with order, delivery, and invoice information from SAP.  I want this information to be available to our customer portal users.  The way that our SAP data is set up, we have a one-to-one relationship between order, delivery, and invoice line items, so the integration becomes MUCH easier when we can just pass all the line items to one custom object rather than trying to integrate header info and line items into 6 different related custom objects. 
This solution would make for simple reports that our portal users could understand.  However, I also want portal users to receive email alerts for things such as new deliveries, invoices due in a few days, etc.  Each delivery or invoice has a few line items, though, so in this case users would get an email for every line item.  For example if a shipment was sent to them with three line items, they would get three line items when it shipped, and then three more when the invoice was due.  Is there a way to limit the number of emails sent to a user to one a day?  Does anyone have any other ideas of a good way to accomplish what I want?  Any help would be much appreciated!
Hi,
 
We need to use salesforce email templates from a trigger or Apex class. The template has most of the merge fields from a custom object named "Assignment__c" and the email needs to be sent to the custom email field in another custom object named "Contractor__c".
 
Is this possible using the following code snippet?  We tried it but was throwing exception saying that it supports only standard objects by Users, Lead and Contacts.
 
   mail.setTemplateId(templateId);
   mail.setTargetObjectId ('01I700000002M9A');
   mail.setWhatId(AssignmentId);
 
Any help or guidelines with some sample code on how this can be done will be greatly appreciated. Thanks and let me know if you need any other information.
 
Regards,
Rasu
  • November 20, 2008
  • Like
  • 0
Is something like this possible using a formula field? I want to add a numberfield (number of months in 'Estimated_Time_For_Exection__c') to a start date, to calculate the end date.
 
The formula below gives an error:
 
Code:
DATE(YEAR(Start_Date__c),MONTH(Start_Date__c)+ Estimated_Time_For_Exection__c ,DAY(Start_Date__c))

 
Hi,

My company has a dashboard set up for a particular account as a sort of "global template".  The dashboard is build off of underlying reports, primarily related to Opportunities.  Some of the elements are the equivalent of roll-up summary fields you could put on an Account record (e.g. Total Open Opportunities).  In total, we have about 20 elements on this "global template" dashboard. 

The challenge:  Is there a way to create a standard "template" for creating a dashboard quickly and populating the underlying reports with the data from an account that you specify?  The problem is that our company wants to perform this type of analysis on a large number of accounts (90+).  Multiply that by the number of individual elements / reports on each page, and you start to see what a time-consuming process this would be.

So far, our team has looked at creating a sort of "dynamic" dashboard link on the Account record.  When the user clicks on it, It launches a separate Visualforce page that brings in the roll-up summary field values, and includes links to "dynamic reports" (i.e. the link grabs the {!Account.Name} field and pushes it into the appropriate report parameters).  Still, this isn't quite what we would like to do, as we would (ideally) like to display all the info on one page.  It should be pointed out that we won't need to "save" these dashboards anywhere, though that would be potentially valuable if we could.

Appreciate any thoughts.

I have an S-control that just takes the id that's passed to it (it's the Id of a new record just saved), performs a SoQL query and then redirects the user to a related record.  It works perfectly for system admins, but not for one of the users- it just sits there blank without redirecting.  I logged on as that user and was able to recreate the issue, which indicates this is something to do with permissioning. 

With some alert calls in the s-control, I was able to pinpoint that the javascript just stops when it tries to perform the SoQL query.  The user profile for this user has rights to the object being queried, has the API enabled and I tried adding a couple rights to the profile- View All Data and View Configuration, but to no end.  Is there a setting, in the profile or elsewhere, that would prevent a user from being able to run a SoQL query in an S-Control? 

I have similar s-controls in different salesforce instances and have never hit this before, very frustrating!
Relating to the article titled The Quick Email Button in the Service & Support Blog of Successforce, I had the following query:

I'm trying to co-opt what Marco Casalaina did for a Case to create a link for an Opportunity.  I'm calling it "quick close email" which, as planned, will allow a rep to pull up our closing email template with one click from the Opportunity page. The syntax I am using follows:

Code:
location.replace('/email/author/emailauthor.jsp—retURL=/{!Opportunity.Id}&p3_lkid={!Opportunity.Id}&rtype=003&p2_lkid={!ContactId}&template_id=<your template here>');

Where "your template here" is the 15-character ID for the email template I would like to use.

Unfortunately, there's something wrong with the command -- it returns an "Unable to Access Page" message when launched from the opportunity. Doubly unfortunately, I know nothing about javascripts, so I can't troubleshoot this on my own. Any clues for me? Thx!
  • July 23, 2008
  • Like
  • 0
Is that possible to override UI/ behavior for "Mass EMAIL" process ?

1)I need to pass selected Leads/Contacts ids to Mass Email wizard somehow. ("Create New View" is not suitable for my case : ids should be gerenerated dynamically from another page ).
2)I need to add an extra step to "Mass Email"  wizard, where user can select optional information for template.
3)I need to skip template selection step. (Only one concrete template should be used )

I hope i can override standart controller? Or this is not possible at all and this functionality should be used "as is".

Thank you in advance.





Message Edited by vfDeveloper on 06-19-2008 02:49 AM