• wsuycott
  • NEWBIE
  • 25 Points
  • Member since 2006

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 11
    Replies

Have a tabbed account setup that loads numerous custom related lists - and this of course impacts load-time performance significantly (open opportunities list, closed opportunities list, our assets, competitors assets, etc.).  These are each located within their own tabpanels, then their own tab, and finally a form with VF to display.  The current controller loads all lists when the VF page loads - so I am frequently waiting for 15-20+ seconds for the page to display.

 

In trying to reduce initial load times I am trying to find a means of only loading the list and rendering the form when the user selects the tabPanel or when the individual tab beneath the panel, or the form beneath the tab comes into focus.  So far, numerous attempts to have the actionSupport action fire are not working.  The action method isn't getting called. 

 

Any ideas on where I have gone wrong?

<apex:tab label="Contacts" name="Contacts" id="tabContacts"> <apex:tabPanel switchType="client" id="tTbPnlCont" > <apex:tab label="Contact" name="Contact" id="tabContact"> <apex:form id="actConForm" > <apex:actionSupport event="onfocus" focus="actConForm" action="{!loadActiveContacts}" rerender="actConForm" status="actconstat"/> <apex:actionStatus id="actconstat" startText="Retrieving contacts" stopText=""/> <apex:pageblock id="ActContacts" title="Active Contacts" > <apex:pageBlockButtons > <apex:pageBlockTable id="ActCont" value="{!ActiveContact}" var="o" rendered="{!IF(activeContactFlag=True,true,false)}"> The Controller action method excerpt List<Contact> ActiveContact = null; Private Boolean activeContactFlag = False; public boolean getactiveContactFlag() { return activeContactFlag; } // // loadActiveContacts does not get executed per debug log // public PageReference loadActiveContacts() { system.debug('DEBUG: getActiveContacts called'); List<Contact> con = getActiveContact(); return null; } // // The code below works fine when referenced in VF pageBlockTable // without the render="{!IF(activeContactFlag=True,true,false)}" // public List<Contact> getActiveContact() { if(ActiveContact == null) { sortExpression = 'name'; sorterActiveContacts.originalList = [Select LastName,FirstName,email from Contact where AccountId = :acct.id and Inactive_contact__c = False ORDER BY LastName,FirstName LIMIT 1000]; ActiveContact = (List<Contact>) sorterActiveContacts.getSortedList(sortExpression, sortAscending); activeContactFlag = True; } return ActiveContact; }

 

onclick="navigateToUrl('/003/e');" within a VF button will work for while developing as the admin, but not for the others in the company that I try to test.  I have included all user profiles within the security of this VF page, and the users have the rights to add a new contact if they are not attempting to do so using the navigateToUrl.

 

Anyone have any ideas on what might be causing this.  I am running my tests in the CS2 sandbox and seem to be bumping my head against the wall today on about 6 different navigateToUrl statements that all work for the admin and none of them work when I login as a non-admin user.

We are building a tabbed environment with multiple table levels and a controller extension.  All of that is working fine. What is wrong is that the page is displaying in the very small font size that the hyperlinks from a standard Account page has at the top.  We are not familiar with how to change the font back to a more readable size and style.  We have the tabStyle="Account" in the page declaration however it doesn't change the fonts size.

 

Any help on how to get the font back into a normal size?

Once the users have completed editing their opportunity data, they tend to forget to scroll down to complete opportunity competitors, opportunity partners, and opportunity contact roles.   We would like to create a single screen in which edit both their opportunity and to add competitor records, partner records, and opportunity contact role information. We have multiple record-types based upon profile, so a means of factoring this in would need to be accomodated.  We would like to ideally embed edit capability for these other related list records within the main edit screen within their own scrollable sections (i.e. users could edit one or more lines of competitors, partners, contact roles each in their own section) and then have a method of updating all of these entities upon a single save. 

 

I am looking for some approaches that might be viable to solution this.  We have Apex experience, and very light VisualForce experience (i.e. can create a VF to represent a custom edit screen or view screen for a single object, have created standard controller extensions and custom controllers, however no experience in creating embedded scrollable input sections like described above).  Open to alternative approaches as well that would have the same net effect of ensuring users are presented with these sections to edit.

Having alittle challenge in building multi dimensional lists and maps for a bulk processing class.  This is being designed to handle thousands of records, and given the limitations of 1000 members per list or per map I have chosen to handle by creating multiple lists and maps to address this.

 

