• Rahul Borgaonkar
  • NEWBIE
  • 145 Points
  • Member since 2012

  • Chatter
    Feed
  • 3
    Best Answers
  • 7
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 86
    Replies
I am trying to develop something for our production Customer Community in a Developer org.  I need Customer Community licenses for testing.  How do I get them?
Hi I'm having the error on my trigger

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:CreateOppForNewSubTriggger: System.LimitException: Too many SOQL queries: 101:--

The trigger is 
 
trigger ZuoraModoProductUpdate on Zuora__SubscriptionProductCharge__c (before insert, before update) {

    Set<Id> zsub_ids = new Set<Id>();
    for(Zuora__SubscriptionProductCharge__c zspc: trigger.new)
    {
        zsub_ids.add(zspc.Zuora__Subscription__c);
    }
    
    List<Zuora__Subscription__c> zsubs = [SELECT Id, Opportunity__c FROM Zuora__Subscription__c WHERE Id IN :zsub_ids];
    
    Map<Id, Zuora__Subscription__c> id_zsubs = new Map<Id, Zuora__Subscription__c>();
    Set<Id> opp_ids = new Set<Id>();
    for(Zuora__Subscription__c zsub : zsubs)
    {
        id_zsubs.put(zsub.Id, zsub);
        opp_ids.add(zsub.Opportunity__c);
    }
    
    List<Opportunity> opps = [SELECT Id, Modo_Web__c FROM Opportunity WHERE Id IN :opp_ids];
    
    Map<Id, Opportunity> id_opps = new Map<Id, Opportunity>();
    for(Opportunity opp : opps)
    {
        id_opps.put(opp.Id, opp);
    }
    
    List<Opportunity> update_opps = new List<Opportunity>();

    for(Zuora__SubscriptionProductCharge__c zspc: trigger.new)
    {
        if(zspc.Zuora__ProductName__c != null && zspc.Zuora__ProductName__c.toLowerCase().contains('modo')) 
        {
            if(zspc.Zuora__Subscription__c != null)
            {
                Zuora__Subscription__c zsub = id_zsubs.get(zspc.Zuora__Subscription__c);
                if(zsub.Opportunity__c != null)
                {
                    Opportunity opp = id_opps.get(zsub.Opportunity__c);
                    opp.Modo_Web__c = true;
                    update_opps.add(opp);
                }
            }
        }
    }
    update update_opps;
}

I believe it's something in the for loop but I can't finde where if someone could give me a light it will be much appreciated.

Thanks in advance.
 
I have written the following code Kindly help me in this


<apex:page>
<apex:page standardController="Customer_Information__c">
<apex:pageBlock >
<head>
 
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
 
$(document).ready(function() {
 
  var myOptions = {
    zoom: 20,
    mapTypeId: google.maps.MapTypeId.HYBRID,
    mapTypeControl: true
  }
 
  var map;
  var marker;
 
  var geocoder = new google.maps.Geocoder();
  var address = "{!Customer_Information__c.Address_Line__c}, " + "{!Customer_Information__c.City__c}, ";
 
  var infowindow = new google.maps.InfoWindow({
    content: "<b>{!Customer_Information__c.Name}</b>"
  });
 
  geocoder.geocode( { address: address}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK && results.length) {
      if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
      
        //create map
        map = new google.maps.Map(document.getElementById("map"), myOptions);
      
        //center map
        map.setCenter(results[0].geometry.location);
        
        //create marker
        marker = new google.maps.Marker({
            position: results[0].geometry.location,
            map: map,
            title: "{!Customer_Information__c.Name}"
        });
        
        //add listeners
        google.maps.event.addListener(marker, 'click', function() {
          infowindow.open(map,marker);
        });
        google.maps.event.addListener(infowindow, 'closeclick', function() {
          map.setCenter(marker.getPosition());
        });
        
      }
      
    } else {
      $('#map').css({'height' : '15px'});
      $('#map').html("Oops! {!Customer_Information__c.Name}'s address could not be found, please make sure the address is correct.");
      resizeIframe();
    }
  });
 
  function resizeIframe() {
    var me = window.name;
    if (me) {
      var iframes = parent.document.getElementsByName(me);
      if (iframes && iframes.length == 1) {
        height = document.body.offsetHeight;
        iframes[0].style.height = height + "px";
      }
    }
  }
 
});
</script>
 
<style>
#map {
  font-family: Arial;
  font-size:12px;
  line-height:normal !important;
  height:500px;
  background:transparent;
}
</style>
 
</head>
 
<body>
<div id="map"></div>
</body>
</apex:pageBlock>
</apex:page>

 
Hi,
I am trying to run a query below from developer documentation
SELECT Amount, FORMAT(amount) Amt, convertCurrency(amount) convertedAmount, FORMAT(convertCurrency(amount)) convertedCurrency FROM Opportunity where id = '0069000000va8SS'
When I am running this query from developer console -> query editor I am getting only first column (Amount) as result. And not other columns are showing.

but when I run same query from Workbench it is showing correct results.

User-added image
Could you please let me know what could be reason?

Best Regards,

Rahul
Hi,

I am on Trail head > Admin Beginner > Lightning Experience Customization > Create and Customize List Views module. I am not able to see Challenge at the end of the page. Could you please help.

Thanks,
Rahul
Hi All,

I have converted external system WSDL to a class on our SF sandbox. The part of class is as below
public class PorticoCallOuts {

    public class QUBA_SF_SearchAccountResponse_element {
        public PorticoCallOuts.QUBA_SF_SearchAccountResult_element QUBA_SF_SearchAccountResult;
        private String[] QUBA_SF_SearchAccountResult_type_info = new String[]{'QUBA_SF_SearchAccountResult','http://tempuri.org/',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','true'};
        private String[] field_order_type_info = new String[]{'QUBA_SF_SearchAccountResult'};
    }
    public class QUBA_SF_SearchAccount_element {
        public String accountID;
        public String accountName;
        public String PostCode;
        private String[] accountID_type_info = new String[]{'accountID','http://tempuri.org/',null,'0','1','false'};
        private String[] accountName_type_info = new String[]{'accountName','http://tempuri.org/',null,'0','1','false'};
        private String[] PostCode_type_info = new String[]{'PostCode','http://tempuri.org/',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','true'};
        private String[] field_order_type_info = new String[]{'accountID','accountName','PostCode'};
    }
    public class QUBA_SF_SearchAccountResult_element {
        public String namespace;
        public String tableTypeName;
        private String[] namespace_att_info = new String[]{'namespace'};
        private String[] tableTypeName_att_info = new String[]{'tableTypeName'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{};
    }

