• backup
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi,

I have a requirement where we have to disable any salesforce related labels in the outgoing mails. Now one issue we are coming across is when we change a user's username or password, Salesforce sends mail to the admin from Support@salesforce.com or QA_Support@salesforce.com. Now we don't mind Support tag but is there any way to remove @salesforce.com tag and the footer Salesforce Team?
I have managed to remove no-reply@salesforce.com from the from address.

 

Any suggestion would be really helpful.

 

Thanks,

Hi,

I have a structure of Apex Class where I use 3 Lists to get records whch are related to each by a lookup.

The objects are Assessment Template, Tabs, Titles and Questions.

The lookups are as follows:

Main Events (Assessment Template Lookup)

   |

Assessment Template (Tabs Lookup)

   |

Tabs (Assessment Template Lookup)

   |

Titles (Tab Lookup)

   |

Questions (Title Lookup)

 

 

So user creates a Assessment template record and creates the necessary tabs, Titles and then questions.

The issue i am facing here is that a template record can have multipe tab records....a tab record can have multiple title records and so on a title record can have multiple question records...

f i had to show each of these relatively on a visualforce page using controller...how do I match the Lists in Soql?

I tried using this way but the result takes all the question records and compares with all the title records and returns all the questions under both title names i used....instead of returning particular question records for a given title n so on for tabs....

