• :) :) :) :) :)
  • NEWBIE
  • 185 Points
  • Member since 2012

  • Chatter
    Feed
  • 5
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 42
    Replies

Hi , i need to calculate the toal amount for closed/won opportunity amount for a particular user and display it in a field of custom object , where the custom object has look up relationship to the user, can any one help me how to do that

Hi, I have 2 fields in accounts - the first is "Lead Status" and the second is "Date Qualified". For tracking purposes. I would like today's date to be automatically populated in the "Date Qualified" field based on when "Qualified" is chosen in the "Lead Status" field.

 

I'd also like to make the "Date Qualified" field not able to be edited unless you are an admin.

 

Any help would be greatly appreciated.

 

Thank you.

I could have searched on governor limit guide but it's eaiser to ask on developer forums. How many Aggregate functions I can use per soql query.

[Select count(id), count(name).........{N}....from account]
Hi all, 
I'm having very strange error. I'm using max function with two currency fields (they are not formula formula fields) and I am getting complied formula is too big to execute error on save even though complied size is just 78 characters. I don't get any error if I click check syntax button. Please help if any one of you've encountered this kind of error. 
  • Actual_Cost_Support__c (Datatype = Currency) Not a formula field
  • Planned_Cost_Support__c (Datatype = Currency) Not a formula field

User-added image
I don't find anything in limit class that gives current trigger depth. Is it possible to get current trigger depth using trigger context variable or any other way? 
Hi All,

I have knowledge of different salesforce object relationships but can anyone give me better understanding with practical example among these different relationships. I might be wrong but I think we can also create junction object with lookup or master-detail but when should I use lookup and when should I use Master detail junction object? 
  1. Lookup
  2. Master-Detail
  3. Self (Hierarchical)
  4. Junction object using Lookup
  5. Junction object using Master-Detail.
I am trying to get all fields API name using getDescribe() and want to use them to bind with triggers foreach statement but couldn't figured out the way to do it. Please Help

Trigger myleadTrigger on lead(after update) {

Lead<String> leadFieldsApiNames = new Lead<String>();
Map<String, SobjectField> fieldMap = Lead.getsObjectType().getDescribe().Fields.getMap();

for(String f :  fieldMap.keySet()) {
leadFieldsApiNames.add(fieldMap.get(f).getDescribe().getName()));
}
for(String s : leadFieldsApiNames){
for(Lead TN : Trigger.new){
 for(Lead TO : Trigger.old){

  if(TO.S != TN.S){
        System.debug('Value has been chaged '+TN.S);
         }

       }
    }
  }
}
I have a Static Webservice Method defined in a Global class. That Webservice method has a string argument (Opportuinty ID) and It is retriving Oppotunity data withing the same method and send it out with Webservice callout and also I am doing some string manipulation and DML Operation in the same webserive method . I am Calling this class through  Custom List View Button on Opportunity.  It worked really well and does what I needed. But Now my biggest problem is how to test this webservice method or Global class using TestMethod.

1) I tried to do that and I got an Error "Methods defined as TestMethod do not support Web service callouts, test skipped"
2) I tried to create httpCallOutMock interface and It give me Error "System.CalloutException: You have uncommitted work pending. Please commit   or rollback before calling out"
3) I tried to Put my DML execution before test.StartTest() then I put Test.Mock()  to call webserive out and last Test.StopTest() but This did not work  even. I don't know now what to do.   I am going to paste my Webserive method and also test class to see if I could get any help from discussion board. Thanks Guys in advanced.

$$ APEX CLASS $$

global class sendToEncompass{
 
  // @future(callout=true)
// public String EncompassMSG;
   WebService static String basicCallout(String OppID){
 
     opportunity opp = [select id, Loan_Number__c,Borrower_SSN__c, Co_Borrower_First_Name__c, Co_Borrower_Last_Name__c, Co_Borrower_SSN__c, Borrower_Email__c, Borrower_First_Name__c, Borrower_Last_Name__c, owner.email, Subject_Property_Street__c, Subject_Property_City__c, Subject_Property_Zip__c, Processing_Notes__c from Opportunity where id =:OppID];
   
     HttpRequest req = new HttpRequest();
     req.setClientCertificateName('xxx');
     req.setEndpoint('https://api.xxx.yyy....');
     req.setMethod('POST');
     req.setHeader('Content-Type', 'application/xml');
     req.setTimeout(120000);
     req.setBody(
     '<LoanEntries xmlns="xxx">' +
  '<LoanData>' +
  '<LoanField>' +
      '<field_id>CX.SALESFORCELINKIDATE</field_id>' +
      '<field_value>'+System.now().format('MM/dd/yyyy')+'</field_value>' +
    '</LoanField>' +
   '<LoanField>' +
      '<field_id>LoanOfficer</field_id>' +
      '<field_value>'+opp.owner.email+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>36</field_id>' +
      '<field_value>'+opp.Borrower_First_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>37</field_id>' +
      '<field_value>'+opp.Borrower_Last_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>11</field_id>' +
      '<field_value>'+opp.Subject_Property_Street__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>12</field_id>' +
      '<field_value>'+opp.Subject_Property_City__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>15</field_id>' +
      '<field_value>'+opp.Subject_Property_Zip__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>364</field_id>' +
      '<field_value>'+opp.Loan_Number__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>65</field_id>' +
      '<field_value>'+opp.Borrower_SSN__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>68</field_id>' +
      '<field_value>'+opp.Co_Borrower_First_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>69</field_id>' +
      '<field_value>'+opp.Co_Borrower_Last_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>97</field_id>' +
      '<field_value>'+opp.Co_Borrower_SSN__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>1240</field_id>' +
      '<field_value>'+opp.Borrower_Email__c+'</field_value>' +
    '</LoanField>' +
  '</LoanData>' +
'</LoanEntries>'
     );

     // req.setBody('{"CX.SALESFORCELINKIDATE":"'+System.now().format('MM/dd/yyyy')+'","LoanOfficer":"'+opp.owner.email+'", "36":"'+opp.Borrower_First_Name__c+'","37":"'+opp.Borrower_Last_Name__c+'","11":"'+opp.Subject_Property_Street__c+'","12":"'+opp.Subject_Property_City__c+'","15":"'+opp.Subject_Property_Zip__c+'","364":"'+Opp.Loan_Number__c+'","65":"'+Opp.Borrower_SSN__c+'","68":"'+opp.Co_Borrower_First_Name__c+'","69":"'+opp.Co_Borrower_Last_Name__c+'","97":"'+opp.Co_Borrower_SSN__c+'","1240":"'+opp.Borrower_Email__c+'"}');
     
     //req.setEndpoint('https://xxxyyyy....xxxx');
     //req.setMethod('GET');

     Http http = new Http();
//     try{
     HTTPResponse res = http.send(req);
     //return res.getBody();
   //  System.debug(res.getBody());
     String loanID = res.getBody();
   //  return loanID;
     system.debug('My Returned Body: '+loanID);
     if(loanID.contains('Created')){
     loanID = loanID.split(':', 14)[2];
     loanID = (loanID.split('<',39)[0]).trim();
     system.debug(loanID);
     opp.GUID__c = loanID;
   //  EncompassMSG = 'Encompass loan record is successfully created, Click ok to continue';
     }
     else{
      loanID = loanID.split(':', 14)[2];
      loanID = (loanID.split('<',39)[0]).trim();
      system.debug(loanID);
      opp.GUID__c = 'Error: ' +loanID;
      //EncompassMSG = 'Error is occured while creating Encompass record, please try again or contact support';
     }
   
     update opp;
     if((opp.GUID__c).contains('Error')){
     return 'Error is occured while creating Encompass record, please try again or contact support';
     }else{
     return 'Encompass loan record is successfully created';
     }
//   }
//   catch(System.CalloutException e){
//    return 'Request time is out, Please try again';
//   }
   }
}