    public class QubaCentre_element {
        public String CentreID;
        public String Name;
        public String Address_1;
        public String Address_2;
        public String Address_3;
        public String Address_4;
        public String Address_5;
        public String Postcode;
        private String[] CentreID_type_info = new String[]{'CentreID','http://tempuri.org/',null,'0','1','false'};
        private String[] Name_type_info = new String[]{'Name','http://tempuri.org/',null,'0','1','false'};
        private String[] Address_1_type_info = new String[]{'Address_1','http://tempuri.org/',null,'0','1','false'};
        private String[] Address_2_type_info = new String[]{'Address_2','http://tempuri.org/',null,'0','1','false'};
        private String[] Address_3_type_info = new String[]{'Address_3','http://tempuri.org/',null,'0','1','false'};
        private String[] Address_4_type_info = new String[]{'Address_4','http://tempuri.org/',null,'0','1','false'};
        private String[] Address_5_type_info = new String[]{'Address_5','http://tempuri.org/',null,'0','1','false'};
        private String[] Postcode_type_info = new String[]{'Postcode','http://tempuri.org/',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','true'};
        private String[] field_order_type_info = new String[]{'CentreID','Name','Address_1','Address_2','Address_3','Address_4','Address_5','Postcode'};
    }
    public class QubaSfV1_element {
        public PorticoCallOuts.QubaCentre_element QubaCentre;
        public PorticoCallOuts.QubaAccountCreateOrUpdateResult_element QubaAccountCreateOrUpdateResult;
        public PorticoCallOuts.QubaContactCreateOrUpdateResult_element QubaContactCreateOrUpdateResult;
        public PorticoCallOuts.QubaContact_element QubaContact;
        public PorticoCallOuts.QubaApprovalCreateOrUpdateResult_element QubaApprovalCreateOrUpdateResult;
        public PorticoCallOuts.QubaUpdateCreditBalanceResult_element QubaUpdateCreditBalanceResult;
        private String[] QubaCentre_type_info = new String[]{'QubaCentre','http://tempuri.org/',null,'1','1','false'};
        private String[] QubaAccountCreateOrUpdateResult_type_info = new String[]{'QubaAccountCreateOrUpdateResult','http://tempuri.org/',null,'1','1','false'};
        private String[] QubaContactCreateOrUpdateResult_type_info = new String[]{'QubaContactCreateOrUpdateResult','http://tempuri.org/',null,'1','1','false'};
        private String[] QubaContact_type_info = new String[]{'QubaContact','http://tempuri.org/',null,'1','1','false'};
        private String[] QubaApprovalCreateOrUpdateResult_type_info = new String[]{'QubaApprovalCreateOrUpdateResult','http://tempuri.org/',null,'1','1','false'};
        private String[] QubaUpdateCreditBalanceResult_type_info = new String[]{'QubaUpdateCreditBalanceResult','http://tempuri.org/',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','true'};
        private String[] field_order_type_info = new String[]{'QubaCentre','QubaAccountCreateOrUpdateResult','QubaContactCreateOrUpdateResult','QubaContact','QubaApprovalCreateOrUpdateResult','QubaUpdateCreditBalanceResult'};
    }
    public class QubaAccountCreateOrUpdateResult_element {
        public String Success;
        public String Quartz_AccountID;
        public String AccountID;
        public String ErrorMessage;
        private String[] Success_type_info = new String[]{'Success','http://tempuri.org/',null,'0','1','false'};
        private String[] Quartz_AccountID_type_info = new String[]{'Quartz_AccountID','http://tempuri.org/',null,'0','1','false'};
        private String[] AccountID_type_info = new String[]{'AccountID','http://tempuri.org/',null,'0','1','false'};
        private String[] ErrorMessage_type_info = new String[]{'ErrorMessage','http://tempuri.org/',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','true'};
        private String[] field_order_type_info = new String[]{'Success','Quartz_AccountID','AccountID','ErrorMessage'};
    }
    public class WSQUBA_SF_V1Soap {
        public String endpoint_x = 'http://qh02ws.quartz-system.com/QuartzWSExtra/BritSafe_ST/WSQUBA_SF_V1.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://tempuri.org/', 'PorticoCallOuts'};

