-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
6Questions
-
8Replies
Test Class for ServiceMax custom Apex Code
Hi,
I have written a custom apex code for web service integration. Input parameter is the RecordID.
The functionality working fine but i am unable to achieve code coverage since i am unable to pass the Input parameter to my method "sfmOperation".
global class ServiceMaxOutbound{
webservice static SVMXC.INTF_WebServicesDef.INTF_Response sfmOperation(SVMXC.INTF_We bServicesDef.INTF_Response request)
{
String recordId,logDescription;
List<SVMXC__Service_Order__c> listWO;
for(SVMXC.INTF_WebServicesDef.SVMXMap objSVXMMap : request.valueMap) { if(objSVXMMap.key == 'WorkOrder_ID'){
recordId = objSVXMMap.value;
}
}
Any suggestions will be highly appreciated as can't find any doc on how to write test classes for servicemax apex class.
I have written a custom apex code for web service integration. Input parameter is the RecordID.
The functionality working fine but i am unable to achieve code coverage since i am unable to pass the Input parameter to my method "sfmOperation".
global class ServiceMaxOutbound{
webservice static SVMXC.INTF_WebServicesDef.INTF_Response sfmOperation(SVMXC.INTF_We bServicesDef.INTF_Response request)
{
String recordId,logDescription;
List<SVMXC__Service_Order__c> listWO;
for(SVMXC.INTF_WebServicesDef.SVMXMap objSVXMMap : request.valueMap) { if(objSVXMMap.key == 'WorkOrder_ID'){
recordId = objSVXMMap.value;
}
}
Any suggestions will be highly appreciated as can't find any doc on how to write test classes for servicemax apex class.
-
- AMIT KUMAR 73
- November 10, 2014
- Like
- 0
- Continue reading or reply
SOQL Query to Retrieve Price Book Name for a associated product
Hi,
I am trying to retrieve Product Name, Product code & Pricebook Name associated with a PRODUCT.
--------------------------------------------------------------------------------------------------------------------------------------------------------
Product2 productdet = [Select Id, Name, ProductCode From Product2 where id='01tA00000033x2z'];
--------------------------------------------------------------------------------------------------------------------------------------------------------
How to modify this query to associate PriceBook details this Product belongs to.

I am trying to retrieve Product Name, Product code & Pricebook Name associated with a PRODUCT.
--------------------------------------------------------------------------------------------------------------------------------------------------------
Product2 productdet = [Select Id, Name, ProductCode From Product2 where id='01tA00000033x2z'];
--------------------------------------------------------------------------------------------------------------------------------------------------------
How to modify this query to associate PriceBook details this Product belongs to.
-
- AMIT KUMAR 73
- October 02, 2014
- Like
- 0
- Continue reading or reply
SOAP Request / Response Logging in Apex : Consumed a WSDL for Web Service Call
HI,
I am trying to print the Request XML that is getting passed to the invocation method:
processRequest_x.ProcessWorkOrder(account_x);
Reason: The Object schema structure shared as part of the wsdl is very very complex and i am not sure whether i am able to bind objects properly as part of my request. Is there any way to print the request XML that is getting parsed in the invocation part.
I am trying to print the Request XML that is getting passed to the invocation method:
processRequest_x.ProcessWorkOrder(account_x);
Reason: The Object schema structure shared as part of the wsdl is very very complex and i am not sure whether i am able to bind objects properly as part of my request. Is there any way to print the request XML that is getting parsed in the invocation part.
-
- AMIT KUMAR 73
- October 01, 2014
- Like
- 0
- Continue reading or reply
Web Service callout from a custom button
Hi,
I am trying to achieve one functionality:
1. Creating a custom button on "CASE" object say "Submit To Web Service"
2. Creating a checkbok field to select one or more case for a certain account.
3. Based on the selection (point#2) it should send out the case related information to some third part web service using Apex call out.
Is this possible to build this logic in salesforce?
I am trying to achieve one functionality:
1. Creating a custom button on "CASE" object say "Submit To Web Service"
2. Creating a checkbok field to select one or more case for a certain account.
3. Based on the selection (point#2) it should send out the case related information to some third part web service using Apex call out.
Is this possible to build this logic in salesforce?
-
- AMIT KUMAR 73
- September 15, 2014
- Like
- 0
- Continue reading or reply
Managing Authentication in REST Callout
Hi,
Kindly suggest the best practice to configure Authentication details (like username / password) inside Salesforce for REST call out using HttpRequest class.

Kindly suggest the best practice to configure Authentication details (like username / password) inside Salesforce for REST call out using HttpRequest class.
-
- AMIT KUMAR 73
- September 02, 2014
- Like
- 0
- Continue reading or reply
Custom Web Service to return list of records in accounts object
Hi,
my requirement is to send all records (Work Order - custom object) to some third part app by exposing a custom WSDL file.
I developer the below code, which compiles fine in salesforce but gives an error while testing the same in SOAP UI tool.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
global class TestWOStatus{
webservice static LIST<Work_Order__c> getWorkOrder(){
LIST<Work_Order__c> wo = [SELECT ID,account__c,Product__c,Order_Type__c,Order_Status__c,Billing_Type__c,Closed_By__c FROM Work_Order__c];
return wo;
}
/*webservice static String getWorkOrder(){
return 'HELLO';*/
}
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
Any suggestions will be highly appreciated.
my requirement is to send all records (Work Order - custom object) to some third part app by exposing a custom WSDL file.
I developer the below code, which compiles fine in salesforce but gives an error while testing the same in SOAP UI tool.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
global class TestWOStatus{
webservice static LIST<Work_Order__c> getWorkOrder(){
LIST<Work_Order__c> wo = [SELECT ID,account__c,Product__c,Order_Type__c,Order_Status__c,Billing_Type__c,Closed_By__c FROM Work_Order__c];
return wo;
}
/*webservice static String getWorkOrder(){
return 'HELLO';*/
}
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
Any suggestions will be highly appreciated.
-
- AMIT KUMAR 73
- August 08, 2014
- Like
- 0
- Continue reading or reply
Test Class for ServiceMax custom Apex Code
Hi,
I have written a custom apex code for web service integration. Input parameter is the RecordID.
The functionality working fine but i am unable to achieve code coverage since i am unable to pass the Input parameter to my method "sfmOperation".
global class ServiceMaxOutbound{
webservice static SVMXC.INTF_WebServicesDef.INTF_Response sfmOperation(SVMXC.INTF_We bServicesDef.INTF_Response request)
{
String recordId,logDescription;
List<SVMXC__Service_Order__c> listWO;
for(SVMXC.INTF_WebServicesDef.SVMXMap objSVXMMap : request.valueMap) { if(objSVXMMap.key == 'WorkOrder_ID'){
recordId = objSVXMMap.value;
}
}
Any suggestions will be highly appreciated as can't find any doc on how to write test classes for servicemax apex class.
I have written a custom apex code for web service integration. Input parameter is the RecordID.
The functionality working fine but i am unable to achieve code coverage since i am unable to pass the Input parameter to my method "sfmOperation".
global class ServiceMaxOutbound{
webservice static SVMXC.INTF_WebServicesDef.INTF_Response sfmOperation(SVMXC.INTF_We bServicesDef.INTF_Response request)
{
String recordId,logDescription;
List<SVMXC__Service_Order__c> listWO;
for(SVMXC.INTF_WebServicesDef.SVMXMap objSVXMMap : request.valueMap) { if(objSVXMMap.key == 'WorkOrder_ID'){
recordId = objSVXMMap.value;
}
}
Any suggestions will be highly appreciated as can't find any doc on how to write test classes for servicemax apex class.
- AMIT KUMAR 73
- November 10, 2014
- Like
- 0
- Continue reading or reply
Web Service callout from a custom button
Hi,
I am trying to achieve one functionality:
1. Creating a custom button on "CASE" object say "Submit To Web Service"
2. Creating a checkbok field to select one or more case for a certain account.
3. Based on the selection (point#2) it should send out the case related information to some third part web service using Apex call out.
Is this possible to build this logic in salesforce?
I am trying to achieve one functionality:
1. Creating a custom button on "CASE" object say "Submit To Web Service"
2. Creating a checkbok field to select one or more case for a certain account.
3. Based on the selection (point#2) it should send out the case related information to some third part web service using Apex call out.
Is this possible to build this logic in salesforce?
- AMIT KUMAR 73
- September 15, 2014
- Like
- 0
- Continue reading or reply
Custom Web Service to return list of records in accounts object
Hi,
my requirement is to send all records (Work Order - custom object) to some third part app by exposing a custom WSDL file.
I developer the below code, which compiles fine in salesforce but gives an error while testing the same in SOAP UI tool.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
global class TestWOStatus{
webservice static LIST<Work_Order__c> getWorkOrder(){
LIST<Work_Order__c> wo = [SELECT ID,account__c,Product__c,Order_Type__c,Order_Status__c,Billing_Type__c,Closed_By__c FROM Work_Order__c];
return wo;
}
/*webservice static String getWorkOrder(){
return 'HELLO';*/
}
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
Any suggestions will be highly appreciated.
my requirement is to send all records (Work Order - custom object) to some third part app by exposing a custom WSDL file.
I developer the below code, which compiles fine in salesforce but gives an error while testing the same in SOAP UI tool.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
global class TestWOStatus{
webservice static LIST<Work_Order__c> getWorkOrder(){
LIST<Work_Order__c> wo = [SELECT ID,account__c,Product__c,Order_Type__c,Order_Status__c,Billing_Type__c,Closed_By__c FROM Work_Order__c];
return wo;
}
/*webservice static String getWorkOrder(){
return 'HELLO';*/
}
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
Any suggestions will be highly appreciated.
- AMIT KUMAR 73
- August 08, 2014
- Like
- 0
- Continue reading or reply