$$ Test Class $$


@isTest
global class MockHttpEncompassResponseGenerator implements HttpCalloutMock {
    // Implement this interface method
    global HTTPResponse respond(HTTPRequest req) {
        // Optionally, only send a mock response for a specific endpoint
        // and method.
      
       //sendToEncompass sE = new sendToEncompass();
     
    
     
    
      
        // Create a fake response
        HttpResponse res = new HttpResponse();
    
        res.setHeader('Content-Type', 'application/Xml');
     // res.setBody('{"CX.SALESFORCELINKIDATE":"'+System.now().format('MM/dd/yyyy')+'","LoanOfficer":"'+opp.owner.email+'", "36":"'+opp.Borrower_First_Name__c+'","37":"'+opp.Borrower_Last_Name__c+'","11":"'+opp.Subject_Property_Street__c+'","12":"'+opp.Subject_Property_City__c+'","15":"'+opp.Subject_Property_Zip__c+'","364":"'+Opp.Loan_Number__c+'","65":"'+Opp.Borrower_SSN__c+'","68":"'+opp.Co_Borrower_First_Name__c+'","69":"'+opp.Co_Borrower_Last_Name__c+'","97":"'+opp.Co_Borrower_SSN__c+'","1240":"'+opp.Borrower_Email__c+'","1222":"Loan Created:{8de3c840-cc26-4970-b10e-d441b090c50d}"}');
      //  res.setBody("":""'Loan Created :{8de3c840-cc26-4970-b10e-d441b090c50d}');
        res.setBody('{"Loan Created : ":"Loan Created :{8de3c840-cc26-4970-b10e-d441b090c50d}"}');
        System.debug('Body of webservice '+res.getBody());
       // res.setStatusCode(200); 
        return res;
    }

  @isTest static void testCallout() {
        
       Opportunity opp = new Opportunity(Name='demoTest',
                                        CloseDate=date.newInstance(2014, 4, 30),
                                        StageName='Active',
                                        Loan_Number__c='123456789101112',
                                        Borrower_SSN__c='8529518478',
                                        Co_Borrower_First_Name__c='FirstTest',
                                        Co_Borrower_Last_Name__c='LastTest',
                                        Co_Borrower_SSN__c='8526547458',
                                        Borrower_Email__c='demo@testemail.com',
                                        Borrower_First_Name__c='borrowerFirstName',
                                        Borrower_Last_Name__c='borrowerLastName',
                                        Subject_Property_Street__c='123 Main St',
                                        Subject_Property_City__c='Los Angeles',
                                        Subject_Property_Zip__c='98103',
                                        Processing_Notes__c='processingNotes');       
       Database.insert(opp);
       sendToEncompass.basicCallout(opp.id);
        
  
        // Set mock callout class
        Test.StartTest();
      
  Test.setMock(HttpCalloutMock.class, new MockHttpEncompassResponseGenerator());
        // Call method to test.
        // This causes a fake response to be sent
        // from the class that implements HttpCalloutMock.
     
    HttpRequest req = new HttpRequest();
        req.setClientCertificateName('xxx');
        req.setEndpoint('https://api.xxx/yyy');
        req.setMethod('POST');
        req.setTimeout(12000);
        Http h = new Http();
        HttpResponse res = h.send(req);
     
        String loanID = res.getBody();
        //System.debug('Response Body '+res.getBody());
        Test.stopTest();
    }
}
I was trying to create test class and I am getting an error saying : Methods defined as testmethod do not support web service callouts. I am pasting my APEX Code below please help me out from here.