        public PorticoCallOuts.QUBA_SF_SearchAccountResult_element QUBA_SF_SearchAccount(String accountID,String accountName,String PostCode) {
            PorticoCallOuts.QUBA_SF_SearchAccount_element request_x = new PorticoCallOuts.QUBA_SF_SearchAccount_element();
            request_x.accountID = accountID;
            request_x.accountName = accountName;
            request_x.PostCode = PostCode;
            PorticoCallOuts.QUBA_SF_SearchAccountResponse_element response_x;
            Map<String, PorticoCallOuts.QUBA_SF_SearchAccountResponse_element> response_map_x = new Map<String, PorticoCallOuts.QUBA_SF_SearchAccountResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/QUBA_SF_SearchAccount',
              'http://tempuri.org/',
              'QUBA_SF_SearchAccount',
              'http://tempuri.org/',
              'QUBA_SF_SearchAccountResponse',
              'PorticoCallOuts.QUBA_SF_SearchAccountResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.QUBA_SF_SearchAccountResult;
        }
    }
}

While executing QUBA_SF_SearchAccount(String accountID,String accountName,String PostCode) function I am getting error below
Web service callout failed: Unable to parse callout response. Apex type not found for element http://www.w3.org/2001/XMLSchema=schema

The return xml generated from SoapUI is
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <QUBA_SF_SearchAccountResponse xmlns="http://tempuri.org/">
         <QUBA_SF_SearchAccountResult>
            <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
               <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="QubaCentre" msdata:UseCurrentLocale="true">
                  <xs:complexType>
                     <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="QubaCentre">
                           <xs:complexType>
                              <xs:sequence>
                                 <xs:element name="CentreID" msdata:Caption="ID" type="xs:string" minOccurs="0"/>
                                 <xs:element name="Name" type="xs:string" minOccurs="0"/>
                                 <xs:element name="Address_1" type="xs:string" minOccurs="0"/>
                                 <xs:element name="Address_2" type="xs:string" minOccurs="0"/>
                                 <xs:element name="Address_3" type="xs:string" minOccurs="0"/>
                                 <xs:element name="Address_4" type="xs:string" minOccurs="0"/>
                                 <xs:element name="Address_5" type="xs:string" minOccurs="0"/>
                                 <xs:element name="Postcode" type="xs:string" minOccurs="0"/>
                              </xs:sequence>
                           </xs:complexType>
                        </xs:element>
                     </xs:choice>
                  </xs:complexType>
               </xs:element>
            </xs:schema>
            <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
               <DocumentElement xmlns="">
                  <QubaCentre diffgr:id="QubaCentre1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
                     <CentreID>1</CentreID>
                     <Name>Test Centre</Name>
                     <Address_1>123 Street Name</Address_1>
                     <Address_2>City name</Address_2>
                     <Address_3/>
                     <Address_4/>
                     <Address_5/>
                     <Postcode>GU23 6AE</Postcode>
                  </QubaCentre>
               </DocumentElement>
            </diffgr:diffgram>
         </QUBA_SF_SearchAccountResult>
      </QUBA_SF_SearchAccountResponse>
   </soap:Body>
</soap:Envelope>
Could I kindly request you to find exact issue with this? I guess it is something with schema element from return xml but not able to find exact problem.

Please help.

Best Regards,

Rahul
 
Hi,

This is my first intergration project where webservice class developed by me will be used by external system.

I have created a webservice class on sandbox. The functions from this class will be used by external system. I have created a user so that they will have access to sandbox and can easily access webservice class function. WSDL generated is as below
 
<!--
 Web Services API : QuartzWS
-->
<definitions targetNamespace="http://soap.sforce.com/schemas/class/QuartzWS">
    <types>
        <xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/QuartzWS">
            <xsd:element name="AllowFieldTruncationHeader">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="CallOptions">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="client" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="DebuggingHeader">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="categories" minOccurs="0" maxOccurs="unbounded" type="tns:LogInfo"/>
                        <xsd:element name="debugLevel" type="tns:LogType"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:complexType name="LogInfo">
                <xsd:sequence>
                    <xsd:element name="category" type="tns:LogCategory"/>
                    <xsd:element name="level" type="tns:LogCategoryLevel"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:simpleType name="LogCategory">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="Db"/>
                    <xsd:enumeration value="Workflow"/>
                    <xsd:enumeration value="Validation"/>
                    <xsd:enumeration value="Callout"/>
                    <xsd:enumeration value="Apex_code"/>
                    <xsd:enumeration value="Apex_profiling"/>
                    <xsd:enumeration value="Visualforce"/>
                    <xsd:enumeration value="System"/>
                    <xsd:enumeration value="Wave"/>
                    <xsd:enumeration value="All"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:simpleType name="LogCategoryLevel">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="None"/>
                    <xsd:enumeration value="Finest"/>
                    <xsd:enumeration value="Finer"/>
                    <xsd:enumeration value="Fine"/>
                    <xsd:enumeration value="Debug"/>
                    <xsd:enumeration value="Info"/>
                    <xsd:enumeration value="Warn"/>
                    <xsd:enumeration value="Error"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:simpleType name="LogType">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="None"/>
                    <xsd:enumeration value="Debugonly"/>
                    <xsd:enumeration value="Db"/>
                    <xsd:enumeration value="Profiling"/>
                    <xsd:enumeration value="Callout"/>
                    <xsd:enumeration value="Detail"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:element name="DebuggingInfo">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="debugLog" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="SessionHeader">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="sessionId" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:simpleType name="ID">
                <xsd:restriction base="xsd:string">
                    <xsd:length value="18"/>
                    <xsd:pattern value="[a-zA-Z0-9]{18}"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:complexType name="wsOutputs">
                <xsd:sequence>
                    <xsd:element name="referenceId" minOccurs="0" type="xsd:string" nillable="true"/>
                    <xsd:element name="returnId" minOccurs="0" maxOccurs="unbounded" type="xsd:string" nillable="true"/>
                    <xsd:element name="returnMessage" minOccurs="0" type="xsd:string" nillable="true"/>
                    <xsd:element name="success" minOccurs="0" type="xsd:boolean" nillable="true"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="address">
                <xsd:complexContent>
                    <xsd:extension base="tns:location">
                        <xsd:sequence>
                            <xsd:element name="city" type="xsd:string"/>
                            <xsd:element name="country" type="xsd:string"/>
                            <xsd:element name="countryCode" type="xsd:string"/>
                            <xsd:element name="geocodeAccuracy" type="xsd:string"/>
                            <xsd:element name="postalCode" type="xsd:string"/>
                            <xsd:element name="state" type="xsd:string"/>
                            <xsd:element name="stateCode" type="xsd:string"/>
                            <xsd:element name="street" type="xsd:string"/>
                        </xsd:sequence>
                    </xsd:extension>
                </xsd:complexContent>
            </xsd:complexType>
            <xsd:complexType name="location">
                <xsd:sequence>
                    <xsd:element name="latitude" type="xsd:double"/>
                    <xsd:element name="longitude" type="xsd:double"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="addUpdateContact">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="Salutation" type="xsd:string" nillable="true"/>
                        <xsd:element name="Firstname" type="xsd:string" nillable="true"/>
                        <xsd:element name="Lastname" type="xsd:string" nillable="true"/>
                        <xsd:element name="Title" type="xsd:string" nillable="true"/>
                        <xsd:element name="Email" type="xsd:string" nillable="true"/>
                        <xsd:element name="Phone" type="xsd:string" nillable="true"/>
                        <xsd:element name="Email_Opt_Out" type="xsd:boolean" nillable="true"/>
                        <xsd:element name="Salesforce_Account_Id" type="tns:ID" nillable="true"/>
                        <xsd:element name="Quartz_Account_Id" type="xsd:string" nillable="true"/>
                        <xsd:element name="Quartz_Contact_Id" type="xsd:string" nillable="true"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="addUpdateContactResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="result" type="tns:wsOutputs" nillable="true"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="HelloWorld">
                <xsd:complexType>
                    <xsd:sequence/>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="HelloWorldResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="result" type="xsd:string" nillable="true"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
    </types>
    <!-- Message for the header parts -->
    <message name="Header">
        <part name="AllowFieldTruncationHeader" element="tns:AllowFieldTruncationHeader"/>
        <part name="CallOptions" element="tns:CallOptions"/>
        <part name="DebuggingHeader" element="tns:DebuggingHeader"/>
        <part name="DebuggingInfo" element="tns:DebuggingInfo"/>
        <part name="SessionHeader" element="tns:SessionHeader"/>
    </message>
    <!-- Operation Messages -->
    <message name="addUpdateContactRequest">
        <part element="tns:addUpdateContact" name="parameters"/>
    </message>
    <message name="addUpdateContactResponse">
        <part element="tns:addUpdateContactResponse" name="parameters"/>
    </message>
    <message name="HelloWorldRequest">
        <part element="tns:HelloWorld" name="parameters"/>
    </message>
    <message name="HelloWorldResponse">
        <part element="tns:HelloWorldResponse" name="parameters"/>
    </message>
    <portType name="QuartzWSPortType">
        <operation name="addUpdateContact">
            <input message="tns:addUpdateContactRequest"/>
            <output message="tns:addUpdateContactResponse"/>
        </operation>
        <operation name="HelloWorld">
            <input message="tns:HelloWorldRequest"/>
            <output message="tns:HelloWorldResponse"/>
        </operation>
    </portType>
    <binding name="QuartzWSBinding" type="tns:QuartzWSPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="addUpdateContact">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" part="SessionHeader" message="tns:Header"/>
                <soap:header use="literal" part="CallOptions" message="tns:Header"/>
                <soap:header use="literal" part="DebuggingHeader" message="tns:Header"/>
                <soap:header use="literal" part="AllowFieldTruncationHeader" message="tns:Header"/>
                <soap:body use="literal" parts="parameters"/>
            </input>
            <output>
                <soap:header use="literal" part="DebuggingInfo" message="tns:Header"/>
                <soap:body use="literal"/>
            </output>
        </operation>
        <operation name="HelloWorld">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" part="SessionHeader" message="tns:Header"/>
                <soap:header use="literal" part="CallOptions" message="tns:Header"/>
                <soap:header use="literal" part="DebuggingHeader" message="tns:Header"/>
                <soap:header use="literal" part="AllowFieldTruncationHeader" message="tns:Header"/>
                <soap:body use="literal" parts="parameters"/>
            </input>
            <output>
                <soap:header use="literal" part="DebuggingInfo" message="tns:Header"/>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="QuartzWSService">
        <documentation/>
        <port binding="tns:QuartzWSBinding" name="QuartzWS">
            <soap:address location="https://cs8.salesforce.com/services/Soap/class/QuartzWS"/>
        </port>
    </service>
</definitions>

when I tried to access this class using URL https://cs8.salesforce.com/services/Soap/class/QuartzWS at the end of this xml.

<soap:address location="https://cs8.salesforce.com/services/Soap/class/QuartzWS"/>
it is showing message

Problem accessing /services/Soap/class/QuartzWS. Reason:
Only POST allowed


Could you please let me know how to find this URL so that external system will consume WSDL above and then can access function from webservice class using specific user created? It will help a lot.

Also let me know if need further details.

Best Regards,

Rahul
 
Hi,

I have a contact look up field on a custom object. I have put a filter so that it should show all contacts for account which relates to custom object. But when I try to select a contact from popup on magnify glass, it also show me list of all contacts on all account. Please find a screen shot of the same. These list of contacts are unwanted list as it is not related to account on custom object.

Could you please let me know how to disable this picklist functionality when I use this lookup contact field on visualforce page? It will help a lot.

User-added image
Please let me know if you need further details.

Best Regards,

Rahul
Hello All,

I have created a VF page having pageblocktable tag. There are 2 coulmns, first is apex:input and other is apex:outputtext. On input tag using onchange executing a javascript. In this javascript I am using apex:input value and calculating a outputtext value using a formula. I am getting correct formula value but not able to update in outputtext. Please find VF for ref.
<apex:page standardController="Account" tabStyle="Account" extensions="MonthlyDeductionsController" docType="html-5.0" sidebar="false" id="pageid">
    <apex:sectionHeader title="{!account.name}"/>
    <apex:form id="formid" >
        <script type="text/javascript">
        function changeesi1(input, er, er_rate, inx)
        {
            //alert(input.value);
            //alert(er);
            //alert(er_rate);
            //alert(inx);
            //alert(er);
            erid = er;
            //alert(erid);
            er = document.getElementById(erid).value;
            alert(er);
            document.getElementById(erid).value = Math.ceil(input.value * er_rate/100);;
            alert(document.getElementById(erid).value);
        }
        </script>

            <apex:pageBlockTable value="{!deductiondata}" var="ddlist" id="ddid">
                <apex:column headerValue="ESI Wages 1">
                    <apex:input id="esiwgid1" size="10" value="{!ddlist.ESIWages}" onchange="changeesi1(this, '{!$Component.ER}', '{!currentPeriod.ESI_ER_Rate__c}', '{!ddlist.index}');" />
                </apex:column>

