• anzar_crm
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies

Hi,

 

I'm new to APEX and i would like to create an APEX test class for my APEX class. This class is triggered by 4 triggers from two ojects. Here is the code for one trigger and APEX class:

 

TRIGGER Example:

 

trigger OptyCountryLookUpBeforeUpdate on Opportunity (before update) {
    
    String keys= '';
    List<Opportunity> Opty= new List<Opportunity>();
    Map<String, List<Opportunity>> OptyMap= new Map <String, List<Opportunity>>();
    // Loop through all records in the Trigger.new collection
    for(Opportunity o: Trigger.new) {
        keys= o.RegionShort__c + o.CountryOfDestination__c + o.PLShort__c;
        Opty.add(o);
        OptyMap.put(keys, Opty);
    }
    if (OptyMap.size() != 0) {
        AP63OpportunityTerangaDimension.updateOptyCountryLookup(OptyMap);
    } else {
        System.Debug('## UpdateOptyLookUpField no country lookup to update for '+Trigger.new.size()+' opportunities');
    }
}

 

 

 APEX Class

public class AP63OpportunityTerangaDimension {
    public static void updateOptyCountryLookup(Map<String, List<Opportunity>> opportunities) {
        for (TerangaDimension__c d: [SELECT Id, CONCAT__c from TerangaDimension__c where CONCAT__c IN :opportunities.keySet()]) {
            for (Opportunity o: opportunities.get(d.CONCAT__c )) {
                o.Country__c = d.Id;
            }
        }
    }
    
    public static void updateTerangaCountryLookup(Map<String, List<Teranga__c>> teranga) {
        for (TerangaDimension__c d: [SELECT Id, CONCAT__c from TerangaDimension__c where CONCAT__c IN :teranga.keySet()]) {
            for (Teranga__c t: teranga.get(d.CONCAT__c )) {
                t.Country__c = d.Id;
            }
        }
    }
}

 Thank you for help,

 

All the best,

 

Anzar,

Hi All,

 

I need to get the gap between Opportunity Amount and SAP YTD Orders custom currency field.

 

I have created a custom object in SFDC to load SAP financial data into. In need to build a matrix report to show the gap (difference) between sum of opportunities amount and the sum of same data in my custom object. The data should be grouped by region, country or product line.

 

I have created a custom report type Opportunity with SAP gap (Lookup in my custom object to Opportunity object). When I create the matrix report, I'm unable to create a formula field which is the gap between SFDC and SAP, here is an example:

 

FK_OPP_AMOUNT:SUM - SAP__c.YTD_Orders__c:SUM

 

Any help please ?

 

All the best,

 

Anzar

Hi,

 

The Partner or Enterprise SFDC WSDL failed when imported into soap ui client. Here is the error thrown by soap ui. Any help, please ?

 

Error loading [file:/C:/Documents%20and%20Settings/Bureau/SalesForce.wsdl]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: Use of undefined namespace prefix: xsd

 

All the best,

 

Anzar,


Hi,

 

What is the best solution to migrate Talend ETL jobs into SalesForce ?

 

  1. APEX SAOP Web Service and APEX Callout
  2. Web Service API
  3. Bulk API
  4. Metadata API

I have to migrate two jobs from Talend side.

 

  1. First job extracts campaign members from salesforce and send them to external system. The flux should extract those objects: Campaign, CampaignMembers, Contacts, Leads.
  2. Second job receive a data flux containing activities and creates them in salesforce. The flux also updates contacts, leads and campaign members.

 

The aim of this migration is to get a salesforce package which allows real time marketing campaign's synchronization between salesforce and a ERP system. The sObjects impacted are: Contact, Lead, Campaign, CampaignMember, User and Opportunity.

 

All the best,

 

Anzar.

Hi,

 

The Partner or Enterprise SFDC WSDL failed when imported into soap ui client. Here is the error thrown by soap ui. Any help, please ?

 

Error loading [file:/C:/Documents%20and%20Settings/Bureau/SalesForce.wsdl]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: Use of undefined namespace prefix: xsd

 

 

All the best,

 

Anzar.

Hi,

 

The Partner or Enterprise SFDC WSDL failed when imported into soap ui client. Here is the error thrown by soap ui. Any help, please ?

 

Error loading [file:/C:/Documents%20and%20Settings/Bureau/SalesForce.wsdl]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: Use of undefined namespace prefix: xsd

 

All the best,

 

Anzar,