global class sendToEncompass{
  
  // @future(callout=true)
  public String EncompassMSG;
   WebService static String basicCallout(String OppID){
  
     opportunity opp = [select id, Loan_Number__c,Borrower_SSN__c, Co_Borrower_First_Name__c, Co_Borrower_Last_Name__c, Co_Borrower_SSN__c, Borrower_Email__c, Borrower_First_Name__c, Borrower_Last_Name__c, owner.email, Subject_Property_Street__c, Subject_Property_City__c, Subject_Property_Zip__c, Processing_Notes__c from Opportunity where id =:OppID];
    
     HttpRequest req = new HttpRequest();
     req.setClientCertificateName('websvcs_cert');
     req.setEndpoint('https://api.XXXYYY.com/eupdate/EUpdateService.svc/insertUpdateLoans');
     req.setMethod('POST');
     req.setHeader('Content-Type', 'application/xml');
     req.setTimeout(120000);
     req.setBody(
     '<LoanEntries xmlns="http://schemas.XXXYYY.org/2001/07/EncompassService">' +
  '<LoanData>' +
  '<LoanField>' +
      '<field_id>CX.SALESFORCELINKIDATE</field_id>' +
      '<field_value>'+System.now().format('MM/dd/yyyy')+'</field_value>' +
    '</LoanField>' +
   '<LoanField>' +
      '<field_id>LoanOfficer</field_id>' +
      '<field_value>'+opp.owner.email+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>36</field_id>' +
      '<field_value>'+opp.Borrower_First_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>37</field_id>' + 
      '<field_value>'+opp.Borrower_Last_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>11</field_id>' + 
      '<field_value>'+opp.Subject_Property_Street__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>12</field_id>' + 
      '<field_value>'+opp.Subject_Property_City__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>15</field_id>' + 
      '<field_value>'+opp.Subject_Property_Zip__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>364</field_id>' + 
      '<field_value>'+opp.Loan_Number__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>65</field_id>' + 
      '<field_value>'+opp.Borrower_SSN__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>68</field_id>' + 
      '<field_value>'+opp.Co_Borrower_First_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>69</field_id>' + 
      '<field_value>'+opp.Co_Borrower_Last_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>97</field_id>' + 
      '<field_value>'+opp.Co_Borrower_SSN__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>1240</field_id>' + 
      '<field_value>'+opp.Borrower_Email__c+'</field_value>' +
    '</LoanField>' +
  '</LoanData>' +
'</LoanEntries>'
     );

    
     //req.setEndpoint('https://api.XXXYYY.com/eupdate/EUpdateService.svc/getFieldMappings');
     //req.setMethod('GET');
 
     Http http = new Http();
     try{
     HTTPResponse res = http.send(req);
     System.debug(res.getBody());
     String loanID = res.getBody();
     if(loanID.contains('Created')){
     loanID = loanID.split(':', 14)[2];
     loanID = (loanID.split('<',39)[0]).trim();
     system.debug(loanID);
     opp.GUID__c = loanID;
   //  EncompassMSG = 'Encompass loan record is successfully created, Click ok to continue';
     }
     else{
      loanID = loanID.split(':', 14)[2];
      loanID = (loanID.split('<',39)[0]).trim();
      system.debug(loanID);
      opp.GUID__c = 'Error: ' +loanID;
      //EncompassMSG = 'Error is occured while creating Encompass record, please try again or contact support';
     }
    
     update opp;
     if((opp.GUID__c).contains('Error')){
     return 'Error is occured while creating Encompass record, please try again or contact support';
     }else{
     return 'Encompass loan record is successfully created';
     }
   }
   catch(System.CalloutException e){
    return 'Request time is out, Please try again';
   }
   }
}

How can I shuffle a List Collection in APEX.

 

Ex: List<Account> acc = new List<Account>({Acc1, Acc2, Acc3,....,AccN});

 

acc.shuffle(); or acc.random(); // I want something that shuffle or randomize the primitive or sobject data inside the list.

 

output should be ==> {Acc2048, Acc179, Acc8632,.....,AccN} 

 

Thanks in advance. 

 

Hello,

 

We have Created By and Last Modified By fields by default but Is there any way in salesforce that we can create Last Accessed By using some sort of Session or custom APEX code.

 

Thanks!



Is there a way we can update List or sObject inside Map?

 

Map<id,Opportunity> oppMap = new Map<id,Opportunity>([select id, Name from opportunity]);

 

oppMap.put(OPPORTUNITY_ID, Opportunity.set(1,'oppName'));     //This is currently not available I am just showing you an example.

 

update Map.values();

Set<String> setUserID = new Set<String>{'1','55','80','12', '6','22','87'};

 

Now I want to select random element from it.  Below random method is not yet exist. So how can I select random element from this set. Any other idea?

 

System.debug('Random Set Element  = ' +setUserID.random());

 

We have Contact us (web2lead) form on our company website. In that contact us form we have asked only four fields Name, Email, Phone and State. Name field is feeding custom Customer Name field (Type Text , size = 255), Email field is feeding Standard Email field, Phone is feeding Standard Phone field and State is feeding Standard State/Province field in salesforce. 

 

I am trying to make a workflow field update that split Customer Name and feed First name and Last name Standard fields but I am not sure which formula functions should I use for splitting. Anyone has any Idea?

I have created salesforce to salesforce between two Enterprise Production Orgs a month ago and currently we are manually sharing it using External Sharing Related List, everything is working fine but I read some best practice to share it automatically using trigger and class. When I tried to write code in sandbox I found out Salesforce to Salesforce: Partner org is not active and no API calls are allowed. I don't understand what does this mean. Do you have any idea about this how can I successfully write code in sandbox and deploy in production.

Hi Guys, 

 

      We are deleting certain unnecessary profiles, Record Types and PageLayouts from our org But Before We do that We want to backup their MetaData file so in future if we want we can restore those profiles.

 

We haven't done this before but I am sure some guys here had done this.

 

Give me your thoughts and suggestions here. 

Reallyappreciateyoureffort.

 

Ketan  

