• Ivar@Marel
  • NEWBIE
  • 30 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies
Hi all.

I have been reading around all kinds of documentation and posts and haven't been able to wrap my head around what I need to accomplish my goal. What I am trying to achieve is to write a custom Apex REST web service that allows an the invoking application to create a new custom object record, and at the same time submit a list of file attachments to be latched onto the newly created record.

I have written a few services that create a new record from a REST post, so that isn't the hindrance, but rather the part where I try to include file attachments. My initial assumption was to just include a List<Blob> in the definition of parameters, but that doesn't seem to be allowed in a http service.

Any nudges in the right direction would we wildly appreciated :)

A stripped down sample of my current code below:
@RestResource(urlMapping='/WarrantyClaim/*')
global with sharing class WS_WarrantyClaims{

  global class ParamData{
    public String strWONumber;
    public String strCompanyName;
    public String strCompanyAddress;
    
    public String strFailureDescription;
    public Date dDeliveryDate;
    public Integer iProductionHours;

    
    public List<Blob> attachments;
  }
  
  
  global class ReturnData{
      String strStatus;
      String strErrorMessage;
      String strClaimId;
  }
    
  @HttpPost
  global static ReturnData doPost(ParamData params){
    ReturnData retData = new ReturnData();
    
    
    WarrantyClaim__c wc = new WarrantyClaim__c();
    wc.ltClaimDescription__c = params.strFailureDescription;
    
    try{
        insert wc;
        retData.strStatus = 'Success';
        retData.strClaimId = wc.Id;
    }
    catch( Exception e ){
        retData.strStatus = 'Error';
        retData.strErrorMessage = e.getMessage();
    }
    
    return retData;
  }
 }



 
Hi all.

I am looking at options to get my Platform Developer Certification I at Dreamforce this year. I have been browsing around for how this works but can't find anything conclusive. Does anyone know if this is an offering during DF, and if so if I will need to plan to arrive early, or leave late for the conference?
Hi all.
 
I am hoping someone can point me in the right direction with my attempt to set up SAML and Federated Authentication. We are already using ADFS within our organization for other tools, and my counterpart on that end ensures me that everything has been set up correctly from his end and there must be something wrong in the config on the Salesforce end.

When I try the SAML Assertion Verifier I always get stuck on step 11 where it fails to verify the signature. Included is a screenshot of my settings and I would really appreciate it if anyone sees something clearly wrong that I could get a hint.

Best regards, IvarUser-added image
 
Hi all. I tried logging a case asking salesforce about this but was rejected and directed here. Can anyone here shine a light on why I don't get this option in my Setup menu?

I am attempting to follow the guidelines in this help article: https://help.salesforce.com/HTViewHelpDoc?id=external_secure_agent.htm

and I am unable to comply with the step that reads: 

"In Setup, click Develop | Secure Agents."

This option does not appear in my org's setup menu. Is there anything I need to activate or configure before that can happen?

With thanks in advance,
Ivar

Hi everyone.

 

Has anyone attempted to display a dashboard as part of a visualforce page? I have been browsing around and haven't found anything. The reason I ask is that I want to show one of our dashboards on our company's intranet websites, and figured the easiest way to do it would be to display it in visualforce and publish it as a Site that the intranet web could then incorporate into it's layout.

 

If anyone has any hints or tips I'm all ears :)

 

Regards,

Ivar

Hi.
I have a problem that I can't get around in my code. I have a small webservice that receives data from an outside source and uses that to construct a task and associate it with a contact or lead. the webservice has only one method called "logSingleEmail". This method takes a list of a custom class called DocumentLink as one of it's arguments.  Now all tests run normally and I am able to invoke this code successfully from Eclipse as anonymous code. The problem is that the WSDL doesn't list the attributes of the DocumentLink class, and my customer can't invoke the webservice as a result.
Hopefully this is just some small oversight on my behalf that someone can help me with. Included below are both the code from my webservice as well as the generated wsdl:

 

APEX CODE:

 