                <apex:column headerValue="ESI ER({!currentPeriod.ESI_ER_Rate__c}%)" id="erc">
                    <apex:outputText id="er" value="{0, number, Rs #####0.00}">
                        <apex:param value="{!ddlist.ER}"/>
                    </apex:outputtext>
                </apex:column>
            </apex:pageBlockTable>
    </apex:form>
</apex:page>
It should update/refresh {!ddlist.ER} value using javascript immidiately after onchange. Could you please tell what is missing in javascript?

I have achieved this using apex function using actionFunction but process is slow and want to calculate and refresf {!ddlist.ER} value in page it self using javascript function instead of apex function. Please let me know if you need more details.

Best Regards,

Rahul
 
Hi,

I want to print account and its contacts on dot matrix printer. Is it possible to do it using visualforce renderas PDF option.
Please find my VF code.
 
<apex:page standardController="Account" sidebar="false" id="pageid" renderAs="PDF">
    <apex:outputtext value="{!account.name}" style="font-family: 'Courier New'; margin: 100;"/>
    <apex:form id="formid" >
    <apex:dataTable value="{!account.contacts}" var="contact">
        <apex:column headerValue="Employee Name" value="{!contact.name}" style="font-family: 'Courier New'; margin: 0;"/>
    </apex:dataTable>
    </apex:form>
</apex:page>
Please help.

Thanks,

Rahul
 
Hi,

We are using a managed package. It has custom objects (say abc) on which we have written custom trigger. In this custom trigger we have written SOQL to access managed package other related custom objects (say xyz (relates to abc)).

Does additional SOQLs written by us (on xzy) in custom trigger are counted in managed package's SOQL limits when it updates custom object (abc)?

A function in managed package is throwing Too many SOQL error and not sure it is because of our custom trigger.

Could you please help?

Thanks,

Rahul
Hi,

I am trying to deploy a change set from Developer Pro Sandbox to Full Sandbox. When I tried to validate inbound change on Full Sandbox it is saying Run Apex Test is not required. Could you please let me know how can I run Apex test on full sandbox while deploying from Dev Pro sandbox?

Best Regards,

Rahul
Hi,
I have a inner class and method as below. The class and method is defined in outer class WebsiteWS.
global without sharing class WebsiteWS 
{
	    global class wsAttendeeDetails
	    {
	        webservice Id websiteOrderId;
	    }

	    webService static wsOutputs wsPopulateOppEventContactDetails(List<wsAttendeeDetails> attendeeDetails)
	    {
	        system.debug('List<wsAttendeeDetails> attendeeDetails - ' + attendeeDetails);
	        return null;
	    }
}
I am trying to execute this method from Button using sforce.apex.execute.
var ret = sforce.apex.execute("WebsiteWS", "wsPopulateOppEventContactDetails", {"attendeeDetails" : [ { "websiteOrderId" : "11111" } ] } );
alert(ret);
I am not getting correct value in system.debug, getting null as below
15:51:24:928 USER_DEBUG [2209]|DEBUG|List<wsAttendeeDetails> attendeeDetails - (wsAttendeeDetails:[websiteOrderId=null])

Could you please help to find exact problem?

Regards,

Rahul
 
Hi,

I have a inner class and method as below. The class and method is defined in outer class WebsiteWS.
global without sharing class WebsiteWS  
{
    global class wsAttendeeDetails
    {
        webservice Id websiteOrderId;
    }
    webService static wsOutputs wsPopulateOppEventContactDetails(List<wsAttendeeDetails> attendeeDetails)
    {
        system.debug('List<wsAttendeeDetails> attendeeDetails - ' + attendeeDetails);
        return null;
    }
}
I am trying to execute this method from Button using sforce.apex.execute.
var ret = sforce.apex.execute("WebsiteWS", "wsPopulateOppEventContactDetails", {"attendeeDetails" : [ { "websiteOrderId" : "11111" } ] } );
alert(ret);
I am not getting correct value in system.debug, getting null as below
15:51:24:928 USER_DEBUG [2209]|DEBUG|List<wsAttendeeDetails> attendeeDetails - (wsAttendeeDetails:[websiteOrderId=null])

Could you please help to find exact problem?

Regards,

Rahul

 
Hi,

I am getting attached error while saving an old class from Developer console. It saves from Develop > Apex Classes with out any error.

User-added image
The error is for Financial Force Object. When communicated with FF they replied as
Hi Rahul,

Our development team was able to edit the AutoInvoiceHelper class, but not on developer console, instead from Setup -> Develop -> Apex Classes, and it worked without errors. If developer console is failing, it might be a Salesforce issue. It does appear you have access to the Apex class, CODAAPIInvoiceTypes_9_0.

Please try the steps provided above, but if it still doesn't work on the developer console you may consider contacting Salesforce support.  Unfortunately, this is as far as we can support since this is a custom Apex class.
Please let me know if you're ok to close this case.

Thank you,

FinancialForce.com
Would like to get solution before posting it with Salesforce.

Could I kindly request further help please?

Best Regards,

Rahul
 
Hi,

I have apex:inputtextarea field which has default inital value. Onclick event on this field it should get empty (blank). How could I acheive this?
<apex:inputTextarea rows="1" id="inputpa" value="{!ebrecs.Attendance_Notes__c}"/>
Thanks,

Rahul
Hi,

How can I save my code(classes/triggers/pages) to local drive regularly? I normally use Eclipse to sync/save if I use web based editor. Are you using any other tool. Please share.

Thanks,

Rahul
Hi,
I have TextArea field named Attendance_Notes__c on object EventBooking. I developing a pageblocktable. One column of this table is shown here
When delegate has partial attendance for a course, trainer should put a note.
The checkbox will show Text Area field to put notes.
<apex:Column id="pa">
         <apex:facet name="header">Partial Attendance</apex:facet>
         <apex:inputCheckbox id="isPartialAttendance" value="{!ebrecs.EventBooking['Partial_Attendance_Flag__c']}" selected="false" rendered="{!ebrecs.isCheckBoxShow}">
                  <apex:actionsupport status="submitStatus" event="onclick" action="{!saveValues}" reRender="pa,pm">
                           <apex:param assignto="{!index}" name="param1" value="{!ebrecs.index}"/>
                  </apex:actionsupport>
        </apex:inputCheckbox>
        <apex:inputfield id="inputpa" label="Notes" value="{!ebrecs.EventBooking['Attendance_Notes__c']}" rendered="{!AND(if(ebrecs.EventBooking['Partial_Attendance_Flag__c']==true,true,false),ebrecs.isCheckBoxShow)}">
                 <apex:actionsupport immediate="true" status="submitStatus" event="onchange" action="{!saveValues}" reRender="pa,pm">
                         <apex:param assignto="{!index}" name="param1" value="{!ebrecs.index}"/>
                </apex:actionsupport>
       </apex:inputfield>
</apex:Column>
when inputfield is updated(event="onchange") with notes, action - saveValues on actionsupport should be invoked, which is not invoking now.
It is working fine for all other field type from other column
Could you please help ?

Best Regards,

Rahul
Hi,
I am using a VF page in force.com sites. On the page it has Save and Cancel button. Both buttons are executing controller extension methods saveData and cancelData respectively. Controller extension has constructor too.
Extract from Visualforce page

<apex:page standardController="Special_Event__c" extensions="BSCDelegateCaptureController" id="page"  name="Delegate Capture Form">
    <apex:sectionHeader title="Delegate Capture Form"/>
    <apex:form id="form">
        <apex:pageBlock id="pb">
        <apex:pageMessages id="pm"/>

        <apex:pageBlockButtons id="pbb" location="top">

            <apex:actionStatus id="submitStatus">
                <apex:facet name="stop">
                <apex:outputPanel >
                    <apex:commandButton id="sb" status="submitStatus" value="Submit Details" action="{!saveData}"/> 
                    <apex:commandButton status="submitStatus" value="Cancel" action="{!cancelData}"/>
                </apex:outputPanel>
                </apex:facet>
                <apex:facet name="start">
                <apex:outputPanel >
                    <apex:commandButton value="Submit Details" disabled="true" />
                    <apex:commandButton value="Cancel" disabled="true" />
                </apex:outputPanel>
                </apex:facet>
            </apex:actionStatus>

        </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>
public class BSCDelegateCaptureController
{
    public BSCDelegateCaptureController(ApexPages.StandardController controller)
    {
        system.debug('Inside BSCDelegateCaptureController');
    }

    public PageReference saveData()
    {
        system.debug('Inside saveData');
        PageReference pageRef = new PageReference('/apex/BSCDelegateCapture?id='+BSCEvent.id);
        //PageReference pageRef = new PageReference('/forms/BSCDelegateCapture?id='+BSCEvent.id);
        pageRef.setRedirect(true);
        return pageRef;
    }