Current code frag I am working on is indicating that I have a List Index out of Bounds:

 

List<List<OpportunityTeamMember>> otm = new List<List<OpportunityTeamMember>>();

List<Map<string,OpportunityTeamMember>> oppMap = new List<Map<string,OpportunityTeamMember>>();

 

j = 0; 

 

for(OpportunityTeamMember opt: [Select o.id, o.opportunityid, o.teammemberrole, o.opportunityaccesslevel, o.userid,

o.Opportunity.accountid From OpportunityTeamMember o where o.Opportunity.accountid in :accIds and isDeleted = False

and userid in :userIds])

  {

   j = setOffset(i);       //  sets the variable j up by 1 for each 1000 records read to move to next list array

   opplist[j].add(opt);  //  adds the record read to the list

 

   i++;                      //  increment the record count

 }

 

// Now, build maps from each list and construct a compound key

 for(j=0; j<10; j++)  {

    for(OpportunityTeamMember ox1: opplist[j])  {      oppMap[j].put(ox1.userid +

':' + ox1.Opportunity.accountid + ':' + ox1.opportunityid, ox1);

   }

In looking at the debug log it shows that the code fails on the first iteration through the for select loop after reading the record and that the setOffset(i) is returning a zero as expected.  The code doesn't make it to the map building phase, but I would assume that there will be a similar issue there as well.

 

I am assuming that I am not dereferencing the list properly, or that I am not creating it properly, or both.  Any assistance would be appreciated. 

We have a process wherein new opportunities are initiated from a contact screen as a result of a relationship with a campaign.  We have an opportunity trigger, set for after insert, that will look to the OpportunityContactRole to pickup the id of the contact that initiated the opportunity (this is specific to opportunities opened from within a contact's related opportunity list), pickup the campaignid from the opportunity that was created, and will then lookup in the campaignmember object to update the status as responded if the contact is found in the campaignmember list, and if the contact isn't found it will insert the contact as a member of the campaign and set the status to responded.  The Apex trigger works and performs as expected.

 

The test code however is a challenge as we can:

create an account

create a contact

create a campaign

 

We now are ready to create the Opportunity - but the issue is we can't create an OpportunityContactRole and insert it before the Opportunity is created (no opportunity id exists at that point), hence the test code won't cover the code sections that do the work of looking up the contactid from the OpportunityContactRole.

 

When performed through interactive UI, SFDC is somehow inserting the OpportunityContactRole so that it is available to the trigger when the  "after insert" of the Opportunity occurs.  Not certain how I can create the same conditions for test code coverage purposes.  Looking for some ideas that will help resolve this.

We have a linked SQL server to Salesforce via dbAmp (but could also be from excel connector or other external API load tools) and are uploading tasks for Salesforce users.  What we would like is a method to also to perform the function "Send Notification Email" as the UI allows you to do. There doesn't seem to be a method for having this functionality, and unfortunately you can't have a workflow pickup a task to send an email. 

 

Is there a means of having that functionality kick of an email the same way it does from the interactive UI, or perhaps a secondary load into the EmailMessage object to accomplish the same thing, or is an APEX trigger the only means of accomplishing this?

Have a custom field at the Account level - current_assets__c and have added this field to the Inline Hierarchy component as:

 

<apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.account.Current_Assets__c}"/>

 

But when rendered it displays in scientific notation (i.e. USD 79,875,000.00 shows as 7.9875E+7)

We utilize multi-currency in our org so dollar fields are prefaced with USD vs. $.

 

Does anyone have ideas on how I can get this to work properly - either with $ or the USD notation?

creating a mass edit of related records and want the first 2 fields in the table to display, without wrapping. Have tried width statements, etc. without luck - continue to get wrapping on the first 2 (non-input) fields.
 
<apex:page standardController="Products_and_Services__c" extensions="extProductsServices"
  recordSetVar="Products_and_Services__c" tabstyle="Opportunity" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlockButtons >
  <apex:commandButton value="Save" action="{!save}"/>
  <apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="1">
  <apex:pageBlockTable columnswidth="100%" value="{!lstProductsServices}" var="prds">
     <apex:column width="100%" headerValue="Prd#" width="100%" value="{!prds.Name}"/>
     <apex:column width="100%" headerValue="Name" width="100%" value="{!prds.Product_Name__c}"/>
     <apex:column headerValue="Proc.Fee">
     <apex:inputField value="{!prds.Processing_Fee__c}"/>
</apex:column>
......
We have a custom object related to our Opportunity record and would like to use a mass edit of all records related to the parent Opportunity record.  The VF we have now is using the standard controller for the object as follows - however when we attempt to limit the records selected via the id passed in (i.e. https://tapp0.salesforce.com/apex/EditProducts?Opportunity__c=00660000008G7Ts ) the standard controller won't use the reference passed in to only return the records under the opportunity with the above ID - instead it shows the first 20 records of in the Products_and_Services__c object regardless of ID passed. 
 
In testing, instead of the ID of the parent Opportunity I also passed the id of just 1 specific Products_and_Services__c object (i.e. https://tapp0.salesforce.com/apex/EditProducts?id=a0060000009GxfH ) and still get the same reaction so it appears that the controller isn't referencing the id regardless of the base.  What action does the "recordSetVar" invoke and what name is it looking for ( the object API name is Products_and_Services__c, the object plural name is "Products and Services"). This record is in a master-detail relationship with the Opportunity record.
 
<apex:page standardController="Products_and_Services__c"
  recordSetVar="Products_and_Services__c" tabstyle="Opportunity" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlockButtons >
  <apex:commandButton value="Save" action="{!save}"/>
  <apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!Products_and_Services__c}" var="prds">
<apex:column headerValue="Prod#"
 value="{!prds.Name}">
</apex:column>
<apex:column headerValue="Product Name"  value="{!prds.Product_Name__c}">
  </apex:column>
    <apex:column headerValue="Proc.Fee">
       <apex:inputField value="{!prds.Processing_Fee__c}"/>
     </apex:column>
     <apex:column headerValue="Mnt.Term(months)">
      <apex:inputField value="{!prds.Processing_Term__c}"/>
     </apex:column>
   </apex:pageBlockTable>
  </apex:pageBlock>
 </apex:form>
</apex:page>
We have designed a servicing app with processes the trigger a workflow email to be sent to a user defined email address (within a custom object) after attempting X times to contact a customer of our clients.  In some cases our clients require that an email from the system to our clients customers originate from a defined email address (i.e. no-reply_address@client1domainname.com).  As our agents can't be logged in as each client, we need to find a means of complying with our clients requests regarding the origination name.  Are there any APEX outbound email options available that will deliver similar type results without appearing like spam or compromising the message integrity.  We believe we may have 10 or 20 clients with such requirements overtime (currently 2 require).
Have already deployed from eclipse projects successfully into one of several production orgs.  In my current sandbox org and eclipse project I have 1 trigger and 1 class that are already deployed to production, and have created another trigger and another class that when tested in sandbox show 100% code coverage.  When running the tests in Eclipse however one time it will show that one class/trigger tested fine and the other class/trigger failed.  I resave these and run the test in Eclipse again, and this time the previously failed class/trigger are now ok and the former ok class/trigger are failing.  Because one element fails the attempt to deploy - even if I am only attempting to deploy the class/trigger that passed the test ends up failing. 
 
As the documentation on the entire Eclipse/Force development is slight there is no real cookbook approach that I have thus far found to help support what will be an on-going environment wherein developers will have an increasing number of classes/triggers that were developed OR some that are still in a state of development that aren't ready to deploy - and all of them impacting(preventing) the deployment of a class/trigger that IS ready for deployment.  It is impacting my productivity and frankly I have burned a good 20 hours now trying to get well covered code out of my sandbox and into production.
 
Any tips on how to handle this????

Have a custom object called "Merchant__c". Have added a lookup field to the Merchant__c object within a Case and originally named the field Merchant (which produced an api name of Merchant__c for the reference field within the Case object).

Creating a test method for APEX code that will insert a Case and a fragment of the code for that is:

// Retrieve key from inserted test merchant record

List<Merchant__c> mrc = new List<Merchant__c>();

mrc = [select Id from Merchant__c where Name = 'testmerchant##'];

// Insert case records for test

List<Case> cse = new List<Case>();

cse.add(new Case(Origin = 'Outbound Phone Call',

Status = 'New',

merchant__c = mrc.Id,

Case_Subject__c = 'Installation Reschedule#3'));

The line - "merchant_name__c = mrc.Id" displays an error in Eclipse or when manually inserted into the APEX IDE

Compilation error: Initial term of field expression must be a concrete SObject: LIST:SOBJECT:Merchant__c

Thinking that perhaps the same field name as an object might be a point of confusion, I changed the field name in the Case object to "merchant name" and ensured the API name was reflected as "merchant_name__c". I then refreshed the schema in Eclipse and the code now appears as before but with the line "merchant_name__c = mrc.Id" - yet the error persists.

Any insights as to what might be incorrect here? I have other test methods written that load-up the ID of another object into a reference field without encountering this,

We are looking for a means to take specific types of Account Team members and insert them as Opportunity Team members.  Our model is such that we may have several different "Account Managers" assigned to a given account, and each account may have as many as 15-20 different sales rep's calling on them.  The Account Managers want to know ALL opportunities that are transpiring in their defined base of accounts, however the only way the reporting system will enable this type of visibility is if the Account Manager(s) are part of the Opportunity Team.  Thus far the only ideas that have come forth are to write a sweeper program that will execute off hours to loop through all records in the AccountTeamMembers table and then through each Account and Opportunity to inspect the OpportunityTeamMembers to see if the AccountTeamMembers that meet the "Account Manager" criteria exist and if not to insert them into the OpportunityTeamMember table.  This would be a fairly intensive program, so we are trying to find other options to enable the "Account Managers" to see what opportunities are occuring in their defined patch. 

Hello,

 

I've recently overridden the standard "View" page for my custom object with a visualforce page.

 

On the Visualforce page, I have a custom button that executes the code below.  The button has worked in the past, but on the visualforce page, it gives me an error related to the "sforce.connection.update(records)" statement below.

 

Is there a way around this to continue using this custom button, or is it best to have some sort of new button functionality as part of the Visualforce page?

 

Code:

 

 

{!REQUIRESCRIPT('/soap/ajax/8.0/connection.js')} var x=window.confirm('Are you sure you want to do this now?') if (x) { var records = []; var d = new sforce.SObject('CustomObject__c'); d.id ='{!CustomObject__c.Id}'; d.Some_Flag__c = 'true'; d.Some_String__c = 'update'; records.push(d); result = sforce.connection.update(records); window.location.reload(); }

 

 

 

onclick="navigateToUrl('/003/e');" within a VF button will work for while developing as the admin, but not for the others in the company that I try to test.  I have included all user profiles within the security of this VF page, and the users have the rights to add a new contact if they are not attempting to do so using the navigateToUrl.

 

Anyone have any ideas on what might be causing this.  I am running my tests in the CS2 sandbox and seem to be bumping my head against the wall today on about 6 different navigateToUrl statements that all work for the admin and none of them work when I login as a non-admin user.

Once the users have completed editing their opportunity data, they tend to forget to scroll down to complete opportunity competitors, opportunity partners, and opportunity contact roles.   We would like to create a single screen in which edit both their opportunity and to add competitor records, partner records, and opportunity contact role information. We have multiple record-types based upon profile, so a means of factoring this in would need to be accomodated.  We would like to ideally embed edit capability for these other related list records within the main edit screen within their own scrollable sections (i.e. users could edit one or more lines of competitors, partners, contact roles each in their own section) and then have a method of updating all of these entities upon a single save. 

 

I am looking for some approaches that might be viable to solution this.  We have Apex experience, and very light VisualForce experience (i.e. can create a VF to represent a custom edit screen or view screen for a single object, have created standard controller extensions and custom controllers, however no experience in creating embedded scrollable input sections like described above).  Open to alternative approaches as well that would have the same net effect of ensuring users are presented with these sections to edit.

Having alittle challenge in building multi dimensional lists and maps for a bulk processing class.  This is being designed to handle thousands of records, and given the limitations of 1000 members per list or per map I have chosen to handle by creating multiple lists and maps to address this.

 

Current code frag I am working on is indicating that I have a List Index out of Bounds:

 

List<List<OpportunityTeamMember>> otm = new List<List<OpportunityTeamMember>>();

List<Map<string,OpportunityTeamMember>> oppMap = new List<Map<string,OpportunityTeamMember>>();

 

j = 0; 

 

for(OpportunityTeamMember opt: [Select o.id, o.opportunityid, o.teammemberrole, o.opportunityaccesslevel, o.userid,

o.Opportunity.accountid From OpportunityTeamMember o where o.Opportunity.accountid in :accIds and isDeleted = False

and userid in :userIds])

  {

   j = setOffset(i);       //  sets the variable j up by 1 for each 1000 records read to move to next list array

   opplist[j].add(opt);  //  adds the record read to the list

 

   i++;                      //  increment the record count

 }

 

// Now, build maps from each list and construct a compound key

 for(j=0; j<10; j++)  {

    for(OpportunityTeamMember ox1: opplist[j])  {      oppMap[j].put(ox1.userid +

':' + ox1.Opportunity.accountid + ':' + ox1.opportunityid, ox1);

   }

In looking at the debug log it shows that the code fails on the first iteration through the for select loop after reading the record and that the setOffset(i) is returning a zero as expected.  The code doesn't make it to the map building phase, but I would assume that there will be a similar issue there as well.

 

I am assuming that I am not dereferencing the list properly, or that I am not creating it properly, or both.  Any assistance would be appreciated. 

We have a linked SQL server to Salesforce via dbAmp (but could also be from excel connector or other external API load tools) and are uploading tasks for Salesforce users.  What we would like is a method to also to perform the function "Send Notification Email" as the UI allows you to do. There doesn't seem to be a method for having this functionality, and unfortunately you can't have a workflow pickup a task to send an email. 

 

Is there a means of having that functionality kick of an email the same way it does from the interactive UI, or perhaps a secondary load into the EmailMessage object to accomplish the same thing, or is an APEX trigger the only means of accomplishing this?

Have already deployed from eclipse projects successfully into one of several production orgs.  In my current sandbox org and eclipse project I have 1 trigger and 1 class that are already deployed to production, and have created another trigger and another class that when tested in sandbox show 100% code coverage.  When running the tests in Eclipse however one time it will show that one class/trigger tested fine and the other class/trigger failed.  I resave these and run the test in Eclipse again, and this time the previously failed class/trigger are now ok and the former ok class/trigger are failing.  Because one element fails the attempt to deploy - even if I am only attempting to deploy the class/trigger that passed the test ends up failing. 
 
As the documentation on the entire Eclipse/Force development is slight there is no real cookbook approach that I have thus far found to help support what will be an on-going environment wherein developers will have an increasing number of classes/triggers that were developed OR some that are still in a state of development that aren't ready to deploy - and all of them impacting(preventing) the deployment of a class/trigger that IS ready for deployment.  It is impacting my productivity and frankly I have burned a good 20 hours now trying to get well covered code out of my sandbox and into production.
 
Any tips on how to handle this????

Have a custom object called "Merchant__c". Have added a lookup field to the Merchant__c object within a Case and originally named the field Merchant (which produced an api name of Merchant__c for the reference field within the Case object).

Creating a test method for APEX code that will insert a Case and a fragment of the code for that is:

// Retrieve key from inserted test merchant record

List<Merchant__c> mrc = new List<Merchant__c>();

mrc = [select Id from Merchant__c where Name = 'testmerchant##'];

// Insert case records for test

List<Case> cse = new List<Case>();

cse.add(new Case(Origin = 'Outbound Phone Call',

Status = 'New',

merchant__c = mrc.Id,

Case_Subject__c = 'Installation Reschedule#3'));

The line - "merchant_name__c = mrc.Id" displays an error in Eclipse or when manually inserted into the APEX IDE

Compilation error: Initial term of field expression must be a concrete SObject: LIST:SOBJECT:Merchant__c

Thinking that perhaps the same field name as an object might be a point of confusion, I changed the field name in the Case object to "merchant name" and ensured the API name was reflected as "merchant_name__c". I then refreshed the schema in Eclipse and the code now appears as before but with the line "merchant_name__c = mrc.Id" - yet the error persists.

Any insights as to what might be incorrect here? I have other test methods written that load-up the ID of another object into a reference field without encountering this,

AccountTeamMembers is a standard child object so I can't define a trigger for it but is there some other way I can catch changes to it in my Apex code?  If someone tries to add a new accountteammember and I want to do validations on their role how can I do that?
Dear All;
                     I have created one SControl using AJAX toolkit to fetch the data from salesforce database and to display it in tabular format.As soon as I select filters and click the show report button the query starts fetching data from the database.During the query run the page gets freezed.
                    Actually I want to show the progress bar when query is busy.I tried this using javascript timer,usuing table in marquee, and some ready made progressbars available on net; but each time whenquery starts running every progressbar stops its animation(Movement) as the whole page, freezes.
                    I even tried with using callback function.It oks well when I show progrss in a form of text(percentage).But for progressbar it fails as timer stops working.
                    Can anyone give me the solution with example because I tried all the options in my mind.
Small example with explaination will help me lot.
 
Thanks in advance