I am working on to make our lead management better and more efficient and quicker. I have also did some research in that area and looked some app-exchange packages but they are not that much good as I thought would be. I am now thinking to make it better for my org using apex and chatter platform all in realtime. I have a plan to make a custom button on lead which actually call visualforce page and get certain qualified users or sales persons according to lead conditions (like lead state, city or language) and make their chatter messenger group so our Representative can chat with custom auto generated group and send them a lead URL. Also from sales person side they can response quicker for saying yes or no to get lead or not. All this is going to happen in realtime by chat. 

 

Can I have your thoughts on this please?

Is there any way to accept ownership through Link in Email. I want to make  some apex code logic where I click button 'Send owership Email'. It will send out email to number of persons. When first user click on that link he will get the ownership and if second user click that link he will get message that owner is already assgined.

 

Leave out any ideas you have.

 

Thanks  

We have web2case functionality in our company. and we want to know if perious case has been submitted by the same Webemail or Webphone field. I am sure that we can not trigger this using workflow. we need to setup APEX trigger that send email which let service team know that customer has submitted case before with same email or phone.

 

Any help? How can I achieve this?

 

Thanks   

I am making visualforce with custom controller with find the nearest distance contact from selected contacts using (https://www.salesforce.com.com?id=16digit_contactID)

String q = 'SELECT Name FROM Contact WHERE DISTANCE(Location__c, GEOLOCATION('+String.valueOf(lat)+','+String.valueOf(log)+'), "mi") < 10';
List<Contact> contacts = Database.query(q);

 

Error: no viable alternative at character ' " " '

Test Class

@isTest
private Class oppoUpdate{
static testMethod void Test_LeadConvert(){


Lead myLead = new Lead(LastName = 'Fry', Company='Fry And Sons',Ownerid='005d0000000rtY4AAI');
insert myLead;

Database.LeadConvert lc = new database.LeadConvert();
lc.setLeadId(myLead.id);

LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
lc.setConvertedStatus(convertStatus.MasterLabel);

Database.LeadConvertResult lcr = Database.convertLead(lc);
// System.assert(lcr.isSuccess());

lead mylead2 = [Select CreatedDate, OwnerId from lead where ConvertedOpportunityId =:lcr.getOpportunityId() Limit 1];

opportunity opp = [select ownerid from opportunity where id=:lcr.getOpportunityId() Limit 1];

opp.ownerid = '005d0000001TaWwAAK';
update opp;
double m = 123456789;

}
}

 

My trigger

 

trigger timeCaculatation on Opportunity (before insert,before update) {
double m;
double d1,d2,d3;
Integer i1,i2,i3;
Integer dy=0,hr=0,min=0,sec=0;
String timeValue;
List<lead> list1 = new List<lead>();
for(opportunity oppo : trigger.new){
list1 = [Select CreatedDate, OwnerId from lead where ConvertedOpportunityId =:oppo.id];

for(lead l : list1){
if(l.OwnerId != oppo.OwnerId){
for(opportunity oppo1 : trigger.old){
if(oppo1.Assignment_Time__c == NULL){
m = (System.now().getTime()-l.CreatedDate.getTime())/1000;
system.debug(m);
if(m>=86400){
d1 = m/86400; // need to take before decimal point NO DAYS
dy = d1.intValue();
if((math.mod(integer.valueof(m),86400) > 0))
{
i1 = math.mod(integer.valueof(m),86400);
system.debug(i1);
if(i1>=3600){
d2 = i1/3600; // need to take before decimal point NO Hours
hr = d2.intValue();
if((math.mod(integer.valueof(i1),3600) > 0))
{
i2 = math.mod(integer.valueof(i1),3600);
system.debug(i2);
if(i2>=60){
d3 = i2/60; // need to take before decimal point NO Mintues
min = d3.intValue();
sec = math.mod(integer.valueof(i2),60); // No seconds
}
}
}
}
timeValue = string.valueof(dy)+ ' Days, ' +string.valueof(hr)+ ' Hr, ' +string.valueof(min)+ ' Min, ' +string.valueof(sec)+ ' Sec';
oppo.Assignment_Time__c = timeValue;
}
else if(m<86400 && m>=3600){
d2 = m/3600; // need to take before decimal point NO Hours
hr = d2.intValue();
if((math.mod(integer.valueof(m),3600) > 0))
{
i2 = math.mod(integer.valueof(m),3600);
if(i2>=60){
d3 = i2/60; // need to take before decimal point NO Mintues
min = d3.intValue();
sec = math.mod(integer.valueof(i2),60); // NO seconds
}
}
timeValue = string.valueof(hr)+ ' Hr, ' +string.valueof(min)+ ' Min, ' +string.valueof(sec)+ ' Sec';
oppo.Assignment_Time__c = timeValue;
}
else if (m<3600 && m>=60){
d3 = m/60; // need to take before decimal point NO Mintues
min = d3.intValue();
sec = math.mod(integer.valueof(m),60); // NO seconds
timeValue = string.valueof(min)+ ' Min, ' +string.valueof(sec)+ ' Sec';
oppo.Assignment_Time__c = timeValue;
}
else if (m<60){
sec = integer.valueof(m);
timeValue = string.valueof(sec)+ ' Sec';
oppo.Assignment_Time__c = timeValue;
}
}

}
}
}
}
}

 

 

Hi guys I am trying to counting total rows in opportunity object using count() but its giving me an errors says  Compile Error: Illegal assignment from LIST<SObject> to Integer at line 95 column 11

 


let me show you what I am doing.

 

String soql = 'select count() from lead where Ownerid=:18digit_id and IsConverted=false';

 

Integer leadCount = Database.query(soql);  // Getting error here.

 

Any One had a problem before?

 

Thanks guys

 

I have a Static Webservice Method defined in a Global class. That Webservice method has a string argument (Opportuinty ID) and It is retriving Oppotunity data withing the same method and send it out with Webservice callout and also I am doing some string manipulation and DML Operation in the same webserive method . I am Calling this class through  Custom List View Button on Opportunity.  It worked really well and does what I needed. But Now my biggest problem is how to test this webservice method or Global class using TestMethod.

1) I tried to do that and I got an Error "Methods defined as TestMethod do not support Web service callouts, test skipped"
2) I tried to create httpCallOutMock interface and It give me Error "System.CalloutException: You have uncommitted work pending. Please commit   or rollback before calling out"
3) I tried to Put my DML execution before test.StartTest() then I put Test.Mock()  to call webserive out and last Test.StopTest() but This did not work  even. I don't know now what to do.   I am going to paste my Webserive method and also test class to see if I could get any help from discussion board. Thanks Guys in advanced.