global class WS_LogCustomerEmail {
	
	static webservice CallResult logSingleEmail( String strCustomerEmail, String strIPadUdid, List<DocumentLink> documents ){
		//lookup lead/contact from strCustomerEmail
		
		Boolean bWasFound = false;
		Contact c = new Contact();
		Lead l = new Lead();
		try{
			l = [Select Id from Lead where Email =: strCustomerEmail limit 1];
		}
		catch( Exception e){
		
	
			try{
				c = [Select Id from Contact where Email =: strCustomerEmail limit 1];
				bWasFound = true;
			}
			catch( Exception ex){
				return new CallResult('Email not found');
			}
			/*if( c != null ) bWasFound = true;
			else return new CallResult('Customer email was not found in Salesforce');
			*/
		}
		
		
		//construct email body from list and strIPadUdid
		String emailBody = 'The following document links were sent via offline catalog:\n\n';
		for( DocumentLink link:documents){
			emailBody += link.strDocumentName + ' - ' + link.strDocumentUrl + '\n';
		}
		emailBody += '\n from user: ' + strIPadUdid;
		
		Task t = new Task();
		if( l.Id != null) t.WhoId = l.Id;
		else if( c.Id != null) t.WhoId = c.Id;
		else return new CallResult('Unknown customer Id');
		
		t.Description = emailBody;
		t.Subject = 'Documents from offline catalog';
		
		try{
			insert t;
		}
		catch ( Exception e){
			return new CallResult(e.getMessage());
		}
		
		return new CallResult('1');	
	}
	
	global class CallResult{
		public String strResult;
		public Callresult( String strIn ){ strResult = strIn; }	
	}
	
	global class DocumentLink{
		public String strDocumentName;
		public String strDocumentUrl;
		
	}
	
	static testMethod void coverCodeForService(){
		Lead l = new Lead();
		l.Email = 'ivargu@thisisjustfortestingpurposes.com';
		l.LastName = 'Gunnarsson';
		l.Company = 'MyCompany';
		insert l;
		
		DocumentLink dl = new DocumentLink();
		dl.strDocumentName = 'Name';
		dl.strDocumentUrl = 'http://www.mbl.is';
		List<DocumentLink> dlList = new List<DocumentLink>();
		dlList.add(dl);
		
		CallResult result = logSingleEmail( 'ivargu@thisisjustfortestingpurposes.com', '12345', dlList );
		
		
	}
}

   WSDL:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!-- Web Services API : WS_LogCustomerEmail -->
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://soap.sforce.com/schemas/class/WS_LogCustomerEmail" targetNamespace="http://soap.sforce.com/schemas/class/WS_LogCustomerEmail">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/WS_LogCustomerEmail">
<xsd:element name="DebuggingInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="debugLog" 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: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="All"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="LogCategoryLevel">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Internal"/>
<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: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="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="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:element name="CallOptions">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="client" 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:element name="AllowFieldTruncationHeader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="CallResult">
<xsd:sequence/>
</xsd:complexType>
<xsd:complexType name="DocumentLink">
<xsd:sequence/>
</xsd:complexType>
<xsd:element name="logSingleEmail">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="strCustomerEmail" type="xsd:string" nillable="true"/>
<xsd:element name="strIPadUdid" type="xsd:string" nillable="true"/>
<xsd:element name="documents" minOccurs="0" maxOccurs="unbounded" type="tns:DocumentLink" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="logSingleEmailResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="result" type="tns:CallResult" 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="logSingleEmailRequest">
<part element="tns:logSingleEmail" name="parameters"/>
</message>
<message name="logSingleEmailResponse">
<part element="tns:logSingleEmailResponse" name="parameters"/>
</message>
<portType name="WS_LogCustomerEmailPortType">
<operation name="logSingleEmail">
<input message="tns:logSingleEmailRequest"/>
<output message="tns:logSingleEmailResponse"/>
</operation>
</portType>
<binding name="WS_LogCustomerEmailBinding" type="tns:WS_LogCustomerEmailPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="logSingleEmail">
<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="WS_LogCustomerEmailService">
<documentation/>
<port binding="tns:WS_LogCustomerEmailBinding" name="WS_LogCustomerEmail">
<soap:address location="https://cs3-api.salesforce.com/services/Soap/class/WS_LogCustomerEmail"/>
</port>
</service>
</definitions>

 Best regards,

Ivar

 

Hi all.
 
I am hoping someone can point me in the right direction with my attempt to set up SAML and Federated Authentication. We are already using ADFS within our organization for other tools, and my counterpart on that end ensures me that everything has been set up correctly from his end and there must be something wrong in the config on the Salesforce end.

When I try the SAML Assertion Verifier I always get stuck on step 11 where it fails to verify the signature. Included is a screenshot of my settings and I would really appreciate it if anyone sees something clearly wrong that I could get a hint.

Best regards, IvarUser-added image
 
Hi all. I tried logging a case asking salesforce about this but was rejected and directed here. Can anyone here shine a light on why I don't get this option in my Setup menu?

I am attempting to follow the guidelines in this help article: https://help.salesforce.com/HTViewHelpDoc?id=external_secure_agent.htm

and I am unable to comply with the step that reads: 

"In Setup, click Develop | Secure Agents."

This option does not appear in my org's setup menu. Is there anything I need to activate or configure before that can happen?

With thanks in advance,
Ivar

Hi,

 

Is it possible to have SSO for Excel Connector? Please suggest if there is a way to do it..

Hi everyone.

 

