• um-dontaskme
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies

I've created a button on Account list views that takes the selected Accounts from a standard list view and passes them to a visualforce page to mass assign tasks.  The page uses the StandardSetController for the Accounts, with an extension.

 

Everything's fine, except certain fields being used in the Account list view throw errors.  Basically, it looks like the list views allow you to use criteria that the standard set controllers cannot, like sorting by a multi-select picklist field.

 

But the real stumper is using currency criteria.  I can create a view of all Accounts in Germany with less than $50,000,000 in annual revenue.  But, I get an error when passing these accounts into the standard set controller, because it says:

and (AnnualRevenue < USD5.0000001E7) ^ ERROR at Row:4:Column:21 unexpected token: 'USD5.0000001E7'

 

That's the whole error, and the row and column don't relate to my code.  I'm guessing they are in the standard set controller?  It appears the issue is that it is treating the built-in AnnualRevenue field as scientific notation, which the standard set controller can't handle.  So why can't I pass Accounts from a list view into a list controller without bugs?  And how do I correct this specific one without having to write an entire custom controller that somehow ensures that currency fields are treated as numbers?

I've created a Visualforce page that overrides the standard task view.  It uses the standard task controller with a custom extension.  In addition to the basic task fields, it also displays key fields from the Contact, Account, Lead, Opportunity or Campaign Member record, depending on what the Task is linked to.  They are input fields, so we can make edits to the related objects without clicking around.  It's primarily a tool for telemarketing.

 

Anyway, the page works great, except in Console view, where the mini page layout does not update.  I would like it to show the mini page layout that is standard for a task. 

 

I know that if I add the apex:detail section for the task, the mini page layout will work.  But this is reduntant to fields I've already got on my page, and causes issues with buttons in the detail sections and buttons on my custom page being in separate places.

 

I tried rendered="false" on the detail section, but that will not allow the mini page layout to work.  Any suggestions on how to tell the page to call the task mini page layout?

 

Also, any way to make the pageblocksections on my custom page remember whether the user has collapsed them?  Right now they expand every time.

 

Thanks, all!

Sorry, I've spent several days digging, but I can't come up with it.  I'm probably missing something simple.

 

I have a Visualforce page that allows users to select their list of available Account views, then displays the accounts in that view.  I am displaying the list in a dataTable instead of a dataList, but otherwise it is just as described in the developer guide:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_sosc_list_views.htm

 

For example, to create a simple list of accounts with a list view, create a page with the following markup:
<apex:page standardController="Account" recordSetvar="accounts">
  <apex:pageBlock title="Viewing Accounts">
  <apex:form id="theForm">
    <apex:panelGrid columns="2">
      <apex:outputLabel value="View:"/>
      <apex:selectList value="{!filterId}" size="1">
        <apex:actionSupport event="onchange" rerender="list"/>
        <apex:selectOptions value="{!listviewoptions}"/>
      </apex:selectList>
    </apex:panelGrid>
    <apex:pageBlockSection >
      <apex:dataList var="a" value="{!accounts}" id="list">
        {!a.name}
      </apex:dataList>
    </apex:pageBlockSection>
  </apex:form> 
  </apex:pageBlock>
</apex:page>

 

This page is associated with the standard account controller and the <apex:selectlist> component is populated by {!listviewoptions}, which evaluates to the list views the user can see. When the user chooses a value from the drop-down list, it is bound to the filterId property for the controller. When the filterId is changed, the records available to the page changes, so, when the <apex:datalist> is updated, that value is used to update the list of records available to the page.

 

---------

 

But, I don't want to just display all the Accounts in the view.  I want to collect the records from that view and manipulate them in a controller extension.  Specifically, I want to gather them, add them to a list, then use SOQL to exclude some that are also part of a different list.  Then, I will use a dataTable to display the results of my final query.

 

I just can't figure out how to reference the Accounts in the selected view from the custom controller extension.  I know that on my Visualforce page, they are available as {!accounts}.  But, how do I pass that set of records or IDs from the selected view to my custom controller and gather them in a list?  Can anyone give me an example of the correct syntax to reference them?

 

Sorry if this is obvious, and thanks in advance for any help!!

 

Hi All,

 

I want to select records where the any of the values of two multi-selects match.

 

I am using includes which I think is the only way, but unless both multi-selects match, it doesn't return any values.

 

Any ideas?

 

Thanks

 

 

 

 