$$ APEX CLASS $$

global class sendToEncompass{
 
  // @future(callout=true)
// public String EncompassMSG;
   WebService static String basicCallout(String OppID){
 
     opportunity opp = [select id, Loan_Number__c,Borrower_SSN__c, Co_Borrower_First_Name__c, Co_Borrower_Last_Name__c, Co_Borrower_SSN__c, Borrower_Email__c, Borrower_First_Name__c, Borrower_Last_Name__c, owner.email, Subject_Property_Street__c, Subject_Property_City__c, Subject_Property_Zip__c, Processing_Notes__c from Opportunity where id =:OppID];
   
     HttpRequest req = new HttpRequest();
     req.setClientCertificateName('xxx');
     req.setEndpoint('https://api.xxx.yyy....');
     req.setMethod('POST');
     req.setHeader('Content-Type', 'application/xml');
     req.setTimeout(120000);
     req.setBody(
     '<LoanEntries xmlns="xxx">' +
  '<LoanData>' +
  '<LoanField>' +
      '<field_id>CX.SALESFORCELINKIDATE</field_id>' +
      '<field_value>'+System.now().format('MM/dd/yyyy')+'</field_value>' +
    '</LoanField>' +
   '<LoanField>' +
      '<field_id>LoanOfficer</field_id>' +
      '<field_value>'+opp.owner.email+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>36</field_id>' +
      '<field_value>'+opp.Borrower_First_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>37</field_id>' +
      '<field_value>'+opp.Borrower_Last_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>11</field_id>' +
      '<field_value>'+opp.Subject_Property_Street__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>12</field_id>' +
      '<field_value>'+opp.Subject_Property_City__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>15</field_id>' +
      '<field_value>'+opp.Subject_Property_Zip__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>364</field_id>' +
      '<field_value>'+opp.Loan_Number__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>65</field_id>' +
      '<field_value>'+opp.Borrower_SSN__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>68</field_id>' +
      '<field_value>'+opp.Co_Borrower_First_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>69</field_id>' +
      '<field_value>'+opp.Co_Borrower_Last_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>97</field_id>' +
      '<field_value>'+opp.Co_Borrower_SSN__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>1240</field_id>' +
      '<field_value>'+opp.Borrower_Email__c+'</field_value>' +
    '</LoanField>' +
  '</LoanData>' +
'</LoanEntries>'
     );

     // req.setBody('{"CX.SALESFORCELINKIDATE":"'+System.now().format('MM/dd/yyyy')+'","LoanOfficer":"'+opp.owner.email+'", "36":"'+opp.Borrower_First_Name__c+'","37":"'+opp.Borrower_Last_Name__c+'","11":"'+opp.Subject_Property_Street__c+'","12":"'+opp.Subject_Property_City__c+'","15":"'+opp.Subject_Property_Zip__c+'","364":"'+Opp.Loan_Number__c+'","65":"'+Opp.Borrower_SSN__c+'","68":"'+opp.Co_Borrower_First_Name__c+'","69":"'+opp.Co_Borrower_Last_Name__c+'","97":"'+opp.Co_Borrower_SSN__c+'","1240":"'+opp.Borrower_Email__c+'"}');
     
     //req.setEndpoint('https://xxxyyyy....xxxx');
     //req.setMethod('GET');

     Http http = new Http();
//     try{
     HTTPResponse res = http.send(req);
     //return res.getBody();
   //  System.debug(res.getBody());
     String loanID = res.getBody();
   //  return loanID;
     system.debug('My Returned Body: '+loanID);
     if(loanID.contains('Created')){
     loanID = loanID.split(':', 14)[2];
     loanID = (loanID.split('<',39)[0]).trim();
     system.debug(loanID);
     opp.GUID__c = loanID;
   //  EncompassMSG = 'Encompass loan record is successfully created, Click ok to continue';
     }
     else{
      loanID = loanID.split(':', 14)[2];
      loanID = (loanID.split('<',39)[0]).trim();
      system.debug(loanID);
      opp.GUID__c = 'Error: ' +loanID;
      //EncompassMSG = 'Error is occured while creating Encompass record, please try again or contact support';
     }
   
     update opp;
     if((opp.GUID__c).contains('Error')){
     return 'Error is occured while creating Encompass record, please try again or contact support';
     }else{
     return 'Encompass loan record is successfully created';
     }
//   }
//   catch(System.CalloutException e){
//    return 'Request time is out, Please try again';
//   }
   }
}


$$ Test Class $$


