• Suraj Arora
  • NEWBIE
  • -2 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi guys,

I want to send an email notification to users based on two field criterias. These are:
1. the payment method = Barter 
2. the payment amount field has been updated

I have created a custom field to capture the previous amount value when that field has been changed and I have built a workflow rule with a field update for this.

AND(
              ISCHANGED( Payment_Amount__c ),

              NOT(ISBLANK(TEXT(Payment_Amount__c)))
             )
We have apex classes through which we send emails based on user action in force.com sites. It was working great until Friday, But yesterday when one of our customer try to submit application, they were getting error, In debug it says “SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, INVALID_TYPE: sObject type 'SalesforceIqDataSource' is not supported.: []”. I am pretty sure we did not change anything related to apex class, email template, vf page etc.. Does anyone know the reason or best way to fix this?
The WSDL generated for an Apex Class method using the webservice keyword may be missing required complex types.

Take the example:
global class RetrieveOpportunity {
  webservice static Opportunity retrieveOpportunity(Id opportunityId) {
    return new Opportunity();
  }
}

This will generate a WSDL with elements like:
 
<xsd:element name="BillingAddress" minOccurs="0" type="tns:address" nillable="true"/>

The issue is that there is no address complex type in the WSDL tns namespace (http://soap.sforce.com/schemas/class/DFB/RetrieveOpportunity in this case).

This results in errors like:
Error: type 'address@http://soap.sforce.com/schemas/class/RetrieveOpportunity' not found.
Source - WSDL generated from apex can't import to SoapUI (http://salesforce.stackexchange.com/q/56005/102)
and
Error 1 Unable to import binding 'getLeadInfoBinding' from namespace 'http://soap.sforce.com/schemas/class/getLeadInfo'. App_WebReferences/WebReference/

Source - Issue with Adding reference Webservice WSDL to VS2010 (http://salesforce.stackexchange.com/q/53329/102)

The currently solution is to manually add the missing complex types to the xsd:schema with the required targetNamespace.
 
<!-- Compound datatype: Address -->
        <complexType name="address">
            <complexContent>
                <extension base="tns:location">
                    <sequence>
                        <element name="city" type="xsd:string"  nillable="true" />
                        <element name="country" type="xsd:string"  nillable="true" />
                        <element name="countryCode" type="xsd:string"  nillable="true" />
                        <element name="postalCode" type="xsd:string"  nillable="true" />
                        <element name="state" type="xsd:string"  nillable="true" />
                        <element name="stateCode" type="xsd:string"  nillable="true" />
                        <element name="street" type="xsd:string"  nillable="true" />
                    </sequence>
                </extension>
            </complexContent>
        </complexType>

<!-- Compound datatype: Location -->
        <complexType name="location">
            <sequence>
                <element name="latitude" type="xsd:double"  nillable="true" />
                <element name="longitude" type="xsd:double"  nillable="true" />
            </sequence>
        </complexType>

Can this be raised as an Apex API bug?