    public PageReference cancelData()
    {
        system.debug('Inside cancelData');
        PageReference pageRef = new PageReference('/apex/BSCDelegateCapture?id='+BSCEvent.id);
        //PageReference pageRef = new PageReference('/forms/BSCDelegateCapture?id='+BSCEvent.id);
        pageRef.setRedirect(true);
        return pageRef;
    }
}
When I press Save or Cancel buttonIt should execute saveData or cancelData method
Refresh page and also execute class constructor.While testing in normal salesforce environment it is executing constructor (step2) but it is not executing constructor when page is used in force.com sites.

PageReference pageRef = new PageReference('/apex/BSCDelegateCapture?id='+BSCEvent.id); - Normal url for redirect.
PageReference pageRef = new PageReference('/forms/BSCDelegateCapture?id='+BSCEvent.id); - force.com sites url for redirect.

Kindly let me know what could be the reason. It will help a lot.

Best Regards,

Rahul

 
Hi,
I am using a VF page in force.com sites. On the page it has Save and Cancel button. Both buttons are executing controller extension methods saveData and cancelData respectively. Controller extension has constructor too.
Extract from Visualforce page

<apex:page standardController="Special_Event__c" extensions="BSCDelegateCaptureController" id="page"  name="Delegate Capture Form">
    <apex:sectionHeader title="Delegate Capture Form"/>
    <apex:form id="form">
        <apex:pageBlock id="pb">
        <apex:pageMessages id="pm"/>

        <apex:pageBlockButtons id="pbb" location="top">

            <apex:actionStatus id="submitStatus">
                <apex:facet name="stop">
                <apex:outputPanel >
                    <apex:commandButton id="sb" status="submitStatus" value="Submit Details" action="{!saveData}"/> 
                    <apex:commandButton status="submitStatus" value="Cancel" action="{!cancelData}"/>
                </apex:outputPanel>
                </apex:facet>
                <apex:facet name="start">
                <apex:outputPanel >
                    <apex:commandButton value="Submit Details" disabled="true" />
                    <apex:commandButton value="Cancel" disabled="true" />
                </apex:outputPanel>
                </apex:facet>
            </apex:actionStatus>

        </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>
public class BSCDelegateCaptureController
{
    public BSCDelegateCaptureController(ApexPages.StandardController controller)
    {
        system.debug('Inside BSCDelegateCaptureController');
    }

    public PageReference saveData()
    {
        system.debug('Inside saveData');
        PageReference pageRef = new PageReference('/apex/BSCDelegateCapture?id='+BSCEvent.id);
        //PageReference pageRef = new PageReference('/forms/BSCDelegateCapture?id='+BSCEvent.id);
        pageRef.setRedirect(true);
        return pageRef;
    }

    public PageReference cancelData()
    {
        system.debug('Inside cancelData');
        PageReference pageRef = new PageReference('/apex/BSCDelegateCapture?id='+BSCEvent.id);
        //PageReference pageRef = new PageReference('/forms/BSCDelegateCapture?id='+BSCEvent.id);
        pageRef.setRedirect(true);
        return pageRef;
    }
}


When I press Save or Cancel button
  1. It should execute saveData or cancelData method
  2. Refresh page and also execute class constructor.
While testing in normal salesforce environment it is executing constructor (step2) but it is not executing constructor when page is used in force.com sites.

PageReference pageRef = new PageReference('/apex/BSCDelegateCapture?id='+BSCEvent.id); - Normal url for redirect.
PageReference pageRef = new PageReference('/forms/BSCDelegateCapture?id='+BSCEvent.id); - force.com sites url for redirect.

Kindly let me know what could be the reason. It will help a lot.

Best Regards,

Rahul
Hi,

I am using a class
public class EventBookingRecs
{
        public sObject EventBooking {get; set;}
        public Account bookingAccount {get;set;}
        public Contact bookingContact {get;set;}
}
where variable EventBooking is based on custom object EventBooking already created. The custom object has fields like Name, Status__c etc. I am using EventBooking in visualforce page -> pageblocktable.
example
<apex:pageblocktable value="{!EventBookingRecords}" var="ebrecs" id="pbt">
       <apex:Column >
              <apex:facet name="header">Booking Status</apex:facet>
                    <apex:selectList id="status" onchange="saveValues({!ebrecs.index})" value="{!ebrecs.EventBooking['Status__c']}" size="1">
                        <apex:selectOption itemValue="" itemLabel=""/>
                        <apex:selectOption itemValue="Attended" itemLabel="Attended"/>
                        <apex:selectOption itemValue="No Show" itemLabel="No Show"/>
                    </apex:selectList>
       </apex:Column>
</apex:pageblocktable>

Could you please let me know how to write a getter and setter method for EventBooking['Status__c'] (EventBookingRecs.EventBooking.Status__c) so that when values changes on screen it should set it permamently and screen refresh should not affect it?

Please let me know if you need more details

Best Regards,

Rahul

Hi,

 

I am getting below error

 

Error: The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.

 

when using

 

<apex:outputText value="{0,date,yyyyMMdd'T'HHmmss'Z'}">
       <apex:param value="{!relatedTo.ReminderDateTime}"/>
</apex:outputText>

 

I have also tried

 

<apex:outputText value="{0,date,yyyyMMdd'T'HHmmss'Z'}">       

        <apex:param value="{!relatedTo.ReminderDateTime}"/>

</apex:outputText>

 

but it is not working too.

 

ReminderDateTime field is from task table.

 

Can I kidnly request for a help.

 

Thanks,

 

Rahul

Hi,

 

I have written a trigger on lead object which checks for duplicates Company name before insert and before update. If it finds duplicate then it should send mail to Owner.

It is working for single and bulk insert except sendMail function.

 

The trigger is

 

trigger checkDuplicateLeads on Lead (before insert, before update)
{
    Map<String, Lead> leadMap = new Map<String, Lead>();

    for (Lead lead : Trigger.new)
    {
        if(Trigger.isInsert || (lead.Company != Trigger.oldMap.get(lead.Id).Company) || (lead.Company != null))
        {
            if(leadMap.containsKey(lead.Company))
            {
                lead.Company.addError('Another new lead has the same Company Name');
            }
            else
            {
                leadMap.put(lead.Company, lead);
            }
        }
    }

    for(Account account : [SELECT Name, Owner.Id, Owner.email FROM Account WHERE Name IN :leadMap.KeySet()])
    {
        Lead newLead = leadMap.get(account.Name);

        if(account.Name == newLead.Company)
        {
            String Message = 'An Account (' + account.Name + ') with this Lead Name already exists';
            sendMailToDupLeadsAccounts.sendMail(account.owner.email, Message);
            newLead.Company.addError(Message);
        }
    }

    for(Lead lead : [SELECT Company, OwnerId FROM Lead WHERE Company IN :leadMap.KeySet()])
    {       
        User Owner = [SELECT email FROM User WHERE Id = :lead.ownerid LIMIT 1];
        Lead newLead = leadMap.get(lead.Company);

        if(newLead.Company == lead.Company)
        {
            String Message = 'A Lead (' + lead.Company + ') with this Name already exists';
            sendMailToDupLeadsAccounts.sendMail(Owner.email, Message);
            newLead.Company.addError(Message);
        }
    }
}

 The sendMail function is

 

public class sendMailToDupLeadsAccounts
{
    sendMailToDupLeadsAccounts()
    {
    }
    
    public static void sendMail(String Email, String Message)
    {    
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(new String[] { Email });
        mail.setSubject('Important Message!');
        mail.setPlainTextBody(Message);

        List<Messaging.SendEmailResult> results = Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
        system.debug('Result - ' + results);

    }        
}

