• Hayley Dyer 16
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
We have a connection from Opportunity to our wordpress site but there's an issue... it's doesn't work. I've spent the best part of 2 years trying to resolve it and this is my last hope. I've paid someone to do it but they've not understood and it the connection has some issues. We're a recruitment company so it's pretty important it works. Can anyone help? The code they have written is as follows:

OpportunityCallOut:


trigger OpportunityCallout on Opportunity (after insert,after update) {
String json;

  
    
 for (Opportunity a : Trigger.new) {
 
 Opportunity opp= [SELECT Id,Name,Recruiter_ID__c,Recruiter__c,Recruiter__r.Email  FROM Opportunity WHERE Id=:a.id];
 System.Debug( 'test' + opp.Recruiter__r.Email);
  System.debug('jobType: '+a.Job_Type__c);
   System.debug('package: '+a.Package__c);
   
  System.debug('Status: '+a.Status__c);
   String jobtermvalue='';
  if(a.Job_Type__c!=null&& a.Job_Type__c!=''){
  
 jobtermvalue=a.Job_Type__c ;
  /*jobtermvalue=jobtermvalue.toLowerCase();
  System.Debug(jobtermvalue);*/
 }
    
  
 /* String qualification=a.Website_Qualification_Level__c ;
  qualification=qualification.toLowerCase();
  System.Debug(qualification);*/
  
 String unixTimeexpire='';
 try
 {
 DateTime data1 =a.Expires_on__c;
 
 System.Debug('test' + data1);
 if(data1!=null){
 unixTimeexpire = ''+data1.getTime()/1000;
 System.debug('Unix time-stamp: '+unixTimeexpire );
}
}
catch (Exception e) {
}

 
 String unixTimepsted='';
try{
Datetime dt= a.Posted_on__c;
System.Debug('test' + dt);
if(dt!=null){
unixTimepsted = ''+dt.getTime()/1000;
System.debug('Unix time-stamp -posted on: '+unixTimepsted );
 }
 }
 
 catch (Exception e) {
}
 
 String unixTime1='';
 try{
 
DateTime  d1=a.Application_Deadline_Date__c;
System.Debug('test' + d1);
if(d1!=null){
//Datetime dt1= datetime.newInstance(d1.year(), d1.month(),d1.day());
unixTime1 = ''+d1.getTime()/1000;
System.debug('Unix time-stamp: '+unixTime1 );
 }
 }
 
 
 catch (Exception e) {
}
 
  
 
 String jobDescritption='';
if(a.Job_Description_Rich__c!=null&& a.Job_Description_Rich__c!=''){
jobDescritption=a.Job_Description_Rich__c;

}

WebServiceCallout.jobdetail(String.ValueOf(a.Name),String.ValueOf(jobDescritption),String.ValueOf(a.Job_Number__c),String.ValueOf(unixTimepsted),String.ValueOf(unixTimeexpire),String.ValueOf(unixTime1),String.ValueOf(a.Job_Publish_URL__c),String.ValueOf(a.Website_Country__c),String.ValueOf(a.Street_Address__c),String.ValueOf(a.Offered_Salary__c),String.ValueOf(a.Experience__c),'male',String.ValueOf(a.Job_Sector__c),String.ValueOf(a.Website_Qualification_Level__c),String.ValueOf(a.Website_Job_Sector__c),String.ValueOf(jobtermvalue),String.ValueOf(a.ID),String.ValueOf(a.Website_City__c),String.Valueof(a.Career_Level__c),String.Valueof(a.Featured__c),String.Valueof(opp.Recruiter__r.Email),String.Valueof(a.Status__c),String.Valueof(a.Package__c));

//Work  WebServiceCallout.jobdetail(String.ValueOf(a.Name),String.ValueOf(jobDescritption),String.ValueOf(a.Job_Number__c),String.ValueOf(unixTime3),String.ValueOf(unixTime),String.ValueOf(unixTime1),String.ValueOf(a.Job_Publish_URL__c),String.ValueOf(a.Website_Country__c),String.ValueOf(a.Street_Address__c),String.ValueOf(a.Offered_Salary__c),String.ValueOf(a.Years_Experience__c),'male',String.ValueOf(a.Job_Sector__c),String.ValueOf(a.Website_Qualification_Level__c),String.ValueOf(a.Website_Job_Sector__c),String.ValueOf(jobtermvalue),String.ValueOf(a.ID),String.ValueOf(a.Website_City__c));
// WebServiceCallout1.jobdetail1(a.Name,a.Job_Description_Rich__c,a.Job_Number__c,a.CloseDate,a.Estimated_Close_Date__c,a.Job_Publish_URL__c,a.Country__c,a.Street_Address__c,a.Salary_Range__c,a.Years_Experience__c,'male',a.Job_Sector__c,a.Qualification_Level__c,a.Website_Job_Sector__c,'freelance',a.ID);


   } 
}