@isTest
global class MockHttpEncompassResponseGenerator implements HttpCalloutMock {
    // Implement this interface method
    global HTTPResponse respond(HTTPRequest req) {
        // Optionally, only send a mock response for a specific endpoint
        // and method.
      
       //sendToEncompass sE = new sendToEncompass();
     
    
     
    
      
        // Create a fake response
        HttpResponse res = new HttpResponse();
    
        res.setHeader('Content-Type', 'application/Xml');
     // res.setBody('{"CX.SALESFORCELINKIDATE":"'+System.now().format('MM/dd/yyyy')+'","LoanOfficer":"'+opp.owner.email+'", "36":"'+opp.Borrower_First_Name__c+'","37":"'+opp.Borrower_Last_Name__c+'","11":"'+opp.Subject_Property_Street__c+'","12":"'+opp.Subject_Property_City__c+'","15":"'+opp.Subject_Property_Zip__c+'","364":"'+Opp.Loan_Number__c+'","65":"'+Opp.Borrower_SSN__c+'","68":"'+opp.Co_Borrower_First_Name__c+'","69":"'+opp.Co_Borrower_Last_Name__c+'","97":"'+opp.Co_Borrower_SSN__c+'","1240":"'+opp.Borrower_Email__c+'","1222":"Loan Created:{8de3c840-cc26-4970-b10e-d441b090c50d}"}');
      //  res.setBody("":""'Loan Created :{8de3c840-cc26-4970-b10e-d441b090c50d}');
        res.setBody('{"Loan Created : ":"Loan Created :{8de3c840-cc26-4970-b10e-d441b090c50d}"}');
        System.debug('Body of webservice '+res.getBody());
       // res.setStatusCode(200); 
        return res;
    }

  @isTest static void testCallout() {
        
       Opportunity opp = new Opportunity(Name='demoTest',
                                        CloseDate=date.newInstance(2014, 4, 30),
                                        StageName='Active',
                                        Loan_Number__c='123456789101112',
                                        Borrower_SSN__c='8529518478',
                                        Co_Borrower_First_Name__c='FirstTest',
                                        Co_Borrower_Last_Name__c='LastTest',
                                        Co_Borrower_SSN__c='8526547458',
                                        Borrower_Email__c='demo@testemail.com',
                                        Borrower_First_Name__c='borrowerFirstName',
                                        Borrower_Last_Name__c='borrowerLastName',
                                        Subject_Property_Street__c='123 Main St',
                                        Subject_Property_City__c='Los Angeles',
                                        Subject_Property_Zip__c='98103',
                                        Processing_Notes__c='processingNotes');       
       Database.insert(opp);
       sendToEncompass.basicCallout(opp.id);
        
  
        // Set mock callout class
        Test.StartTest();
      
  Test.setMock(HttpCalloutMock.class, new MockHttpEncompassResponseGenerator());
        // Call method to test.
        // This causes a fake response to be sent
        // from the class that implements HttpCalloutMock.
     
    HttpRequest req = new HttpRequest();
        req.setClientCertificateName('xxx');
        req.setEndpoint('https://api.xxx/yyy');
        req.setMethod('POST');
        req.setTimeout(12000);
        Http h = new Http();
        HttpResponse res = h.send(req);
     
        String loanID = res.getBody();
        //System.debug('Response Body '+res.getBody());
        Test.stopTest();
    }
}

Set<String> setUserID = new Set<String>{'1','55','80','12', '6','22','87'};

 

Now I want to select random element from it.  Below random method is not yet exist. So how can I select random element from this set. Any other idea?

 

System.debug('Random Set Element  = ' +setUserID.random());

 

We have Contact us (web2lead) form on our company website. In that contact us form we have asked only four fields Name, Email, Phone and State. Name field is feeding custom Customer Name field (Type Text , size = 255), Email field is feeding Standard Email field, Phone is feeding Standard Phone field and State is feeding Standard State/Province field in salesforce. 

 

I am trying to make a workflow field update that split Customer Name and feed First name and Last name Standard fields but I am not sure which formula functions should I use for splitting. Anyone has any Idea?

Hi

        I have customer date filed on my account object. And if I save any date it will create 10 follow up task according to that date. Means custom date plus 1 day task, custom date plus 4 day task, custom date plus 10 day task but I want to create task that exclude weekend and holidays or they exclude business hours. So I must have to write trigger that create task. Please help me on that.

 

Thanks

I am trying to get all fields API name using getDescribe() and want to use them to bind with triggers foreach statement but couldn't figured out the way to do it. Please Help

Trigger myleadTrigger on lead(after update) {

Lead<String> leadFieldsApiNames = new Lead<String>();
Map<String, SobjectField> fieldMap = Lead.getsObjectType().getDescribe().Fields.getMap();

for(String f :  fieldMap.keySet()) {
leadFieldsApiNames.add(fieldMap.get(f).getDescribe().getName()));
}
for(String s : leadFieldsApiNames){
for(Lead TN : Trigger.new){
 for(Lead TO : Trigger.old){

  if(TO.S != TN.S){
        System.debug('Value has been chaged '+TN.S);
         }

       }
    }
  }
}
I was trying to create test class and I am getting an error saying : Methods defined as testmethod do not support web service callouts. I am pasting my APEX Code below please help me out from here.