Has anyone attempted to display a dashboard as part of a visualforce page? I have been browsing around and haven't found anything. The reason I ask is that I want to show one of our dashboards on our company's intranet websites, and figured the easiest way to do it would be to display it in visualforce and publish it as a Site that the intranet web could then incorporate into it's layout.

 

If anyone has any hints or tips I'm all ears :)

 

Regards,

Ivar

Hi.
I have a problem that I can't get around in my code. I have a small webservice that receives data from an outside source and uses that to construct a task and associate it with a contact or lead. the webservice has only one method called "logSingleEmail". This method takes a list of a custom class called DocumentLink as one of it's arguments.  Now all tests run normally and I am able to invoke this code successfully from Eclipse as anonymous code. The problem is that the WSDL doesn't list the attributes of the DocumentLink class, and my customer can't invoke the webservice as a result.
Hopefully this is just some small oversight on my behalf that someone can help me with. Included below are both the code from my webservice as well as the generated wsdl:

 

APEX CODE:

 

global class WS_LogCustomerEmail {
	
	static webservice CallResult logSingleEmail( String strCustomerEmail, String strIPadUdid, List<DocumentLink> documents ){
		//lookup lead/contact from strCustomerEmail
		
		Boolean bWasFound = false;
		Contact c = new Contact();
		Lead l = new Lead();
		try{
			l = [Select Id from Lead where Email =: strCustomerEmail limit 1];
		}
		catch( Exception e){
		
	
			try{
				c = [Select Id from Contact where Email =: strCustomerEmail limit 1];
				bWasFound = true;
			}
			catch( Exception ex){
				return new CallResult('Email not found');
			}
			/*if( c != null ) bWasFound = true;
			else return new CallResult('Customer email was not found in Salesforce');
			*/
		}
		
		
		//construct email body from list and strIPadUdid
		String emailBody = 'The following document links were sent via offline catalog:\n\n';
		for( DocumentLink link:documents){
			emailBody += link.strDocumentName + ' - ' + link.strDocumentUrl + '\n';
		}
		emailBody += '\n from user: ' + strIPadUdid;
		
		Task t = new Task();
		if( l.Id != null) t.WhoId = l.Id;
		else if( c.Id != null) t.WhoId = c.Id;
		else return new CallResult('Unknown customer Id');
		
		t.Description = emailBody;
		t.Subject = 'Documents from offline catalog';
		
		try{
			insert t;
		}
		catch ( Exception e){
			return new CallResult(e.getMessage());
		}
		
		return new CallResult('1');	
	}
	
	global class CallResult{
		public String strResult;
		public Callresult( String strIn ){ strResult = strIn; }	
	}
	
	global class DocumentLink{
		public String strDocumentName;
		public String strDocumentUrl;
		
	}
	
	static testMethod void coverCodeForService(){
		Lead l = new Lead();
		l.Email = 'ivargu@thisisjustfortestingpurposes.com';
		l.LastName = 'Gunnarsson';
		l.Company = 'MyCompany';
		insert l;
		
		DocumentLink dl = new DocumentLink();
		dl.strDocumentName = 'Name';
		dl.strDocumentUrl = 'http://www.mbl.is';
		List<DocumentLink> dlList = new List<DocumentLink>();
		dlList.add(dl);
		
		CallResult result = logSingleEmail( 'ivargu@thisisjustfortestingpurposes.com', '12345', dlList );
		
		
	}
}

   WSDL:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!-- Web Services API : WS_LogCustomerEmail -->
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://soap.sforce.com/schemas/class/WS_LogCustomerEmail" targetNamespace="http://soap.sforce.com/schemas/class/WS_LogCustomerEmail">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/WS_LogCustomerEmail">
<xsd:element name="DebuggingInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="debugLog" 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: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="All"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="LogCategoryLevel">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Internal"/>
<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: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="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="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:element name="CallOptions">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="client" 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:element name="AllowFieldTruncationHeader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="CallResult">
<xsd:sequence/>
</xsd:complexType>
<xsd:complexType name="DocumentLink">
<xsd:sequence/>
</xsd:complexType>
<xsd:element name="logSingleEmail">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="strCustomerEmail" type="xsd:string" nillable="true"/>
<xsd:element name="strIPadUdid" type="xsd:string" nillable="true"/>
<xsd:element name="documents" minOccurs="0" maxOccurs="unbounded" type="tns:DocumentLink" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="logSingleEmailResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="result" type="tns:CallResult" 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="logSingleEmailRequest">
<part element="tns:logSingleEmail" name="parameters"/>
</message>
<message name="logSingleEmailResponse">
<part element="tns:logSingleEmailResponse" name="parameters"/>
</message>
<portType name="WS_LogCustomerEmailPortType">
<operation name="logSingleEmail">
<input message="tns:logSingleEmailRequest"/>
<output message="tns:logSingleEmailResponse"/>
</operation>
</portType>
<binding name="WS_LogCustomerEmailBinding" type="tns:WS_LogCustomerEmailPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="logSingleEmail">
<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="WS_LogCustomerEmailService">
<documentation/>
<port binding="tns:WS_LogCustomerEmailBinding" name="WS_LogCustomerEmail">
<soap:address location="https://cs3-api.salesforce.com/services/Soap/class/WS_LogCustomerEmail"/>
</port>
</service>
</definitions>

 Best regards,