Test WebService:

@isTest
public class TestNewWebService
{
 
   static Opportunity  getTestopp(){
        Opportunity  myAcc = new Opportunity  (Name = 'Test',StageName='testvalue',CloseDate=System.Today(),Job_Description_Rich__c='testdata',Posted_on__c=System.Today(),Expires_on__c=System.Today(),Job_Type__c='Freelance',Application_Deadline_Date__c=System.Today(),Package__c='1449125017',Status__c='Active');
        insert myAcc;
        return myAcc;
    }
    
    private static testMethod void callFutureMethod() {        
        Opportunity  a = getTestopp();
        System.Debug(a);
        Test.startTest();
        Test.setMock(HttpCalloutMock.class, new CalloutMock());
        
         WebServiceCallout.jobdetail('testname',String.Valueof(a.Job_Description_Rich__c),'1527105600','1527105600','1527105600','1527105600','www.google.com','india','rajapark','10000','2years','male','IT','Diploma','testdata','freelance',String.Valueof(a.ID),'RajaPark','Diploma','yes','test@gmail.com','1449125017','active');
      
      
        Test.stopTest();
        
    }
    
     
}

Can you see anything that would prevent the opportunities from being shown on our website? If we make a change to the opportunity the published date changes and it drops off the site
I've created a button however I'd like to predetermine the email template used. How do I do this? There doesn't seem to be an option 

User-added image

User-added image
User-added image
Hi 

I've been searching for about a week on this and can't seem to find the solution. I'm pretty new to Apex Classes and this is way beyond me

I've set up Email Services in my sandbox account, inbound emails and attachments are attaching to the contact record perfectly however what I really want to do is parse the text content of the attachment to a field on the contact record itself. It seems most people have a problem attaching the document itself rather than the content of that document

Thank you so much in advance. 
We have a connection from Opportunity to our wordpress site but there's an issue... it's doesn't work. I've spent the best part of 2 years trying to resolve it and this is my last hope. I've paid someone to do it but they've not understood and it the connection has some issues. We're a recruitment company so it's pretty important it works. Can anyone help? The code they have written is as follows:

OpportunityCallOut:


