• Panduranga Golla
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 21
    Replies
This is the challenge:

To complete this challenge, you need to add a trigger for Opportunity. The trigger will add a task to any opportunity inserted or updated with the stage of 'Closed Won'. The task's subject must be 'Follow Up Test Task'.
- The Apex trigger must be called 'ClosedOpportunityTrigger'
- With 'ClosedOpportunityTrigger' active, if an opportunity is inserted or updated with a stage of 'Closed Won', it will have a task created with the subject 'Follow Up Test Task'.
 - To associate the task with the opportunity, fill the 'WhatId' field with the opportunity ID.
- This challenge specifically tests 200 records in one operation.

Here is my code:
trigger ClosedOpportunityTrigger on Opportunity (before insert, before update) {
    List<Opportunity> opportunities = [SELECT Id, StageName
                                       FROM Opportunity
                                       WHERE Id
                                       IN :Trigger.New];
	List<Task> tasksToUpdate = new List<Task>();
    System.debug('##### OPS' + opportunities);
    for(Opportunity o : opportunities){
        System.debug('##### ' + o.StageName);
        if(o.StageName == 'Closed Won'){
            Task thisTask = new Task(WhatId = o.Id, Subject = 'Follow Up Test Task');
            tasksToUpdate.add(thisTask);
            System.debug('##### ' + tasksToUpdate);
        }
    }
    insert tasksToUpdate;
}

When I try to validate through trailhead, it gives a "Challenge Not yet complete... here's what's wrong: 
Executing against the trigger does not work as expected." error.

I added some debug print and it seems to show that the soql statement just does not pull any results, so it does not enter the if statement. It seems a pretty straightforward soql statement to me, but I must be missing something. This happens no matter if I add or update an item.

Thanks in advance
 
this is urgent requirement ,please as soon as possible,
we can view the inline visualforce page in internal users,but we cant view inline visualforce page in community only.
I hope i will get good solution from you guys
i need to create custom button in visual workflow ,
can you give explain or suggest Its urgent.

thanks
this is urgent requirement ,please as soon as possible,
we can view the inline visualforce page in internal users,but we cant view inline visualforce page in community only.
I hope i will get good solution from you guys
Hi,

We've managed to get the trigger working fine in our production system although our processes have recently changed which means that we only want the trigger to fire when certain conditions are met. Please see below the working trigger with the IF statement placed where we believe it should be however it still fires even when these conditions are met. We've tried a couple times to place the IF statement in other areas and either hit errors and we are a little lost.
 
trigger UpdateAccountLookup on Opportunity (before insert,before update){

Set<id> setSiteids=new set<id>();
map<Id, String> mapsiteIdToopptId = new map<Id, String>();
Map<Id, String> mapOpptIdToAccId = new Map<Id, String>();

list<account> acclst = new list<account>();

    For(Opportunity o : trigger.new){  
       
        setSiteids.add(o.Site_Location__c);
        mapsiteIdToopptId.put(o.Site_Location__c, o.Id);
    }
    
    for(Site__c objSite : [Select Id , Parent_Account__c from Site__c where Id IN :setSiteids ])
    {
        mapOpptIdToAccId.put(mapsiteIdToopptId.get(objSite.Id), objSite.Parent_Account__c);
    }
    
    for(Opportunity o : trigger.new){
    
        if(o.New_Site__c == false  || o.Takeover__c == false){
        
        o.AccountId = mapOpptIdToAccId.get(o.Id);
    }
}
}

Any help would be greatfully appreciated.

Thanks,

Snita

 
In my VF-Page i am trying to enable inlineeditsupport for the data displayed in pageblocktable works fine iff data is present in all fields.. if a particular field is blank in a record then the inlineeditsupport doesn't allow to edit that empty/null field.. how to overcome this problem..
 
Thanks In Advance..
 
When the outbound message from salesforce is initiated the following error is thrown from Salesforce end.

Delivery Failure Reason: (404)Not Found