Ivar

 

Hi, Any one please help me for getting 75% code coverage, I am getting 71% code coverage. I tried a lot but not getting.
My Class is:

}

global class scheduledmonthlyTaskJobScheduler
{

public string times{set;get;}

global void scheduledmonthlyTaskJobScheduler()
{

}
public static void start()
{
string ctname;
id jobid1;
for(Testscheduling__c ct:[select name from Testscheduling__c ])
ctname=ct.name;
system.debug(ctname+'123@@@@@@@@');
if(ctname!=null || ctname!='')
{
for(crontrigger ctr :[select id,CronExpression from crontrigger where id=:ctname])
{
if(ctr!=null)
jobid1=ctr.id;
system.debug(ctr+'########'+jobid1);
System.abortJob(jobid1);
}
}
list<Testscheduling__c>  tt= new list<testscheduling__c>([select id from testscheduling__c]);
if(tt.size()>0)
delete tt;
Schedule_Time__c stc = Schedule_Time__c.getinstance();
if(stc.Date_Time__c!=null)
 {
 string str = string.valueof(stc.Date_Time__c);
 String[] myDateOnly = str.split(' ');
 String[] strDate = myDateOnly[0].split('-');   
 String[] strtime = myDateOnly[1].split(':');  
 string Month=string.valueof(system.today().month());
 string year=string.valueof(system.today().year());
 string Day= strDate[2];
 string hrs= strtime[0];
 string  mins=strtime[1];
 string sec= strtime[2];
 Datetime dcomp=datetime.newInstance(system.today().year(),system.today().month(),Integer.valueof(strDate[2]),Integer.valueof(strtime[0]),Integer.valueof(strtime[1]),Integer.valueof(strtime[2]));
 if(system.now()<dcomp){
   
 string  times = sec+' '+Mins+' '+hrs+' '+day+' '+Month+' '+'?'+' '+year;
 monthlyTaskscheduled st= new monthlyTaskscheduled();
 string SCHEDULE_NAME = 'scheduledmonthlyTask';
 //System.schedule(SCHEDULE_NAME,times,st);
 Id jobid = System.schedule(SCHEDULE_NAME,times,st);
 Testscheduling__c t = new Testscheduling__c();
  t.name=jobid;
  insert t;
  }
 }
 }

 

My test coverage class is:

 

}

public class testscheduledmonthlyTaskJobScheduler
{
static testMethod void test()
{
scheduledmonthlyTaskJobScheduler s=new scheduledmonthlyTaskJobScheduler();
list<Schedule_Time__c> slist=new list<Schedule_Time__c>(); 
set<id> pset=new set<id>();
Testscheduling__c t1=new Testscheduling__c(name='aaa');
insert t1;
datetime d1;
monthlyTaskscheduled st= new monthlyTaskscheduled();
Testscheduling__c t = new Testscheduling__c();
for(profile p:[select id,name from profile where name='System administrator'])
pset.add(p.id);
for(Schedule_Time__c s1:[select id,date_time__c,SetupOwnerId from Schedule_Time__c where SetupOwnerId IN :pset])
{
if(s1.id!=null)
{
s1.date_time__c=system.now().adddays(1);
d1=s1.date_time__c;
slist.add(s1);
}
}
update slist;
Schedule_Time__c stc = Schedule_Time__c.getinstance();
//Datetime d2=datetime.newInstance(system.today().year(),system.today().month(),stc.date_time__C.day(),stc.date_time__c.hour(),stc.date_time__c.minute(),stc.date_time__C.second()); 
Datetime d2=datetime.newInstance(system.today().year(),system.today().month(),d1.day(),d1.hour(),d1.minute(),d1.second());
if(system.now()< d2)
{
string times=d1.second()+' '+d1.minute()+' '+d1.hour()+' '+d1.day()+' '+system.today().month()+' ? '+system.today().year();
Id jobid = System.schedule('name',times,st);
t.name=jobid;
insert t;
}
scheduledmonthlyTaskJobScheduler.start();
s.scheduledmonthlyTaskJobScheduler();
}

 

I code which is in bold is not covered. please help me for solving this.. Thanks in advance.

 

Any ideas on how to fix this? Thanks.

 

Save error: Unable to perform save on all files: com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor    **** line 1    Force.com save problem