global class sendToEncompass{
  
  // @future(callout=true)
  public String EncompassMSG;
   WebService static String basicCallout(String OppID){
  
     opportunity opp = [select id, Loan_Number__c,Borrower_SSN__c, Co_Borrower_First_Name__c, Co_Borrower_Last_Name__c, Co_Borrower_SSN__c, Borrower_Email__c, Borrower_First_Name__c, Borrower_Last_Name__c, owner.email, Subject_Property_Street__c, Subject_Property_City__c, Subject_Property_Zip__c, Processing_Notes__c from Opportunity where id =:OppID];
    
     HttpRequest req = new HttpRequest();
     req.setClientCertificateName('websvcs_cert');
     req.setEndpoint('https://api.XXXYYY.com/eupdate/EUpdateService.svc/insertUpdateLoans');
     req.setMethod('POST');
     req.setHeader('Content-Type', 'application/xml');
     req.setTimeout(120000);
     req.setBody(
     '<LoanEntries xmlns="http://schemas.XXXYYY.org/2001/07/EncompassService">' +
  '<LoanData>' +
  '<LoanField>' +
      '<field_id>CX.SALESFORCELINKIDATE</field_id>' +
      '<field_value>'+System.now().format('MM/dd/yyyy')+'</field_value>' +
    '</LoanField>' +
   '<LoanField>' +
      '<field_id>LoanOfficer</field_id>' +
      '<field_value>'+opp.owner.email+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>36</field_id>' +
      '<field_value>'+opp.Borrower_First_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>37</field_id>' + 
      '<field_value>'+opp.Borrower_Last_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>11</field_id>' + 
      '<field_value>'+opp.Subject_Property_Street__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>12</field_id>' + 
      '<field_value>'+opp.Subject_Property_City__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>15</field_id>' + 
      '<field_value>'+opp.Subject_Property_Zip__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>364</field_id>' + 
      '<field_value>'+opp.Loan_Number__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>65</field_id>' + 
      '<field_value>'+opp.Borrower_SSN__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>68</field_id>' + 
      '<field_value>'+opp.Co_Borrower_First_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>69</field_id>' + 
      '<field_value>'+opp.Co_Borrower_Last_Name__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>97</field_id>' + 
      '<field_value>'+opp.Co_Borrower_SSN__c+'</field_value>' +
    '</LoanField>' +
    '<LoanField>' +
      '<field_id>1240</field_id>' + 
      '<field_value>'+opp.Borrower_Email__c+'</field_value>' +
    '</LoanField>' +
  '</LoanData>' +
'</LoanEntries>'
     );

    
     //req.setEndpoint('https://api.XXXYYY.com/eupdate/EUpdateService.svc/getFieldMappings');
     //req.setMethod('GET');
 
     Http http = new Http();
     try{
     HTTPResponse res = http.send(req);
     System.debug(res.getBody());
     String loanID = res.getBody();
     if(loanID.contains('Created')){
     loanID = loanID.split(':', 14)[2];
     loanID = (loanID.split('<',39)[0]).trim();
     system.debug(loanID);
     opp.GUID__c = loanID;
   //  EncompassMSG = 'Encompass loan record is successfully created, Click ok to continue';
     }
     else{
      loanID = loanID.split(':', 14)[2];
      loanID = (loanID.split('<',39)[0]).trim();
      system.debug(loanID);
      opp.GUID__c = 'Error: ' +loanID;
      //EncompassMSG = 'Error is occured while creating Encompass record, please try again or contact support';
     }
    
     update opp;
     if((opp.GUID__c).contains('Error')){
     return 'Error is occured while creating Encompass record, please try again or contact support';
     }else{
     return 'Encompass loan record is successfully created';
     }
   }
   catch(System.CalloutException e){
    return 'Request time is out, Please try again';
   }
   }
}

Hello,

 

We have Created By and Last Modified By fields by default but Is there any way in salesforce that we can create Last Accessed By using some sort of Session or custom APEX code.

 

Thanks!



We need a new field called “lead metric” in leads: this shd be a formula field which = “Lead Ranking" * "Transaction Dollar Volume”.

 

Lead ranking is an picklst field and other one is the currency field.

 

Please can anyone give the formula for this. I have written this :-

 

