• Proposal Button
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 31
    Questions
  • 23
    Replies

Hi All

 

i was trying to deploy the new code created as well as some changes made in the existing standard objects. I added new apex code,test class,VF page,Some standard objects and some new custom objects. When i am trying to deploy the code through force.com.IDE(Eclipse) this is the error it is throwing. Can you please help me out if you have any idea of this error. I attached the log for your reference

 

File Name:    objects/Opportunity.object   

Full Name:  Opportunity.Quotas   

Action:  NO ACTION   

Result:  FAILED   

Problem: Required field is missing: businessProcess

Hi Guys

 

Please help me out in writing a test class for the following contoller. I am calling this controller in a VF page. Here is my apex class. I am just attaching some part of my class so if i get the test class for the below code i can use this as a reference and i can write for the remeining part of the class. Appreciate your help

 

public class SSOWcontroller {

 private final SSOW__c ssow;
 private final HVoIP__c hvoip;
 private final VoIP__c voip;
public SSOWcontroller(ApexPages.StandardController stdController) {
 ssow = [ Select Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById,
        SystemModstamp, Site_City__c, Site_State__c, Site_Street__c, Site_Thoroughfair__c, Site_Zip_Code__c,
  NPA_NXX__c, Division__c, Primary_Contact__c FROM SSOW__c WHERE ID = :ApexPages.currentPage().getParameters().get('id')];
 hvoip = [ Select Id, OwnerId, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate,
        LastModifiedById, SystemModstamp, Qualifying_Product__c, Did_you_ensure_that_hosted__c,
        Did_you_indicate_the_quantity__c, Did_you_ensure_that_the_bandwidth__c FROM HVoIP__c  WHERE SSOW__c = :ssow.id];
 voip = [ Select Id, OwnerId, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById,
        SystemModstamp, Qualifying_Product__c, Did_you_ensure_that_Voip_and_Data__c, Own_public_IP_Space__c,
        Routing_protocol_other_than_Static__c FROM VoIP__c WHERE SSOW__c = :ssow.id];

}
  