trigger OpportunityCallout on Opportunity (after insert,after update) {
String json;

  
    
 for (Opportunity a : Trigger.new) {
 
 Opportunity opp= [SELECT Id,Name,Recruiter_ID__c,Recruiter__c,Recruiter__r.Email  FROM Opportunity WHERE Id=:a.id];
 System.Debug( 'test' + opp.Recruiter__r.Email);
  System.debug('jobType: '+a.Job_Type__c);
   System.debug('package: '+a.Package__c);
   
  System.debug('Status: '+a.Status__c);
   String jobtermvalue='';
  if(a.Job_Type__c!=null&& a.Job_Type__c!=''){
  
 jobtermvalue=a.Job_Type__c ;
  /*jobtermvalue=jobtermvalue.toLowerCase();
  System.Debug(jobtermvalue);*/
 }
    
  
 /* String qualification=a.Website_Qualification_Level__c ;
  qualification=qualification.toLowerCase();
  System.Debug(qualification);*/
  
 String unixTimeexpire='';
 try
 {
 DateTime data1 =a.Expires_on__c;
 
 System.Debug('test' + data1);
 if(data1!=null){
 unixTimeexpire = ''+data1.getTime()/1000;
 System.debug('Unix time-stamp: '+unixTimeexpire );
}
}
catch (Exception e) {
}

 
 String unixTimepsted='';
try{
Datetime dt= a.Posted_on__c;
System.Debug('test' + dt);
if(dt!=null){
unixTimepsted = ''+dt.getTime()/1000;
System.debug('Unix time-stamp -posted on: '+unixTimepsted );
 }
 }
 
 catch (Exception e) {
}
 
 String unixTime1='';
 try{
 
DateTime  d1=a.Application_Deadline_Date__c;
System.Debug('test' + d1);
if(d1!=null){
//Datetime dt1= datetime.newInstance(d1.year(), d1.month(),d1.day());
unixTime1 = ''+d1.getTime()/1000;
System.debug('Unix time-stamp: '+unixTime1 );
 }
 }
 
 
 catch (Exception e) {
}
 
  
 
 String jobDescritption='';
if(a.Job_Description_Rich__c!=null&& a.Job_Description_Rich__c!=''){
jobDescritption=a.Job_Description_Rich__c;

}

WebServiceCallout.jobdetail(String.ValueOf(a.Name),String.ValueOf(jobDescritption),String.ValueOf(a.Job_Number__c),String.ValueOf(unixTimepsted),String.ValueOf(unixTimeexpire),String.ValueOf(unixTime1),String.ValueOf(a.Job_Publish_URL__c),String.ValueOf(a.Website_Country__c),String.ValueOf(a.Street_Address__c),String.ValueOf(a.Offered_Salary__c),String.ValueOf(a.Experience__c),'male',String.ValueOf(a.Job_Sector__c),String.ValueOf(a.Website_Qualification_Level__c),String.ValueOf(a.Website_Job_Sector__c),String.ValueOf(jobtermvalue),String.ValueOf(a.ID),String.ValueOf(a.Website_City__c),String.Valueof(a.Career_Level__c),String.Valueof(a.Featured__c),String.Valueof(opp.Recruiter__r.Email),String.Valueof(a.Status__c),String.Valueof(a.Package__c));

//Work  WebServiceCallout.jobdetail(String.ValueOf(a.Name),String.ValueOf(jobDescritption),String.ValueOf(a.Job_Number__c),String.ValueOf(unixTime3),String.ValueOf(unixTime),String.ValueOf(unixTime1),String.ValueOf(a.Job_Publish_URL__c),String.ValueOf(a.Website_Country__c),String.ValueOf(a.Street_Address__c),String.ValueOf(a.Offered_Salary__c),String.ValueOf(a.Years_Experience__c),'male',String.ValueOf(a.Job_Sector__c),String.ValueOf(a.Website_Qualification_Level__c),String.ValueOf(a.Website_Job_Sector__c),String.ValueOf(jobtermvalue),String.ValueOf(a.ID),String.ValueOf(a.Website_City__c));
// WebServiceCallout1.jobdetail1(a.Name,a.Job_Description_Rich__c,a.Job_Number__c,a.CloseDate,a.Estimated_Close_Date__c,a.Job_Publish_URL__c,a.Country__c,a.Street_Address__c,a.Salary_Range__c,a.Years_Experience__c,'male',a.Job_Sector__c,a.Qualification_Level__c,a.Website_Job_Sector__c,'freelance',a.ID);


   } 
}


Test WebService:

@isTest
public class TestNewWebService
{
 
   static Opportunity  getTestopp(){
        Opportunity  myAcc = new Opportunity  (Name = 'Test',StageName='testvalue',CloseDate=System.Today(),Job_Description_Rich__c='testdata',Posted_on__c=System.Today(),Expires_on__c=System.Today(),Job_Type__c='Freelance',Application_Deadline_Date__c=System.Today(),Package__c='1449125017',Status__c='Active');
        insert myAcc;
        return myAcc;
    }
    
    private static testMethod void callFutureMethod() {        
        Opportunity  a = getTestopp();
        System.Debug(a);
        Test.startTest();
        Test.setMock(HttpCalloutMock.class, new CalloutMock());
        
         WebServiceCallout.jobdetail('testname',String.Valueof(a.Job_Description_Rich__c),'1527105600','1527105600','1527105600','1527105600','www.google.com','india','rajapark','10000','2years','male','IT','Diploma','testdata','freelance',String.Valueof(a.ID),'RajaPark','Diploma','yes','test@gmail.com','1449125017','active');
      
      
        Test.stopTest();
        
    }
    
     
}

Can you see anything that would prevent the opportunities from being shown on our website? If we make a change to the opportunity the published date changes and it drops off the site
I need to update an SalesforceIsTerrible apex trigger, but I never did it before. Does anybody know the steps to do this?

Best,
Andrey
Hi 

I've been searching for about a week on this and can't seem to find the solution. I'm pretty new to Apex Classes and this is way beyond me

I've set up Email Services in my sandbox account, inbound emails and attachments are attaching to the contact record perfectly however what I really want to do is parse the text content of the attachment to a field on the contact record itself. It seems most people have a problem attaching the document itself rather than the content of that document

Thank you so much in advance. 
Hi,

I am a new Admin and currently learning how to use VisualForce.

I would like to auto populate the email address of my leads directly into the "to" in the Email Action so that when my sales reps want to send an email to a lead, the elads email address is already generated as a recipient. 

I assume it is done with VisualForce but I don't know how exactly, could someone assist on this?

Thanks. 
  • June 04, 2017
  • Like
  • 0