IF((ISPICKVAL( Lead_Ranking__c, "0","0",
IF(ISPICKVAL( Lead_Ranking__c, "5", "5",
IF(ISPICKVAL( Lead_Ranking__c, "10", "10",
IF(ISPICKVAL( Lead_Ranking__c, "15", "15", 0, ) ) ) )

CASE(Lead_Ranking__c,"0",0, "5", 5,0) * VALUE(TEXT(Transaction_Dollar_Volume__c)))

 

Hi , i need to calculate the toal amount for closed/won opportunity amount for a particular user and display it in a field of custom object , where the custom object has look up relationship to the user, can any one help me how to do that

 

I tried all way to reduce the number of for loops but I did not a way to reduce them . any ideas is greatly appriciated.

List<ContactCode__c> contCodes=new List<ContactCode__c>();
List<ContactCode__c> delContCodes=new List<ContactCode__c>();
Map<String,List<Contact>> accContMap=new Map<String,List<Contact>>();
Map<String,Map<String,ContactCodeDescription__c>> codeAndCodeCategory=new Map<String,Map<String,ContactCodeDescription__c>>();
for(ContactCodeDescription__c cd:[select code_Type__c,Code__c from ContactCodeDescription__c]){
if(codeAndCodeCategory!=null && codeAndCodeCategory.get(cd.Code_Type__c)!=null &&                                          codeAndCodeCategory.get(cd.Code_Type__c).get(cd.Code__c)==null){                                                 
codeAndCodeCategory.get(cd.Code_Type__c).put(cd.Code__c,cd);                                  
}else{
Map<String,ContactCodeDescription__c> ccdMap=new Map<String,ContactCodeDescription__c>();
ccdMap.put(cd.Code__c,cd);
codeAndCodeCategory.put(cd.Code_Type__c,ccdMap);
}
}
for(Contact contact :[Select Id,AccountId, (Select Id, Category__c, Code__c from Related_Contacts__r) From Contact where AccountId IN: oldMap.keyset()]){
if(accContMap!=null && accContMap.get(contact.AccountId)!=null){
accContMap.get(contact.AccountId ).add(contact);
}else{
accContMap.put(contact.AccountId ,new List<Contact>{contact});
}
}


for(Account act:account){
if(oldMap.get(act.Id).Account_Type__c != act.Account_Type__c){
if(act.Account_Type__c.contains('Listed Company')){
for(Contact cnt:accContMap.get(act.Id)){
for(Contactcode__c cntCode:cnt.Related_Contacts__r){

Contactcode__c updCntCode=new Contactcode__c(Id=cntCode.Id);

if(codeAndCodeCategory!=null && codeAndCodeCategory.get('LC')!=null && codeAndCodeCategory.get('LC').get(cntCode.Code__c)!=null){
updCntCode.Code_Description__c=codeAndCodeCategory.get('LC').get(cntCode.Code__c).Id;
}else if(codeAndCodeCategory!=null && codeAndCodeCategory.get('L1')!=null && codeAndCodeCategory.get('L1').get(cntCode.Code__c)!=null){
updCntCode.Code_Description__c=codeAndCodeCategory.get('L1').get(cntCode.Code__c).Id;
}else{
delContCodes.add(updCntCode);
}
contCodes.add(updCntCode);
}

Hi,

 

 I need to convert set of ids to string.

 

Set<id> accIdSet = new Set<Id>();

 

I need to contcatinate the string to another string.

 

after processing i need to retreive the set of ids.

 

Can someone show me some example around this.

 

 

Thanks

Hi

 

Can any one please help in populating Multiple picklist value into a Formula(Text) field

 

Thanks  in advance

After saving the Account record, I want to capture the ID of the Account in 'Record_Number__c' field of Account. How to write this trigger.

 

My try was as:

 

trigger CopyID on Account (after Insert) {
List <Account> acclst = new List <Account>();
for(Account acc : Trigger.New){
acc.Record_Number__c = acc.Id;
}
}

 

But use of afetr event on Triggere,New , while changing the field will give : System.FinalException: Record is read-only:  error. 

 

How to modify the code to sufice the reqment?

  • August 12, 2013
  • Like
  • 0

Is there a way we can update List or sObject inside Map?

 

Map<id,Opportunity> oppMap = new Map<id,Opportunity>([select id, Name from opportunity]);

 

oppMap.put(OPPORTUNITY_ID, Opportunity.set(1,'oppName'));     //This is currently not available I am just showing you an example.

 

update Map.values();

We have Contact us (web2lead) form on our company website. In that contact us form we have asked only four fields Name, Email, Phone and State. Name field is feeding custom Customer Name field (Type Text , size = 255), Email field is feeding Standard Email field, Phone is feeding Standard Phone field and State is feeding Standard State/Province field in salesforce. 

 

I am trying to make a workflow field update that split Customer Name and feed First name and Last name Standard fields but I am not sure which formula functions should I use for splitting. Anyone has any Idea?

I have created salesforce to salesforce between two Enterprise Production Orgs a month ago and currently we are manually sharing it using External Sharing Related List, everything is working fine but I read some best practice to share it automatically using trigger and class. When I tried to write code in sandbox I found out Salesforce to Salesforce: Partner org is not active and no API calls are allowed. I don't understand what does this mean. Do you have any idea about this how can I successfully write code in sandbox and deploy in production.

Hey All , 

 

I have created a custom button to send the user record for approval. This button is working fine when it is pressed first time. I want that when it is pressed again it should give an alert message "User record already in approval process". I know it is very easy but I am new to programming so pls help out in this.apex class and javascript is below:-

 

Apex class:

 

global class SAPRequest1 {

WebService static void SendApprovalRequest(Id AccountId ) {

// create the new approval request to submit
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setComments('Submitted for approval. Please approve.');
req.setObjectId(AccountId);
// submit the approval request for processing
Approval.ProcessResult result = Approval.Process(req);
// display if the reqeust was successful
System.debug('Submitted for approval successfully: '+result.isSuccess());

}
}

 

 

Javascript&colon;

 

{!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/24.0/apex.js")} 
sforce.apex.execute("SAPRequest","SendApprovalRequest", {id:"{!Account.Id}"}); 
window.alert("Record sent for approval" );

 

 

 

Hello All

 

Child Object : C, with one date field DF1.

When DF1 passes Today (i.e no longer => Today), it should update master object fields.

 

The trigger is not catching this. How should i go about this?

One possible solution is to schedule a batch to run every day, but not sure if thats the best solution.

 

Any help will be appreciated.

 

Thanks

Sid

 

 

 

 

Hi

 

whenever customer sends a mail, it gets stored in the 'Email message' object which is a child to 'Case'  object. Which inturn fires workflow field update and updates 'case: Customer last contacted date' to now() (cross object formula field).
Now in case object we want time dependent action to fire if the priority of case is 'low' and case is inactive for 2 days (customer last contacted date == last modified date) it should send email alert which is not working (my doubt is will this time dependent action fire as we are not
please provide some light on this how we can achieve this workflow rule on case object

hello,

 

Iam an admin but have been dropped into the "Make it work" category and can't figure out the code that is needed.

The code would need to fire everytime the agreement is created, or updated and whenever a matching record is created

 

There is one agreement per unlimited Records.

 

I have two custom objetcs; 

Agreement__c

Matched_Records__c

 

Criteria

Agreement.combined_Provider_Client__c = Matched_Records.Provider_client_SFID__c

 

Action

Copy the value of Agreement.Status__c over to Matched_Records.Matched_Agreement_Status__c

 

Agreement.Status__C is a picklist if that matters

I am new to Apex - Just completed the online SF Apex training, so please go easy on me.

 

I am trying to better understand Triggers so I have written some simple code to better my understanding.

 

Goal: When a new Assignment (custom object) is created or updated the trigger should create or update the record on  TestObject (another custom object) and bring over the field values 'Name', 'Waybill', 'Hello' from Assignment Obj.  

 

trigger TriggerOne on Assignment__c (before insert, before update) {

     

     list<TestObject__c> to = new list<TestObject__c> ();

     for (Assignment__c Ass :Trigger.new) { 

     to.add(new TestObject__c(Name = Ass.Truck__c
                               Waybill__c = Ass.Waybill_Number__c,
                                Hello__c = 'byrd'));
     }

     

     insert to;

}

 

 

The code runs with no errors.

 

First issue: Every time I update a field on the Assignment Obj that was created, the trigger fires and creates another record on the TestObj.

 

Second issue: The Truck field is a required lookup field on Assignment Obj and is writting some id string on the newly created record for TestObject rather that the actual truck number e.g.' a0EL0000000YvRJMA0' rather than '210'.

 

 

Thanks in advance for any help.

 

 

 

 

  • March 01, 2013
  • Like
  • 0