• BJ SAGA
  • NEWBIE
  • 0 Points
  • Member since 2016

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

I'd like to create code that would be a before insert I believe.

I have a Custom Object titled, "Speciality Objects". This object has a record type titled "HERO Stories". There is a lookup to Contacts on this object (not a Master Detail).

The code needs to lookup to the Contact and pull the Contact's "First Name" (from Contact) + "Last Name" (from Contact) + HERO Story (plain text) into a field.

How is this possible?

Hello all.Can someone help me in creating trigger for below scenario.
I Created two custom objects event & event attendees. Event attendees has two masters event & contact.Event has a lookup to account. 

​Now i have to achieve below using a trigger.
As soon as the event attendee is created, a welcome message "Welcome to the <EVENT NAME> " should be updated on description field on contact. If same contact is registered for multiple events then Message should be displayed in a different line.
  • October 06, 2016
  • Like
  • 0
How to get notification or email alerts when I modified or Updated records in salesforce Opportunity.where i can write rule or validation..plz reply.
Requirement:
Custom Object Name=CaseConfig__c
Fields of CaseConfig__c
1.Product(lookup)
2.SRType(lookup)

Name of CaseConfig__c should be automatically set by concatenating Names of product & SRType Object.
User will fill values of product & SrType only. value of Name Field of CaseConfig__c should be generated automatically.on insert or update
guys i have an requirement in Visual force Page
I am entering Salary amount in Contact Object [Example 450000]
i am fetching that salary value in render pdf In pdf I want to display 4 lakh 50 thousand or four Lakh Fifty Thousand rupees
Hi,

We have a VF page which displays the list of quotes based on the status. This part is working as expected but we need to add nex and previous buttons in the VF page. How do we do it.

VF page :
<apex:page StandardController="Quote" extensions="QuotePgeCtrl" sidebar="true" tabStyle="HPQuotes__tab" recordSetvar="quoteList">
    <html>
    <div class="blank">&nbsp;</div>
    <div class="content"><img src="/s.gif" class="pageTitleIcon" title="Quote"/>
    <h1>Quotes</h1><br>
    <font size="5">Home</font></br>
    <div class="blank">&nbsp;</div>
    </div></html>
     
    <apex:form >
        <apex:pageBlock title="Recent Quotes">
                <b>View:  </b>
                <apex:selectList size="1" value="{!quotevalue}">
                <apex:actionSupport event="onchange" action="{!getreviewdqt}" rerender="table1"/>
                <apex:selectOption itemLabel="None" itemValue="None"></apex:selectOption>
                <apex:selectOption itemLabel="Draft Quotes" itemValue="Draft Quotes"></apex:selectOption>
                <apex:selectOption itemLabel="Accepted Quotes" itemValue="Accepted Quotes"></apex:selectOption>
                <apex:selectOption itemLabel="Review Pending Quotes" itemValue="Review Pending Quotes"></apex:selectOption>
                </apex:selectList>
                
               <div style="width:100%; margin-top:5px;height:450px; overflow:scroll;">
                <apex:pageBlockTable id="table1" value="{!quoteList}" var="quotes" >
                <apex:column >
                <apex:facet name="header">Name</apex:facet>
                 <a href="#" onClick="window.parent.location.href='/{!quotes.Id}'">{!quotes.Name}</a>   
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Quote Number</apex:facet>
                 <a href="#" onClick="window.parent.location.href='/{!quotes.Id}'">{!quotes.QuoteNumber}</a>   
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Account Name</apex:facet>
                <a href="#" onClick="window.parent.location.href='/{!quotes.Opportunity.Account.Id}'">{!quotes.Opportunity.Account.name}</a>
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Opportunity Name</apex:facet>
                <a href="#" onClick="window.parent.location.href='/{!quotes.Opportunity.Id}'">{!quotes.Opportunity.name}</a>
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Status</apex:facet>
                {!quotes.Status}
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Expiration Date</apex:facet>
                <apex:outputText value="{0,date,MM/dd/yyyy}">
                        <apex:param value="{!quotes.ExpirationDate}"/>
                    </apex:outputText>  
                </apex:column>
  
                <apex:column ><apex:facet name="header">Grand Total</apex:facet>
                <apex:outputText value="{0, number, currency}">
                        <apex:param value="{!quotes.GrandTotal}"/>
                    </apex:outputText> 
                </apex:column>
           
                </apex:pageBlockTable>
                </div>
               <apex:panelGrid columns="2">
                   <apex:commandLink action="{!previous}">Previous</apex:commandlink>
                   <apex:commandLink action="{!next}">Next</apex:commandlink>
               </apex:panelGrid>

                    
        </apex:pageBlock>
    </apex:form>
  