List<Account> fromLead = [select Id, Name, BillingCity, Country_ISO_Code__c, Type, Accreditations__c from Account where 
 	 			
 	 				Type = 'Dealer' 
 	 				
 	 				AND Country_ISO_Code__c =: lead.Country_ISO__c
 	 				
 	 			
 	 				
 	 				AND Accreditations__c includes (: lead.All_Accreditation_Endorsements__c ) 
 	 				
 	 				AND Accreditations__c != null
 	 				
 	 				LIMIT 1000];
 	 				
 	 				accs = fromLead;

 

 

Sorry, I've spent several days digging, but I can't come up with it.  I'm probably missing something simple.

 

I have a Visualforce page that allows users to select their list of available Account views, then displays the accounts in that view.  I am displaying the list in a dataTable instead of a dataList, but otherwise it is just as described in the developer guide:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_sosc_list_views.htm

 

For example, to create a simple list of accounts with a list view, create a page with the following markup:
<apex:page standardController="Account" recordSetvar="accounts">
  <apex:pageBlock title="Viewing Accounts">
  <apex:form id="theForm">
    <apex:panelGrid columns="2">
      <apex:outputLabel value="View:"/>
      <apex:selectList value="{!filterId}" size="1">
        <apex:actionSupport event="onchange" rerender="list"/>
        <apex:selectOptions value="{!listviewoptions}"/>
      </apex:selectList>
    </apex:panelGrid>
    <apex:pageBlockSection >
      <apex:dataList var="a" value="{!accounts}" id="list">
        {!a.name}
      </apex:dataList>
    </apex:pageBlockSection>
  </apex:form> 
  </apex:pageBlock>
</apex:page>

 

This page is associated with the standard account controller and the <apex:selectlist> component is populated by {!listviewoptions}, which evaluates to the list views the user can see. When the user chooses a value from the drop-down list, it is bound to the filterId property for the controller. When the filterId is changed, the records available to the page changes, so, when the <apex:datalist> is updated, that value is used to update the list of records available to the page.

 

---------

 

But, I don't want to just display all the Accounts in the view.  I want to collect the records from that view and manipulate them in a controller extension.  Specifically, I want to gather them, add them to a list, then use SOQL to exclude some that are also part of a different list.  Then, I will use a dataTable to display the results of my final query.

 

I just can't figure out how to reference the Accounts in the selected view from the custom controller extension.  I know that on my Visualforce page, they are available as {!accounts}.  But, how do I pass that set of records or IDs from the selected view to my custom controller and gather them in a list?  Can anyone give me an example of the correct syntax to reference them?

 

Sorry if this is obvious, and thanks in advance for any help!!

 

Hi all,

 

I'm trying to update campaign member status with Apex.

 

I created Visualforce page.

In save() method, I tried to update campaign member status.

 

Here is my code.

 

//current value CampaignMemberStatus oldDefault = [select Id from CampaignMemberStatus where CampaignId = :currentId and isDefault = true LIMIT 1]; CampaignMemberStatus oldRespond = [select Id from CampaignMemberStatus where CampaignId = :currentId and HasResponded = true LIMIT 1]; //update label (It's a default) CampaignMemberStatus oldstatus = new CampaignMemberStatus( Id = oldDefault.Id, Label = 'entry'); update oldstatus; //change sortorder (It's hasResponded) CampaignMemberStatus oldorder = new CampaignMemberStatus( Id = oldRespond.Id, SortOrder = 3); update oldorder; //add attend CampaignMemberStatus newstatus = new CampaignMemberStatus( CampaignId = currentId, Label = 'attend', SortOrder = 2, isDefault = false, HasResponded = false); insert newstatus;

 

I can change SortOrder and insert attend(not default and not hasresponded value).

But I can't update the default's label.

 

Is it impossible?

How can I do?

 

Any solution to this problem is greatly appreciated.

 

astraea

I'm using ajax in a VF page via the actionsupport call and can rerender a section (notes) based on the column, but can't see how to determine the current row of a pageBlockTable.  Here's a snippet:
 

VF:

<apex:column headerValue="{!sunTitle}">

    <apex:inputField id="sunday"value="{!hoursList.Sunday__c}" style="width: 40px">

    <apex:actionsupport event="onfocus" action="{!sunNotes}" rerender="notes"/>

    </apex:inputField>

</apex:column>

 

Apex:

public PageReference sunNotes()

{

   refreshTotals();

   currentNote = 'Sunday';

   notesValue = Hours[currentHour].SundayNotes__c;

   noteIsActive = true;

   return null;

}

 

Where currentHour (an integer) would equal the current row in my pageBlockTable, ideally.  Any help you could provide would be seriously appreciated.

 

Thanks!!

Adam