 public SSOW__c getssow()    {
        return ssow;
    }
    public HVoIP__c gethvoip()    {
        return hvoip;
    }  
    public VoIP__c getvoip()    {
        return voip;
    }  
 private void saveallobjects() {
        update ssow;
        update hvoip;
        update voip;
 }
 public PageReference saveAll() {
        saveallobjects();
         PageReference pr4 = new PageReference('/apex/SmartSOW?Id=' + ssow.Id);
        pr4.setRedirect(true);
        return pr4; 
    } 

 

 

 

Hi All

 

I wrote a simple trigger on case. I am able to save the trigger but it is not working when i am updating the records. I have a checkbox on Case whenever this checkbox becomes true the checkbox in CAF(Custom object) should become true. For this i wrote this trigger. I think i had made mistake in the where clause of the SOQL query. I am mentioning in Red. Please let me know. the relation between CAF__c and Case is lookup.

 

trigger CAFoppUpadate1 on Case (after update)
{
List <CAF__c> CAFList;
List <Id> CaseIdList = new List <Id>();
for(Case c:Trigger.new)
{
    if (c.Closed_won_opportunity__c == True)
     caseIdList.add(c.Id);
 }  
CAFList = [select Id, test_caf__c from CAF__c where ID in :Caseidlist];

    for(CAF__c ca : CAFList)
    {
        if (ca.test_caf__c != true)
            ca.test_caf__c = true;    
    }
    
    update CAFList;
}

Hi

 

I created an custom object called Campaign Alert in that Account is lookup. There is a field in campaign alert called phone no and there is a field called Main BTN in account. If anyone gives the phone no in campaign alert it needs to search whether the phone no with BTN in account and that account needs to popup in the account field in the Campaign alert. I wrote this trigger and the trigger is saved but when i am search with phone no it is not throwing the account. Please let me know where did i went wrong

 

trigger relatedaccount on CampaignAlert__c (after insert, after update)
{
    Map<String, CampaignAlert__c> mapPhones = new Map<String, CampaignAlert__c>();
    for (CampaignAlert__c c: Trigger.new)
      { 
        if (c.phone_No__c != null) 
            {
            mapPhones.put(c.phone_No__c, c);
            }
      }

    List<String> listPhones = new List<String>();
    Map<String, Account> mapAccounts = new Map<String, Account>();
    for (list<Account> acts : [Select Id, Main_BTN__c from Account where Main_BTN__c in :listPhones]) 
        {
            for (Account act : acts) 
                {
                mapAccounts.put(act.Main_BTN__c, act);
                }
        }

    List<CampaignAlert__c> listCampaignAlerts = new List<CampaignAlert__c>();
    for (CampaignAlert__c c: mapPhones.values()) 
    {
        if(mapAccounts.get(c.phone_No__c)==null)
            continue;
        CampaignAlert__c ca = new CampaignAlert__c(Name = c.Name); 
        ca.Account__c = mapAccounts.get(c.phone_No__c).ID; 
        listCampaignAlerts.add(ca);
    }
    update listCampaignAlerts;
}

Hi

 

I am trying to write a test class for the following controller. Here is my controller

 

public class CAFApprovalHistoryController {
    public String cafId {get;set;}
    public List<ProcessInstanceHistory> getApprovalSteps() {
      If (cafId != null) {
        CAF__c cafs = [Select Id, Name, CAPEX_Total__c, Off_Net_Circuit_Expense_Total__c, CAF_IRR__c, of_Revisions__c, Sales_Rep__c, Sales_Manager__c, Account__c, CAF_Title1_del__c, CAF_1__c, Products_Requested__c, Bandwidth__c, Notes_of_Consideration__c, CAF_Link__c, (Select TargetObjectId, SystemModstamp, StepStatus, RemindersSent, ProcessInstanceId, OriginalActorId, IsPending, IsDeleted, Id, CreatedDate, CreatedById, Comments, ActorId From ProcessSteps order by SystemModstamp desc) from CAF__c where Id = :cafId];
        return cafs.ProcessSteps;
      }
      return new List<ProcessInstanceHistory> ();
    } 
   }

 

Here is the test class i wrote and this the error it is throwing Error: Compile Error: line breaks not allowed in string literals at line 8 column -1. I mentioned the line 8 in Red

 

 

public class TestCAFApprovalHistory
{
    public static testMethod void testCAFApprovalHistory() 
         {      
        Test.startTest();
        PageReference result = Page.CAFApprovalHistory;
        Test.setCurrentPage(result);               
        CAF__c cf = new CAF__c(Name='Test', CAPEX_Total__c='$1000.00', Off_Net_Circuit_Expense_Total__c='$1000.00, CAF_IRR__c='25%', of_Revisions__c='0', Sales_Rep__c='Test', Sales_Manager__c='TestTest', Account__c='Test Account');
        insert cf;
        }
        }

 

Hi I am trying to create a trigger to update the check box whenever the Opportunity stage changes from Closed Won to a new stage. Here is the trigger i wrote and it is throwing me an error. Please let me know whether the way i wrote the trigger is write or wrong. I mentioned the error in Red color 

 

 

trigger OpportunityUpdate on Opportunity (after update)
{
List <Opportunity> OppList;
List <Id> oppIdList = new List <Id>();
for(Integer i=0; i<Trigger.new.size(); i++)
{
    if (Trigger.old[i].StageName == 'Closed Won' && Trigger.new[i].StageName != 'Closed Won')
        
        oppIdList.add(Trigger.new[i].Id);
}   
OppList = [select Opportunity.Not_Closed_won__c from Opportunity where opportunity  :oppIdList];
if (OppList.size() > 0)
{
  
        if (Opportunity.Not_Closed_won__c != true)
        {
           Opportunity.Not_Closed_won__c = true;  
           }
    }
    
    update OppList;
    }

 

Hi I am trying to display a warning mess in the VF page. I succeded in getting the warning message but i want to display in Red color but it it throwing in black. Here is the thing i added in the controller and in the VF page

 

Controller:

 

 if(Opportunity.Not_Closed_won__c == True)
        {        
        ApexPages.Message errMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Any changes made to the quote will not flow to Magnys');
ApexPages.addMessage(errMsg);
 }

 

 

VF page:

 <font color="red"><b><apex:messages /></b></font>

 

The characters which are in red is the warning mess i am trying to display but i am geeting the warning mess in black in the vf page. Can you please let me know why?

Hi All

 

We have our custom build quote tool. From quote tool we have a button called CLOSED WON where we can close the opportunity. If any body wants to change something in the quote they need to change the opportunity stage from closed won to a different page from opportunity and then they can make some changes in the quote and can hit CLOSE WON button from quote.

 

Now i want to display a warning message when anybody try to change some information in the quote for the CLOSE/WON opportunities..want to display as this opportunity went to different environment and any changes will not effect immediately. After displaying this mess the sales rep can save the opportunity or can cancel the changes. Please help me out how can this be done. Appreciate your help in advance

 

 

Hi I am creating a visual force email template. For this in the email template we require custom objects fields. So I wrote a apex controller and i called the controller in a component. And i called the component inside the VF template. I mentioned the error in red when i am calling the component in the VF template. I hope the error might be because of something missing in Component or in Controller. Can you guys pls have a look at my code and me knoe where did i went wrong. Appreciate your help in advance

 

Apex Controller

 

 

Public Class CAFDetailsController
{
    Public CAF__c CAF{get;set;}
    Public String cafid{get;set;}
    Public List<CAF__c> CAFlist{get;set;}
       { 
       If (cafid != null)
            {
                CAFlist = [Select Id, Name, CAPEX_Total__c, Off_Net_Circuit_Expense_Total__c, CAF_IRR__c, of_Revisions__c, Sales_Rep__c, Sales_Manager__c from CAF__c where Id = :cafId];
            }                
        }
}

 

Public Class CAFDetailsController{    Public CAF__c CAF{get;set;}    Public String cafid{get;set;}    Public List<CAF__c> CAFlist{get;set;}       {        If (cafid != null)            {                CAFlist = [Select Id, Name, CAPEX_Total__c, Off_Net_Circuit_Expense_Total__c, CAF_IRR__c, of_Revisions__c, Sales_Rep__c, Sales_Manager__c from CAF__c where Id = :cafId];            }                        }}

 

Component

 

 

<apex:component controller="CAFDetailsController" access="global">