</apex:page>

Apex class:

public class QuotePgeCtrl
{

    public QuotePgeCtrl(ApexPages.StandardSetController controller) {

    }

   
    public Id quoteId {get;set;}
    public QuotePgeCtrl(ApexPages.StandardController controller)
    {
        sObject quote = controller.getRecord();
        quoteId = (Id) quote.get('Id');
    }

    public string quotevalue{get; set;}
    public list<Quote> quoteList{get; set;}
    public list<Quote> getreviewdqt()
    {
        if(quotevalue == 'None')
       {
            quoteList= new list<Quote>([SELECT Opportunity.Account.Name, QuoteNumber, GrandTotal, Opportunity.name,OpportunityId, Name, IsSyncing, Id, Status,ExpirationDate From Quote WHERE Status ='None' ]);
            //ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(quoteList);
       }
       if(quotevalue == 'Draft Quotes')
       {
           quoteList= new list<Quote>([SELECT Opportunity.Account.Name, QuoteNumber, GrandTotal, Opportunity.name,OpportunityId, Name, IsSyncing, Id, Status,ExpirationDate From Quote WHERE Status ='Draft' LIMIT 10 OFFSET 10]);
           //ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(quoteList);
       }
       if(quotevalue == 'Accepted Quotes')
       {
            quoteList= new list<Quote>([SELECT Opportunity.Account.Name, QuoteNumber, GrandTotal, Opportunity.name,OpportunityId, Name, IsSyncing, Id, Status,ExpirationDate From Quote WHERE Status ='Accepted']);
           // ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(quoteList);
       }
       
       if(quotevalue == 'Review Pending Quotes')
       {
            quoteList= new list<Quote>([SELECT Opportunity.Account.Name, QuoteNumber, GrandTotal, Opportunity.name,OpportunityId, Name, IsSyncing, Id, Status,ExpirationDate From Quote WHERE Status ='Review Pending']);
             // ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(quoteList);
       }
     
       return null;
        
    }
   
 }

Thanks.
  • October 05, 2016
  • Like
  • 0
Hi,
   I have several muliselect picklist fields in my custom object and I have written a trigger which counts and adds all the selected picklist values from all the fieds and add them up together and update a field. Now i am trying to write  a test class for the same trigger but i am not sure how to create test data for those multiselect picklist fields? Can I use the existing picklist values on the object but I think , if in future the piclist options change, that might affect my test class.
    Please guide me in this. I can post my trigger if required.
 Thank you
I am new to salesforce, Could you please help me to write test class for below code

 for(Release__c rel : releaseLst){
                for(Material__c mat : rel.Materials__r){
                    if(mat.Material_Status__c == 'Draft' && Date.TODAY() < rel.Internal_Announce_Date__c && mat.Format_Description__c != null){ 
                        if(mat.Format_Description__c != 'EST (ELECTRONIC SELL THRU)' && mat.Format_Description__c != 'DVD RENTAL' && mat.Format_Description__c != 'BD RENTAL' && mat.Format_Description__c != 'VOD' && mat.Format_Description__c != 'HD VOD'){
                            if(rel.Street_Date__c != null){
                                mat.Street_Date__c = rel.Street_Date__c;
                            }
                            if(rel.First_Theatrical_Date__c != null){
                                mat.Theatrical_Release_Date__c = rel.First_Theatrical_Date__c;
                            }
                            if(rel.Internal_Announce_Date__c != null){
                                mat.Internal_Announce_Date__c = rel.Internal_Announce_Date__c;
                            }
                            if(rel.Trade_Solicitation_Date__c != null){
                                mat.Trade_Solicitation_Date__c = rel.Trade_Solicitation_Date__c;
                            }
                            if(rel.In_Plant_Date__c != null){
                                mat.In_Plant_Date__c = rel.In_Plant_Date__c;
                            }
                            if(rel.Pre_Order_Close_Date__c != null){
                                mat.Pre_Order_Close_Date__c = rel.Pre_Order_Close_Date__c;
                            }
guys i have an requirement in Visual force Page
I am entering Salary amount in Contact Object [Example 450000]
i am fetching that salary value in render pdf In pdf I want to display 4 lakh 50 thousand or four Lakh Fifty Thousand rupees