 I am getting problem with sendMail function. As I am inserting duplicate lead from my account I should receive mai in my Inbox but it is  not happening. Is there setting which needs to be done on  Sandbox. I tried all sorts of settings from Email Administration and 'Personal Setup -> Email', but no success.

 

When I tried same trigger and class from my Dev Org it is working fine.

 

Has anyone came across similar problem. It will help a lot if you can guide me.

 

Thanks and Regards,

 

Rahul Borgaonkar

Hi,

I am on Trail head > Admin Beginner > Lightning Experience Customization > Create and Customize List Views module. I am not able to see Challenge at the end of the page. Could you please help.

Thanks,
Rahul
Hi,

I want to print account and its contacts on dot matrix printer. Is it possible to do it using visualforce renderas PDF option.
Please find my VF code.
 
<apex:page standardController="Account" sidebar="false" id="pageid" renderAs="PDF">
    <apex:outputtext value="{!account.name}" style="font-family: 'Courier New'; margin: 100;"/>
    <apex:form id="formid" >
    <apex:dataTable value="{!account.contacts}" var="contact">
        <apex:column headerValue="Employee Name" value="{!contact.name}" style="font-family: 'Courier New'; margin: 0;"/>
    </apex:dataTable>
    </apex:form>
</apex:page>
Please help.

Thanks,

Rahul
 
Hi,

I am using a class
public class EventBookingRecs
{
        public sObject EventBooking {get; set;}
        public Account bookingAccount {get;set;}
        public Contact bookingContact {get;set;}
}
where variable EventBooking is based on custom object EventBooking already created. The custom object has fields like Name, Status__c etc. I am using EventBooking in visualforce page -> pageblocktable.
example
<apex:pageblocktable value="{!EventBookingRecords}" var="ebrecs" id="pbt">
       <apex:Column >
              <apex:facet name="header">Booking Status</apex:facet>
                    <apex:selectList id="status" onchange="saveValues({!ebrecs.index})" value="{!ebrecs.EventBooking['Status__c']}" size="1">
                        <apex:selectOption itemValue="" itemLabel=""/>
                        <apex:selectOption itemValue="Attended" itemLabel="Attended"/>
                        <apex:selectOption itemValue="No Show" itemLabel="No Show"/>
                    </apex:selectList>
       </apex:Column>
</apex:pageblocktable>

Could you please let me know how to write a getter and setter method for EventBooking['Status__c'] (EventBookingRecs.EventBooking.Status__c) so that when values changes on screen it should set it permamently and screen refresh should not affect it?

Please let me know if you need more details

Best Regards,

Rahul
Hi,
I am trying to run a query below from developer documentation
SELECT Amount, FORMAT(amount) Amt, convertCurrency(amount) convertedAmount, FORMAT(convertCurrency(amount)) convertedCurrency FROM Opportunity where id = '0069000000va8SS'
When I am running this query from developer console -> query editor I am getting only first column (Amount) as result. And not other columns are showing.

but when I run same query from Workbench it is showing correct results.

User-added image
Could you please let me know what could be reason?

Best Regards,

Rahul
Hi,

This is my first intergration project where webservice class developed by me will be used by external system.

I have created a webservice class on sandbox. The functions from this class will be used by external system. I have created a user so that they will have access to sandbox and can easily access webservice class function. WSDL generated is as below
 
<!--
 Web Services API : QuartzWS
-->
<definitions targetNamespace="http://soap.sforce.com/schemas/class/QuartzWS">
    <types>
        <xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/QuartzWS">
            <xsd:element name="AllowFieldTruncationHeader">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="CallOptions">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="client" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="DebuggingHeader">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="categories" minOccurs="0" maxOccurs="unbounded" type="tns:LogInfo"/>
                        <xsd:element name="debugLevel" type="tns:LogType"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:complexType name="LogInfo">
                <xsd:sequence>
                    <xsd:element name="category" type="tns:LogCategory"/>
                    <xsd:element name="level" type="tns:LogCategoryLevel"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:simpleType name="LogCategory">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="Db"/>
                    <xsd:enumeration value="Workflow"/>
                    <xsd:enumeration value="Validation"/>
                    <xsd:enumeration value="Callout"/>
                    <xsd:enumeration value="Apex_code"/>
                    <xsd:enumeration value="Apex_profiling"/>
                    <xsd:enumeration value="Visualforce"/>
                    <xsd:enumeration value="System"/>
                    <xsd:enumeration value="Wave"/>
                    <xsd:enumeration value="All"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:simpleType name="LogCategoryLevel">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="None"/>
                    <xsd:enumeration value="Finest"/>
                    <xsd:enumeration value="Finer"/>
                    <xsd:enumeration value="Fine"/>
                    <xsd:enumeration value="Debug"/>
                    <xsd:enumeration value="Info"/>
                    <xsd:enumeration value="Warn"/>
                    <xsd:enumeration value="Error"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:simpleType name="LogType">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="None"/>
                    <xsd:enumeration value="Debugonly"/>
                    <xsd:enumeration value="Db"/>
                    <xsd:enumeration value="Profiling"/>
                    <xsd:enumeration value="Callout"/>
                    <xsd:enumeration value="Detail"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:element name="DebuggingInfo">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="debugLog" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="SessionHeader">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="sessionId" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:simpleType name="ID">
                <xsd:restriction base="xsd:string">
                    <xsd:length value="18"/>
                    <xsd:pattern value="[a-zA-Z0-9]{18}"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:complexType name="wsOutputs">
                <xsd:sequence>
                    <xsd:element name="referenceId" minOccurs="0" type="xsd:string" nillable="true"/>
                    <xsd:element name="returnId" minOccurs="0" maxOccurs="unbounded" type="xsd:string" nillable="true"/>
                    <xsd:element name="returnMessage" minOccurs="0" type="xsd:string" nillable="true"/>
                    <xsd:element name="success" minOccurs="0" type="xsd:boolean" nillable="true"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="address">
                <xsd:complexContent>
                    <xsd:extension base="tns:location">
                        <xsd:sequence>
                            <xsd:element name="city" type="xsd:string"/>
                            <xsd:element name="country" type="xsd:string"/>
                            <xsd:element name="countryCode" type="xsd:string"/>
                            <xsd:element name="geocodeAccuracy" type="xsd:string"/>
                            <xsd:element name="postalCode" type="xsd:string"/>
                            <xsd:element name="state" type="xsd:string"/>
                            <xsd:element name="stateCode" type="xsd:string"/>
                            <xsd:element name="street" type="xsd:string"/>
                        </xsd:sequence>
                    </xsd:extension>
                </xsd:complexContent>
            </xsd:complexType>
            <xsd:complexType name="location">
                <xsd:sequence>
                    <xsd:element name="latitude" type="xsd:double"/>
                    <xsd:element name="longitude" type="xsd:double"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="addUpdateContact">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="Salutation" type="xsd:string" nillable="true"/>
                        <xsd:element name="Firstname" type="xsd:string" nillable="true"/>
                        <xsd:element name="Lastname" type="xsd:string" nillable="true"/>
                        <xsd:element name="Title" type="xsd:string" nillable="true"/>
                        <xsd:element name="Email" type="xsd:string" nillable="true"/>
                        <xsd:element name="Phone" type="xsd:string" nillable="true"/>
                        <xsd:element name="Email_Opt_Out" type="xsd:boolean" nillable="true"/>
                        <xsd:element name="Salesforce_Account_Id" type="tns:ID" nillable="true"/>
                        <xsd:element name="Quartz_Account_Id" type="xsd:string" nillable="true"/>
                        <xsd:element name="Quartz_Contact_Id" type="xsd:string" nillable="true"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="addUpdateContactResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="result" type="tns:wsOutputs" nillable="true"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="HelloWorld">
                <xsd:complexType>
                    <xsd:sequence/>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="HelloWorldResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="result" type="xsd:string" nillable="true"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
    </types>
    <!-- Message for the header parts -->
    <message name="Header">
        <part name="AllowFieldTruncationHeader" element="tns:AllowFieldTruncationHeader"/>
        <part name="CallOptions" element="tns:CallOptions"/>
        <part name="DebuggingHeader" element="tns:DebuggingHeader"/>
        <part name="DebuggingInfo" element="tns:DebuggingInfo"/>
        <part name="SessionHeader" element="tns:SessionHeader"/>
    </message>
    <!-- Operation Messages -->
    <message name="addUpdateContactRequest">
        <part element="tns:addUpdateContact" name="parameters"/>
    </message>
    <message name="addUpdateContactResponse">
        <part element="tns:addUpdateContactResponse" name="parameters"/>
    </message>
    <message name="HelloWorldRequest">
        <part element="tns:HelloWorld" name="parameters"/>
    </message>
    <message name="HelloWorldResponse">
        <part element="tns:HelloWorldResponse" name="parameters"/>
    </message>
    <portType name="QuartzWSPortType">
        <operation name="addUpdateContact">
            <input message="tns:addUpdateContactRequest"/>
            <output message="tns:addUpdateContactResponse"/>
        </operation>
        <operation name="HelloWorld">
            <input message="tns:HelloWorldRequest"/>
            <output message="tns:HelloWorldResponse"/>
        </operation>
    </portType>
    <binding name="QuartzWSBinding" type="tns:QuartzWSPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="addUpdateContact">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" part="SessionHeader" message="tns:Header"/>
                <soap:header use="literal" part="CallOptions" message="tns:Header"/>
                <soap:header use="literal" part="DebuggingHeader" message="tns:Header"/>
                <soap:header use="literal" part="AllowFieldTruncationHeader" message="tns:Header"/>
                <soap:body use="literal" parts="parameters"/>
            </input>
            <output>
                <soap:header use="literal" part="DebuggingInfo" message="tns:Header"/>
                <soap:body use="literal"/>
            </output>
        </operation>
        <operation name="HelloWorld">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" part="SessionHeader" message="tns:Header"/>
                <soap:header use="literal" part="CallOptions" message="tns:Header"/>
                <soap:header use="literal" part="DebuggingHeader" message="tns:Header"/>
                <soap:header use="literal" part="AllowFieldTruncationHeader" message="tns:Header"/>
                <soap:body use="literal" parts="parameters"/>
            </input>
            <output>
                <soap:header use="literal" part="DebuggingInfo" message="tns:Header"/>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="QuartzWSService">
        <documentation/>
        <port binding="tns:QuartzWSBinding" name="QuartzWS">
            <soap:address location="https://cs8.salesforce.com/services/Soap/class/QuartzWS"/>
        </port>
    </service>
</definitions>

when I tried to access this class using URL https://cs8.salesforce.com/services/Soap/class/QuartzWS at the end of this xml.

<soap:address location="https://cs8.salesforce.com/services/Soap/class/QuartzWS"/>
it is showing message

Problem accessing /services/Soap/class/QuartzWS. Reason:
Only POST allowed


Could you please let me know how to find this URL so that external system will consume WSDL above and then can access function from webservice class using specific user created? It will help a lot.

Also let me know if need further details.

Best Regards,

Rahul
 
Hi,

I want to print account and its contacts on dot matrix printer. Is it possible to do it using visualforce renderas PDF option.
Please find my VF code.
 
<apex:page standardController="Account" sidebar="false" id="pageid" renderAs="PDF">
    <apex:outputtext value="{!account.name}" style="font-family: 'Courier New'; margin: 100;"/>
    <apex:form id="formid" >
    <apex:dataTable value="{!account.contacts}" var="contact">
        <apex:column headerValue="Employee Name" value="{!contact.name}" style="font-family: 'Courier New'; margin: 0;"/>
    </apex:dataTable>
    </apex:form>
</apex:page>
Please help.

Thanks,

Rahul
 
HI All,

I have created a page with tree nodes. On first level i am showing Account, second level - Contact, third level - Case. Now i want to show the contact record detail page on the side of tree node when i click on any contact record from tree nodes. But i am not able to understand how to get that particular contact record id when i click on this. this is my page and code.

User-added image
public class treenodes
{