    <apex:attribute name="CAFlist" description="CAF object" type="CAF__c"  assignto="{!CAFlist}" /> 

      <apex:outputLabel value="CAFlist" for="CAF__c.CAFId">

          <apex:pageBlockSection >

         <apex:outputText id="CAPEX" value="{!CAFlist.CAPEX_Total__c}"/>

          <apex:outputText id="OffNetCircuitExpense" value="{!CAFlist.Off_Net_Circuit_Expense_Total__c}"/>

        <apex:outputText id="SalesManager" value="{!CAFlist.Sales_Manager__c}"/>

 

 

 

 

        </apex:pageBlockSection>

 

         </apex:outputLabel>

 

</apex:component>

 

 

I called the above component in the following way in the VF template and i mentioned the error in red. Can you please let me know where did i do the mistake

 

VF Template

 

<c:cafvfdetails CAFlist="{!relatedTo.Id}"/>

 

Error: Unknown property 'String.CAPEX_Total__c'

Hi All

 

I had wrote atrigger and facing difficult in deploying. The think is it is trowing an error in an different apex test class. please have a look at my trigger(Update account) and the error is showing in an different apex test class(Test_Opportunitytoorder) which i mentioned in Red

 

trigger UpdateAccount on Opportunity (after update)
{
List<id> accIds=new List<id>();
for (Opportunity opp : trigger.new)
{
   accIds.add(opp.accountid);
}
Map<Id, Account> accountsById=new Map<Id, Account>();
List<Account> accs= [select id,Ready_to_Wincare__c from Account where id in :accIds];
accountsById.putAll(accs);
List<Account> accsToUpdate=new List<Account>();
for (Opportunity opp : trigger.new)
{
   if (opp.StageName ==  'Closed Won')
   {  
       Account acc=accountsById.get(opp.AccountId);
       acc.Ready_to_Wincare__c = True;
       accsToUpdate.add(acc);
          }
}
update accsToUpdate;
}

 

Errors

Test_OpportunityToOrder.testOpportunityToOrder System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UpdateAccount: execution of AfterUpdate
caused by: System.ListException: Duplicate id in list: 0014000000XtFyyAAF
Trigger.UpdateAccount: line 22, column 1: []

 

 

 

In the SQL that SFA uses, what is the function name that converts the data of a field to upper case?  In Oracle SQL the name is UPPER.  The SFA SQL analyzer says this is an invalid aggregate funtion.  I need to know this so I can make the name search case insensitive. I tried using UCASE,UPPER,InUPPER but it is throwing the same error. I mentioned the error in red. please help me out on this

 

Here is the SQL I sent
SELECT w.SF_Order_Number__c,      
       w.Order_Status__c,      
       w.Name,      
       w.Email__c,      
       w.CreatedDate,      
       w.Account__c,      
       w.Account__r.name,      
       w.Main_BTN__c,      
       w.Account_Billing_State__c,      
       w.Account_Billing_City__c 
  FROM WINORDER__c w
 WHERE (InUpper(w.Account__r.name) LIKE '%WRC%SENIOR%SUPPORT%SERVICES%'      
           AND w.Account_Billing_State__c = 'PA')   
    OR w.Main_BTN__c = '(814) 849-5913'
 
Here is the reply I received
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode>sf:MALFORMED_QUERY</faultcode>
   <faultstring>MALFORMED_QUERY: Invalid aggregate function: InUpper</faultstring>
   <detail>
    <sf:MalformedQueryFault xsi:type="sf:MalformedQueryFault">
     <sf:exceptionCode>MALFORMED_QUERY</sf:exceptionCode>
     <sf:exceptionMessage>Invalid aggregate function: InUpper</sf:exceptionMessage>
     <sf:row>-1</sf:row>
     <sf:column>-1</sf:column>
    </sf:MalformedQueryFault>
   </detail>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>
Thanks
Sayana