Public class ParamTesting {
   public List <Id> TLid = new List<ID>();
   public List <Id> TLd = new List<ID>();
   public List <Decimal> TLtitleOrder = new List<Decimal>();
   public String TooId {get;set;}
   public List <Title__c> TL {get;set;}
   public List <Tabs__c> TB {get;set;}
   public List <Questions__c> QT {get;set;}    
   public List <Questions__c> QAT = new List<Questions__c>();
   public Set <Questions__c> QATs = new Set<Questions__c>();  
    string EtihadtId;

 public ParamTesting(ApexPages.StandardController controller) 
        {
            EtihadtId = ApexPages.currentPage().getParameters().get('id');
            Etihad_Events__c Et = [Select id, Assessment_Template__c from Etihad_Events__c where id =: EtihadtId];
            Assessment_Template__c AT = [Select name from Assessment_Template__c where id =: ET.Assessment_Template__c];
            TL = [Select id, name, Title_label__c, Question_order__c, Title_Order__c from Title__c where Title__c =: AT.id order by Title_Order__c];

           public List <Assesment_Details__c> getFetchQns()
         {   
               
               
                       for(integer j=0; j<TL.size(); j++)
                    
                         { 
                             system.debug('Size' + TL[j].id);
                             TLid.add(TL[j].id); 
                             TLtitleOrder.add(TL[j].Title_Order__c);           
                         }
                 TAL = [Select id,name,title_Order__c,title__c from Title__c where title__c =:TLId];
                                     system.debug('TAL' +TAL);

                  for(integer k=0; k<TAL.size()-1; k++)
                         { 
                             system.debug('Size' + TAL[k].name);
                             TLd.add(TAL[k].id);           
                         }
                         
                       QT = [Select Question_Label__c, Question_Order__c, Select__c, Title__c from Questions__c where title__c =:TLid and Title__r.Title_Order__c =:TLtitleOrder];
     
               system.debug(' TitleId : ' + TLid);
               return QAT;
              
             return QT;
         } 
        
}

 Right now I am neglecting tabs. Once title works then i can include it in the hierarchy.

Is there any way we can call the records from 2 or more Lists from lookup matching?

If you have encountered the same problem please provide me a solution to it.

Hi

 

I calculate  the value in <script>  </script> i.e javascript  and that value has to be store in custom field wen a record is created without button   can any one help this plzzz.

 

 

Regards,

Rajesh.

I've got a visualforce page the is outputting a data table with a list of accounts in the account hierarchy.  One of the columns displayed is the account record type.  We have translated the record type values in the translation workbench and they display correctly translated on the standard acccount page layout.  However, when we try to render them in a dataTable, they show the English values when a non-English user is logged in.  Anyone have any good workarounds for this?  Here is the code we are using:

 

<apex:column >
    <apex:facet name="header">{!$ObjectType.Account.Fields.Type.Label</apex:facet>
    <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value="{!pos.account.RecordType.Name}" />
</apex:column>

 

Hi,

 

Can you please clarify the following doubts:

 

  1. When can before update and after update need to be used on an object.
  2. Please give some business scenarios for using before update and scenarios for using after update on an object.

 

Similarly, how can we decide on when to go for before insert and after insert. Also before delete and after delete.

 

Thanks,

Sush.

Hello,

 

I am needing help on a bit of code.  I am trying to make a call to a controller method from a apex:selectList drop down menu.  I want the code to send the value chosen in the dropdown menu (parameter) to the method on a "onchange" event.  I read a blog that showed how to make a call to an apex:actionFunction and then there forward the parameter to the controller method.  This works fine if I pas a test string, however, I have no idea on how to capture my dropdown selectionlist item into a variable and send it to the function.  If anyone could help, it would be appreciated.  Here is my code:

<apex:page tabstyle="Transportation_Services__c" controller="goGetScheduleQuery">
    <apex:form >
    <apex:actionFunction name="update" action="{!updateSchedule}" rerender="jsvalues">
            <apex:param name="phone" value="" />
                    </apex:actionFunction>
    <apex:pageblock > 
    <apex:pageBlockButtons >
        <apex:commandButton value="Schedule A Pickup" action="{!schedulePickup}"/>
        
        <apex:commandButton value="View the Map" action="{!mapPage}"/>
        </apex:pageBlockButtons>
        <apex:pageblocktable value="{!schedule}"  var="event" columnsWidth="75px,75px,75px,75px,75px,300px">
            <apex:column value="{!event.Pickup_Time__c}"/>
            <apex:column value="{!event.Client__c}"/>
            <apex:column value="{!event.Pickup_Location__c}"/>
            <apex:column value="{!event.Drop_off_Location__c}"/>
            <apex:column headerValue="Phone">
            <apex:selectList id="phoneChoice" value="{!event.Phone_Name__c}"  size="1" title="Phones" onchange="update('test selection')">
            <apex:selectOptions value="{!phones}" ></apex:selectOptions>
            </apex:selectList>
            </apex:column>
            <apex:column value="{!event.Notes_Transportation__c}"/>
            <apex:column value="{!event.Name}" rendered="no"/>
        </apex:pageblocktable>
        <apex:outputPanel id="jsvalues">
            <apex:outputText value="Value one: {!valueOne}" /><br/>
            <apex:outputText value="Value two: {!valueTwo}" /><br />           
        </apex:outputPanel>
    </apex:pageblock>
    </apex:form>
</apex:page>

 

 

  • April 01, 2011
  • Like
  • 0

I am brand new to Apex and need a litle help writing my first test case.  The trigger to be tested is below (areas in red are what my test coverage is missing):

 

 

trigger OpportunityUpdateAccount on Opportunity(after insert, after update) {
List<Account> accsToUpdate = new List<Account>();

for(Opportunity opp : trigger.new)
{if (opp.StageName == '4 - Closed Won' && opp.Hosting__c > 0)
accsToUpdate.add(new Account(Id=opp.AccountID, Type = 'Customer'));
}
if (accsToUpdate != null && !accsToUpdate.isEmpty())
Database.update(accsToUpdate);
}

 

 

Test case below:

 

 

@isTest
private class OpportunityUpdateAccountTest{
    static testMethod void testOpportunityUpdate(){
    
    //Setup the Account record
    Account a = new Account(Name = 'Test Account');
    a.Type = 'Customer';
    insert a;
    
    // Verify that the initial state is as expected
    a = [SELECT Name, Type
        FROM Account
        Where Id = :a.Id];
    System.assertEquals ('Customer', a.Type);
    
    // setup the Opportunity record
    String opportunityName = 'Test Opportunity';
    Opportunity o = new Opportunity(AccountId=a.Id, name=opportunityName, StageName='4 - Closed Won', CloseDate = Date.today() );
                                    
    //Cause the Trigger to execute
    insert o;
    
    //Verify the results
    a = [SELECT Name, Type
        FROM Account
        WHERE Id = :a.Id];
    }
}

A key thing that I am missing from my trigger is adding a Product to the Opportunity.  This effects the  field 'Hosting__c'.  This is a rollup summary field of the total price of the Products under the Product Family "Hosting", that are or course added to the Opportunity,  How would I go about adding in a Product line item in my test case so that I can make my test meet the criteria of 'Hosting__c > 45'?