    public PageReference contid() {
        return null;
    }

   // public ID contid{get;set;}
    /* Wrapper class to contain the nodes and their children */
    public class cNodes
    {    
        public ID contid{get;set;}
        public List<Contact> parent {get; set;}
        Public Account gparent {get;set;}
        public cNodes(Account  gp, List<Contact> p)
        {       
            parent = p;       
            gparent = gp;  
           // contid = ids;
           System.debug('contactid>>>>>>'+parent); 
           System.debug('Accountid>>>>>>'+gparent); 
        }  
    }
    /* end of Wrapper class */
    Public List<cNodes> hierarchy;
    Public List<cNodes> getmainnodes()
    {
        hierarchy = new List<cNodes>();
        List<Account> tempparent = [Select Id,Name from Account];
        for (Integer i =0; i< tempparent.size() ; i++)
        {
            List<Contact> tempchildren = [Select Id,FirstName,LastName,(Select Id,CaseNumber,Subject from Cases) from Contact where AccountId = :tempparent[i].Id];
            hierarchy.add(new cNodes(tempparent[i],tempchildren));
        }
        return hierarchy;
    }
}
<apex:page sidebar="false" controller="treenodes" showheader="false">
  <!-- Include the Jquery Script files -->     
  <link rel="stylesheet" href="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.treeview.css')}"/>    
  <script src="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.js')}" type="text/javascript"></script>     
  <script src="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.cookie.js')}" type="text/javascript"></script>     
  <script src="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.treeview.js')}" type="text/javascript"></script>
  <!-- End of Javascript files --> 
  <script type="text/javascript">         
  $(function() 
  {             
  $("#tree").treeview({                 
  collapsed: false,                 
  animated: "slow",                 
  control:"#sidetreecontrol",                 
  persist: "location"            
  });          }) 
  </script>  <br/> <br/> <br/> 
  <!-- Tree --> 
      <table style="width:100%">
          <tr>
              <td style="30%">
                  <div id="sidetreecontrol">
            <a href="?#"><font style="color:blue;">Collapse All</font></a> | <a href="?#"><font style="color:blue;">Expand All</font></a>
        </div>  
        <ul id="tree">     
          <apex:repeat value="{!mainnodes}" var="parent">         
                <li><strong><apex:outputtext style="color:blue;" escape="false" value="{!parent.gparent.Name}"/></strong>              
                  <ul>                  
                      <apex:repeat value="{!parent.parent}" var="child">                     
                          <li><span class="formattextcon"><apex:outputtext style="color:green;" escape="false" value="{!child.LastName}"/>
                          </span>                         
                              <ul>                             
                                  <apex:repeat value="{!child.Cases}" var="gchildren">                                
                                      <li> 
                                          <span class="formattextcon"> 
                                              <apex:outputtext escape="false" style="color:red;" value="{!gchildren.CaseNumber}"/> <b>||</b> &nbsp;
                                              <apex:outputtext escape="false" value="{!gchildren.Subject}"/> 
                                          </span> 
                                      </li>                             
                                  </apex:repeat>                        
                              </ul>                            
                          </li>                  
                        </apex:repeat>                
                    </ul>           
                </li>     
            </apex:repeat> 
        </ul> 
              </td>
              <td style="70%">
                  <apex:pageblock >
                      <apex:pageblocktable value="{!mainnodes}" var="a">
                          <apex:column value="{!a.gparent.Name}"/>
                      </apex:pageblocktable>
                  </apex:pageblock>
              </td>
          </tr>      
      </table>
        
        
  <!-- End of Tree -->        
</apex:page>
please help me..

Thanks,
Parteek
Hi All,

I written the code for calling hte schedule class from button ................But it's not scheduling , i dont knw where i did mistake

Here is my code
 
var d = new Date();
var h = d.getHours();
var m = d.getMinutes();
var s = d.getSeconds() + 15;

var mn = d.getMonth()+1;
var y = d.getFullYear();
var weekday = new Array(7);
    weekday[0] = "Sunday";
    weekday[1] = "Monday";
    weekday[2] = "Tuesday";
    weekday[3] = "Wednesday";
    weekday[4] = "Thursday";
    weekday[5] = "Friday";
    weekday[6] = "Saturday";