In addition in our server log the following error is thrown.
  [nio-8080-exec-9] o.s.ws.server.EndpointNotFound           : No endpoint mapping found for [SaajSoapMessage {http://soap.sforce.com/2005/09/outbound}notifications]

For some background:
We have three endpoints defined in our application, namely for Account, Contact, and Opportunity entities of Salesforce. All three of our servers are having the same namespace and the same notification data type. In order to differentiate the messages we have different tags for <soap:operation soapAction=""/> for each web service in the wsdl.

Our services works fine when tested with a SOAP testing tool, eg: SOAP UI. We have tested for all three entities successfully. The error is only when it is initiated from Salesforce via outbound messages which are fired from a workflow rule.
 
Hi,

I am working on force.com sites, for that I need to incorporate some radio buttons and those must be required fields.
So i coded like below,

<td align="center" width="10%" style="vertical-align:middle;text-align:center;">
                <div>
                    <apex:outputPanel >
                        <div class="requiredInput">
                        <div class="requiredBlock"> </div>
                         <apex:selectRadio id="EQ2" onchange="renderPhyDet(this);" value="{!MemberEnrollment__c.Emp_Q2_Selected__c}">
                            <apex:selectOption itemValue="Yes" itemLabel="Yes"> </apex:selectOption>
                            <apex:selectOption itemValue="No" itemLabel="No"> </apex:selectOption>
                            </apex:selectRadio>
                        </div>
                    </apex:outputPanel> 
                </div> 
            </td>


Vertical line is showing but the page is not stopping the user if he dont select the radio button.  

User-added image

So I added required="true" label="Choose One" to the radio button, now the page is not being submitted even I submit the page. I think this "required" attribute is working but error message is not being displayed at the radio field which I have mentioned in the "label".
I am looking for an integration of the data from our sales contact application to sales forces and the communication history should be available in saleforce dash board. 

May i know the technical feasilbility of this?
Hello,

I am duplicating few objects, Ideally i wanted to have a detail object with two masters, but as it is not possible , I am obliged to make one of them as lookups..

What effects do the usage of lookup instead of masterdetail, will have on below things
1) Related lists in pagelayouts
2) I wanted to copy the records from one object to other using Apex
  • February 19, 2016
  • Like
  • 0
Hi ,

I am trying print state ,city automatically on VF page using sfdc api ; I don't want as harcoded.

Thanks in Advance,
KK.


 
i have some record types in task object when i select one particular record type and if i create task under that particular record type one checkbox should be checked in some other custom object.how do i do this please help me anybody.
display flash text in visualforce page when checkbox is checked.and that vf page should be added into page layout that is inline vf but that checkbox should be in page layout,how do i do this?please help me anybody urgent requirment thanks i advance.
I currently have a workflow setup that when triggered it sends an email to my recipient (lookup list), This email template has account information and dates to book the job. I want the recipent to be able to click a link from that email template "Confirm" or "Cannot Do" and in turn, have this automatically update a field with the response.
CAn you please advise?
Thanks,
Clayton
Hello, I am currently working a full - time job as Salesforce. Com administrator/Tier1 and Tier 2 Production Support.  I have a need to reduce the number of working hours per week and looking for an opportunity that would allow to work up to 25 hours a week and remote. I have 12+ years of Salesforce. Com experience and currently preparing to get the certification. 

If anyone has any availability, please kindly contact me - 224-715-0653 and/or rosalin_charath@yahoo.com. 
Hi Experts!!

Clone functionality is not working as expected :(

Expected requirement is after click of clone i want new row to be added at the last and Sequesnce number is in order.
pageblock table on page load

Issue is once we click on clone its changing the sequence number(along with other data in the row) of source row.
 
Page block table on click of clone

Code :
<!-- Action funtion to clone entry -->
        <apex:actionFunction action="{!cloneEntry}" name="cloneEntry1" reRender="pgMsgs,lstproducts" status="pageStatus">
            <apex:param name="entryToClone" value=""/>
        </apex:actionFunction>
<apex:pageBlockTable value="{!lstEntries}"  var="oli" width="80%" id="pbTable" rendered="{!lstEntries.size >0}">          
                <apex:column >
                  <u><a style="cursor: pointer;" onclick="cloneEntry1('{!oli.APT_Sequence_Number__c}');"> <b>Clone</b> </a></u>                 
                </apex:column>
                <apex:column headerValue="Sequence Number">   
                 <b><apex:outputField value="{!oli.APT_Sequence_Number__c}" />  </b>
                </apex:column>
                <!--apex:column value="{!oli.APT_Product__c}" headerValue="Product" /--> 
                <apex:column headerValue="Classification">                
                <apex:inputField value="{!oli.APT_Classification__c}" id="classID" />
                </apex:column>
</apex:pageBlockTable>

public void cloneEntry(){
    
          Integer entryToClone= integer.valueof(Apexpages.currentPage().getParameters().get('entryToClone'));                      
          APT_Opportunity_Product_Line_Item__c opToClone= new APT_Opportunity_Product_Line_Item__c();         
           opToClone= lstEntries[entryToClone];                    
           opToClone.APT_Sequence_Number__c= lstEntries.size();
          lstEntries.add(opToClone);      
         
    }



I have tried multiple scenarios on the method no success.

Please suggest me whats going wrong here.

Thanks in advance.
1) Opportunity Amount is = the amount at the time the opportunity was created minus the Opportinity Discount field. (Opportipunuty Amount will be the net amount)

2) Making a field on the Account Object (field called Region) a specific pick list region based on a range of zip codes.
Any help would be appreciated. 