    var n = weekday[d.getDay()];


var nextFireTime = s + ' ' + m + ' ' + h + ' ' + n + ' ' + mn + '?' + y ;
alert(nextFireTime);


var scr="system.schedule('Run the Batch', '" + nextFireTime +"', new Schedularclassname());"

I have taken the ref code is this
String sch= String.valueOf(newtime.second()) +' ' + String.valueOf(newtime.minute()) + ' ' + String.valueOf(newTime.hour()) + ' ' + String.valueOf(newTime.day()) + ' ' + String.valueOf(newTime.month()) + ' ? ' +  String.valueOf(newTime.year());
Adv Thnx
Siv

 
  • January 04, 2016
  • Like
  • 0
Hi,

I am getting attached error while saving an old class from Developer console. It saves from Develop > Apex Classes with out any error.

User-added image
The error is for Financial Force Object. When communicated with FF they replied as
Hi Rahul,

Our development team was able to edit the AutoInvoiceHelper class, but not on developer console, instead from Setup -> Develop -> Apex Classes, and it worked without errors. If developer console is failing, it might be a Salesforce issue. It does appear you have access to the Apex class, CODAAPIInvoiceTypes_9_0.

Please try the steps provided above, but if it still doesn't work on the developer console you may consider contacting Salesforce support.  Unfortunately, this is as far as we can support since this is a custom Apex class.
Please let me know if you're ok to close this case.

Thank you,

FinancialForce.com
Would like to get solution before posting it with Salesforce.

Could I kindly request further help please?

Best Regards,

Rahul
 
Hi all, 
I wrote an batch apex class, 
Till now i wrote 15 Test classes in my experience so that i am not able to create a test class to the bellow class in proper way, can any body explain me with the test class,  it gets healpfull to me to my practice,,,, Thanks in advance,, 

The class is: 
------------------------
global class batchAccountUpdate implements database.batchable<sObject>{
    
    global database.querylocator start(database.batchablecontext bc){
        string sql = 'select id,name from account';
        return database.getquerylocator(sql);
    }
    
    global void execute(database.batchablecontext bc, list<account> scope){
        list<account> lst = new list<account>();
        for(account a:scope){
            a.name = a.name+'updateddd';
        }
        update scope;
    }
    
    global void finish(database.batchablecontext bc){}
}
All,

I have a one to many relationship between Opportunities and a custom object name Loan__c (one Opportunity to many Loan__c). When I delete a loan record, my trigger below does not fire. 

Does anyone know how to update this code so that when I delete a loan record, the trigger will fire?

Trigger updateDealWithLoanInfo2 on Loan__c (after insert, after update) {
    if(Trigger.isAfter && ( Trigger.isInsert || Trigger.isUpdate )) {
        map<id,id> dealMap = new map<id,id>();
        set<id> consumerDeals = new set<id>();
        set<id> consumerDealsYellow = new set<id>();
        set<id> participatedDeals = new set<id>();
        list<Loan__c> loans = new List<Loan__c>();  
        list<Opportunity> deals = new List<Opportunity>();  
        list<Opportunity> updatedDeals = new List<Opportunity>();  

        for(Loan__c l : Trigger.new) {
            if(l.Deal__c <> NULL) {
                dealMap.put(l.Deal__c, l.Id);
            }
        }
        if(dealMap.size()>0){
            loans = [Select Deal__c, Consumer__c, Participated__c from Loan__c where Deal__c in :dealMap.keySet()];
            for (Loan__c l2 : loans){
                if(l2.Consumer__c == 'Consumer'){
                    consumerDeals.add(l2.Deal__c);
                }
                if(l2.Consumer__c == 'Ambiguous' || l2.Consumer__c == NULL || l2.Consumer__c == 'Insufficient information'|| l2.Consumer__c == 'Not reviewed'){
                    consumerDealsYellow.add(l2.Deal__c);
                }
                if(l2.Participated__c == TRUE){
                    participatedDeals.add(l2.Deal__c);
                }
            }
            deals = [Select Id, Consumer_Loan__c,Consumer_Loan_Hidden__c, Participated_Loan__c from Opportunity where Id in :dealMap.keySet()]; 
            for (Opportunity o : deals){
                if(consumerDeals.contains(o.Id)){
                    o.Consumer_Loan__c = TRUE;
                    o.Consumer_Loan_Hidden__c = FALSE;
                }else{
                    o.Consumer_Loan__c = FALSE;
                }
                if(consumerDealsYellow.contains(o.Id)){
                    o.Consumer_Loan_Hidden__c = TRUE;
                }else{
                    o.Consumer_Loan_Hidden__c = FALSE;
                }
                if(participatedDeals.contains(o.Id)){
                    o.Participated_Loan__c = TRUE;
                }else{
                    o.Participated_Loan__c = FALSE;
                }
                updatedDeals.add(o);
            }
            if(updatedDeals.size()>0){
                update updatedDeals;
            }
        }
    }
Hello firends

I am a newbie to salesforce looking for a job.
Please let me know the following:
a) how to consume a webservice in salesforce(spring 2015 edition). basic to advanced steps involved.
b) How to check output?
c) How to check errors if  generated
d) Ist it possible to call a webservive in  apex trigger or class (psl correct me if I am wrong)

Regards
krishna
I'm getting following error in a production org.
System.UnexpectedException: SOQL statements cannot query more than 35 different parent types.
I've already contained the code inside a Try/Catch block but still it isn't being catched.

Is there way I can trap this error and act on it?

 
Hi,

We have CTI requirement in our Project. The client wants a Demo on sample CTI implementation(realtime calls from salesforce to phone) and then based on that they would like to buy based on its pricing. Please let me know any trial CTI implementations (with actual phone calls) available in Salesforce for Demo purpose.


Thanks.
Hello,


I am trying to insert new records into a custom object (production) via apex data loader. When I do so I get an error like
 
​ ReservationTrigger: execution of AfterInsert

caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

Trigger.ReservationTrigger: line 11, column 1

My trigger is 
trigger ReservationTrigger on Reservations__c (after insert,after update) {
    // Get the IDs of related contacts
    Set<Id> contactIds = new Set<Id>();
    for(Reservations__c oneReservation:trigger.new){
        if(oneReservation.ReservationStatus__c == 'Confirmed'){
            contactIds.add(oneReservation.Email__c);
        }
    }
    // Count the distinct Reservation_Number__c from the Reservation objects of all related contacts
    Map<Id, Integer> countDistinctReservationMap = new Map<Id, Integer>();
    for (AggregateResult aggRes : [SELECT COUNT_DISTINCT(ReservationCode__c) resNum, Email__c conId FROM Reservations__c WHERE Email__c IN: contactIds GROUP BY Email__c ]) {
         Id conId = (Id) aggRes.get('conId');
         Integer resNum  = (Integer) aggRes.get('resNum');
         countDistinctReservationMap.put(conId, resNum);
    }
    // Now fetch the Contacts in a list
    List<Contact> listContacts = [Select Id, customRollupField__c from Contact Where Id IN:contactIds];
    if(listContacts.size()>0) {
         for(Contact con : listContacts) {
              // fetch or get the distinct count or rollup from the map and copy it to the contact's field
              con.customRollupField__c = countDistinctReservationMap.get(con.Id);
         }
    }
    // Update the contacts
    update listContacts;
}

Any Ideas why?
I dont know why but this code works perfectly fine in Sandbox, but once I imported to production its says only 72 percent of it passes. I dont know how to write test cases 
 
public class ClosedLostStages {
    public List<Opportunity> Stages {get; private set;}
    public Integer counterLost {get;private set;}
    public Integer counterWon {get;private set;}
    public Integer counterQuoteSent {get;private set;}
    public Integer counterOpportunityIdentified {get;private set;}
    public Integer counterBizOrderFormSigned {get;private set;}
    public Integer counterRTS {get;private set;}
    public Decimal Sum {get;private set;}
    public Double perLost {get;private set;}
    public Double perWon {get;private set;} 

    public ClosedLostStages() {
        Stages = [Select Id, StageName, Amount, Name, Owner.Name
                  FROM Opportunity
                  WHERE   StageName = 'Closed Lost'];
        counterLost = [ Select count() 
                       FROM Opportunity
                       WHERE   StageName = 'Closed Lost' ];

        counterWon = [ Select count() 
                      FROM Opportunity
                      WHERE   StageName = 'Closed Won' ];

        counterQuoteSent = [ Select count() 
                      FROM Opportunity
                      WHERE   StageName = 'Quote Sent' ];

        counterOpportunityIdentified = [ Select count() 
                      FROM Opportunity
                      WHERE   StageName = 'Opportunity Identified' ];

        counterBizOrderFormSigned = [ Select count() 
                      FROM Opportunity
                      WHERE   StageName = 'Biz Order Form Signed' ];


        counterRTS = [ Select count() 
                      FROM Opportunity
                      WHERE   StageName = 'RTS' ];

        

        Sum = counterWon + counterLost ;
        perLost = ((counterLost / Sum) * 100) ;
        System.debug(perLost + 'Lost percentage');
        perWon = ((counterWon / Sum) * 100) ;  
        System.debug(perWon + 'Won percentage');
    }
     public List<PieWedgeData> getPieData() {
        List<PieWedgeData> data = new List<PieWedgeData>();
        data.add(new PieWedgeData('Lost ', counterLost));
        data.add(new PieWedgeData('Won', counterWon));
        data.add(new PieWedgeData('Quote Sent', counterQuoteSent));
        data.add(new PieWedgeData('Opportunity Identified', counterOpportunityIdentified ));
        data.add(new PieWedgeData('RTS', counterRTS));
        data.add(new PieWedgeData('Biz Order Form Signed', counterBizOrderFormSigned));
        return data;
    }
      public class PieWedgeData {

        public String name { get; private set; }
        public Integer data { get; private set; }

        public PieWedgeData(String name, Integer data) {
            this.name = name;
            this.data = data;
        }
    }

}