Nina
This is the challenge:

To complete this challenge, you need to add a trigger for Opportunity. The trigger will add a task to any opportunity inserted or updated with the stage of 'Closed Won'. The task's subject must be 'Follow Up Test Task'.
- The Apex trigger must be called 'ClosedOpportunityTrigger'
- With 'ClosedOpportunityTrigger' active, if an opportunity is inserted or updated with a stage of 'Closed Won', it will have a task created with the subject 'Follow Up Test Task'.
 - To associate the task with the opportunity, fill the 'WhatId' field with the opportunity ID.
- This challenge specifically tests 200 records in one operation.

Here is my code:
trigger ClosedOpportunityTrigger on Opportunity (before insert, before update) {
    List<Opportunity> opportunities = [SELECT Id, StageName
                                       FROM Opportunity
                                       WHERE Id
                                       IN :Trigger.New];
	List<Task> tasksToUpdate = new List<Task>();
    System.debug('##### OPS' + opportunities);
    for(Opportunity o : opportunities){
        System.debug('##### ' + o.StageName);
        if(o.StageName == 'Closed Won'){
            Task thisTask = new Task(WhatId = o.Id, Subject = 'Follow Up Test Task');
            tasksToUpdate.add(thisTask);
            System.debug('##### ' + tasksToUpdate);
        }
    }
    insert tasksToUpdate;
}

When I try to validate through trailhead, it gives a "Challenge Not yet complete... here's what's wrong: 
Executing against the trigger does not work as expected." error.

I added some debug print and it seems to show that the soql statement just does not pull any results, so it does not enter the if statement. It seems a pretty straightforward soql statement to me, but I must be missing something. This happens no matter if I add or update an item.

Thanks in advance
 
I'm trying to add pagination to a page that uses a Standard controller and an extension. When I try to use something like:
Page: <apex:outputText value="{!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>
I get the error Error: Unknown property 'Client_Tracker__cStandardController.PageNumber'
I guess it doesn't work because I need to tell it to check the extension and not the Standard Controller but I'm not sure how. 

Controller Code: 
public class Client_PublicAccessTestsLists_Controller {
    private List< Forms_Evaluations__c > publicAccessTests;
    private Client_Tracker__c clientTracker; 
    
    public Client_PublicAccessTestsLists_Controller(ApexPages.StandardController controller) {
        this.clientTracker= (Client_Tracker__c)controller.getRecord();
    }
    
    public List<Forms_Evaluations__c> getpublicAccessTests()
    {
        RecordType rt = [SELECT Id FROM RecordType WHERE DeveloperName = 'Public_Access_Test' AND sobjecttype = 'Forms_Evaluations__c' LIMIT 1];
        publicAccessTests = [SELECT id, Name, Status__c, Date__c, Client_Tracker__c FROM Forms_Evaluations__c WHERE Client_Tracker__r.id = :clientTracker.id AND RecordTypeId = :rt.id ORDER BY Date__c DESC];
        return publicAccessTests;
    }
}

Visualforce Page:
<apex:page standardController="Client_Tracker__c" extensions="Client_PublicAccessTestsLists_Controller">
<apex:form >
 <apex:pageMessages />

<apex:pageblock id="CustomList" title="Public Access Tests List">
   <apex:pageBlockTable value="{!publicAccessTests}" var="pat" rendered="{!NOT(ISNULL(publicAccessTests))}">
        <apex:column headerValue="Action" width="60px">
            <apex:outputLink value="{! URLFOR($Action.Forms_Evaluations__c.Edit, pat.Id, [retURL=pat.Client_Tracker__c]) }" target="_top"
            style="color:#015ba7;">
                Edit
            </apex:outputLink>
            <span style="color:grey;">|</span>&nbsp;
            <apex:outputLink value="{! URLFOR($Action.Forms_Evaluations__c.Delete, pat.Id, [retURL=pat.Client_Tracker__c]) }"
            style="color:#015ba7;">Del
            </apex:outputLink>
        </apex:column>
        <apex:column value="{!pat.Name}"/>
        <apex:column value="{!pat.Status__c}"/>
        <apex:column value="{!pat.Date__c}"/>
   </apex:pageBlockTable>
   <apex:outputLabel value="No records to display" rendered="{!(ISNULL(publicAccessTests))}" styleClass="noRowsHeader"></apex:outputLabel>
    <!-- Pagination -->
    <table style="width: 100%"><tr>
    
        <td>
            <!-- doesn't work -->
            <apex:outputText value="{!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>
        </td>            
    
        <td align="center">   
        </td>
                
        <td align="right">
        </td>
    
    </tr></table> 
</apex:pageblock>

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

I've been doing every search I can think of to find the answer but at this point my brain is fried.
Thanks for any help
  • February 08, 2016
  • Like
  • 0