• sruthi26
  • NEWBIE
  • 60 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 2
    Replies
.. Hi, I Am Trying To Retrieve The Saleforce List Views Of Contact Object Through API Here Is The Code I Used
SFDCPartner.ExecuteListViewRequest LvRequest = New SFDCPartner.ExecuteListViewRequest ();
                LvRequest.SobjectType = "Contact";
                LvRequest.DeveloperNameOrId = ListViewId;
                lvRequest.offset = offset;
                LvRequest.Limit = Limit;
                LvRequest.OrderBy = LvobList;

I Am Able To Get Few List Views.  But For Some List Views Which Are Filtered By Campaign Such As...

User-added image
throwing the follwing error

Unexpected error retrieving SFDC contact list view 00B3300000xxxxag. Error: INVALID_FIELD: 
CampaignId = '70133000000xoVN') AND (Status like '%Paged%' OR Status
                                     ^
ERROR at Row:1:Column:400
No such column 'Status' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. Exception Type: System.Web.Services.Protocols.SoapException


I think it is because I am using sobject 'Contact' and couldnt filter by Campaign or Campaign Member. How can we handle this?
Thanks in advance.
Hi,

I want to get all the values of a multi select picklist custom field, no matter what values are selected through apex code. Can anyone tell me how could I approach this? 
Hi,
I developed an application in developer edition and I created a Managed Package with a namespace prefix. All the custom fields, objects API names are prepended with that namespace prefix. Well, now my client application is unable to make API Web service calls as it throwing exceptions that it can't find the custom fields, objects which I have developed. I knew it is because the namespace prefix was prepended which was not there before.
 So now does my client has to change all the salesforce new API names in his application in order to make webservice calls? How can we handle this? 

Thanks in advance
Hi, Here is my Asynchronous class imported by a WSDL. Can anyone tell me how to write a test class for this class. Also I want to know how to deal with 'System.Continuation continuation' . Thanks in advance.


public class AsyncOntrackworkflowComWebservicesAuth {
   
    public class LoginResponse_elementFuture extends System.WebServiceCalloutFuture {
        public String getValue() {
            ontrackworkflowComWebservicesAuth.LoginResponse_element response = (ontrackworkflowComWebservicesAuth.LoginResponse_element)System.WebServiceCallout.endInvoke(this);
            if(!Test.isRunningTest()) {
            return response.LoginResult;
             }
            else {
            return 'Success';
            }
        }
    } 
    public class AsyncOTWSAuthenticationServiceSoap {
        public String endpoint_x = 'https://sites-test.ontrackworkflow.com/adpes/OTWSAuthenticationService.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public String clientCertName_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://ontrackworkflow.com/webservices', 'ontrackworkflowComWebservicesAuth'}; 
        public AsyncOntrackworkflowComWebservicesAuth.LoginResponse_elementFuture beginLogin(System.Continuation continuation,String logonName,String logonPassword) {
            ontrackworkflowComWebservicesAuth.Login_element request_x = new ontrackworkflowComWebservicesAuth.Login_element();
            request_x.logonName = logonName;
            request_x.logonPassword = logonPassword;
    return (AsyncOntrackworkflowComWebservicesAuth.LoginResponse_elementFuture) System.WebServiceCallout.beginInvoke(this,request_x,AsyncOntrackworkflowComWebservicesAuth.LoginResponse_elementFuture.class,continuation,new String[]{endpoint_x,'http://ontrackworkflow.com/webservices/Login','http://ontrackworkflow.com/webservices','Login','http://ontrackworkflow.com/webservices','LoginResponse','ontrackworkflowComWebservicesAuth.LoginResponse_element'});
        }
     
    }
}
Hi,
I have developed an application and ready to move to test the package in other org's sandbox. I was asked to create a documentation that has all the components that I have created in that application such as custom objects, fields, classes, permission sets etc. while moving for testing. Can somebody provide me a sample documentation which can help me in creating one? 
Thanks in advance.
I have developer edition org, I have developed an application and now I want to move the code(components) through the managed package to different org and test in their sandbox. The developer org only has an ability to create unlimited number of unmanaged packages. How can I create a managed package as I have a developer org and no sandbox? what could be a best approach?
My batch class:
global class DeactivateOnTrackUserBatch implements Database.Batchable<sObject>,Database.AllowsCallouts {
public String query = 'SELECT Id, Enable_Ontrack__c ,CreatedOntackUser__c , Username  FROM User where Enable_Ontrack__c = \'no\' AND CreatedOntackUser__c = True '; 
 global Database.QueryLocator start(Database.BatchableContext BC) {
    return Database.getQueryLocator(query);
 }
global void execute(Database.BatchableContext BC, List<User> UserRecords) {  
 ontrackworkflowComWebservicesUser.OTWSUserServiceSoap s1 = new ontrackworkflowComWebservicesUser.OTWSUserServiceSoap();
 String result;
 system.debug('user records' + UserRecords );
   for (user u : UserRecords ) {
 ontrackworkflowComWebservicesAuth.OTWSAuthenticationServiceSoap sp = new ontrackworkflowComWebservicesAuth.OTWSAuthenticationServiceSoap();
  if(!Test.isRunningTest()) {
         string resulttoken = sp.Login('sfdcOnTrackAPI','ontrack_sfdc');
         system.debug(resulttoken);
         JSONParser parser = JSON.createParser(resulttoken);
         system.debug(parser);
         string ticket;
         while (parser.nextToken() != null) 
         {
           if(parser.getCurrentName() == 'Ticket') 
           {
             ticket = parser.getText();                                 
             system.debug(parser.getText());
           }  
         }        
 //system.debug('user id' + u.Id);
  //u.Id = UserInfo.getUserId();
  result = s1.DeactivateUserSFDC(ticket, u.Id);
         System.Debug('result' + result);
         if (result.indexOf('Fail') == -1){
         u.CreatedOntackUser__c = False;
         Update u;
         System.Debug('result testing' + result); 
          }
        }
}
}
    global void finish(Database.BatchableContext BC){    
    }
}


My Test Class:

@isTest
private class DeactivateOnTrackUserBatch_Test {
    public static testMethod void DeactivateOnTrackUserBatch_Test() {
    User objUser = [select id from user where  id=:userinfo.getuserid()];
    System.runAs(objUser){   
    Test.startTest();    
    DeactivateOnTrackUserBatch d = new  DeactivateOnTrackUserBatch();    
    String deactID = System.scheduleBatch(d, 'job example10', 1); 
                Database.executeBatch(d, 200);
               // d.execute(null,null);  
    Test.stopTest();
    }  }
}
I have developer edition org, I have developed an application and now I want to move the code(components) through the managed package to different org and test in their sandbox. The developer org only has an ability to create unlimited number of unmanaged packages. How can I create a managed package as I have a developer org and no sandbox? what could be a best approach?
My batch class:
global class DeactivateOnTrackUserBatch implements Database.Batchable<sObject>,Database.AllowsCallouts {
public String query = 'SELECT Id, Enable_Ontrack__c ,CreatedOntackUser__c , Username  FROM User where Enable_Ontrack__c = \'no\' AND CreatedOntackUser__c = True '; 
 global Database.QueryLocator start(Database.BatchableContext BC) {
    return Database.getQueryLocator(query);
 }
global void execute(Database.BatchableContext BC, List<User> UserRecords) {  
 ontrackworkflowComWebservicesUser.OTWSUserServiceSoap s1 = new ontrackworkflowComWebservicesUser.OTWSUserServiceSoap();
 String result;
 system.debug('user records' + UserRecords );
   for (user u : UserRecords ) {
 ontrackworkflowComWebservicesAuth.OTWSAuthenticationServiceSoap sp = new ontrackworkflowComWebservicesAuth.OTWSAuthenticationServiceSoap();
  if(!Test.isRunningTest()) {
         string resulttoken = sp.Login('sfdcOnTrackAPI','ontrack_sfdc');
         system.debug(resulttoken);
         JSONParser parser = JSON.createParser(resulttoken);
         system.debug(parser);
         string ticket;
         while (parser.nextToken() != null) 
         {
           if(parser.getCurrentName() == 'Ticket') 
           {
             ticket = parser.getText();                                 
             system.debug(parser.getText());
           }  
         }        
 //system.debug('user id' + u.Id);
  //u.Id = UserInfo.getUserId();
  result = s1.DeactivateUserSFDC(ticket, u.Id);
         System.Debug('result' + result);
         if (result.indexOf('Fail') == -1){
         u.CreatedOntackUser__c = False;
         Update u;
         System.Debug('result testing' + result); 
          }
        }
}
}
    global void finish(Database.BatchableContext BC){    
    }
}


My Test Class:

@isTest
private class DeactivateOnTrackUserBatch_Test {
    public static testMethod void DeactivateOnTrackUserBatch_Test() {
    User objUser = [select id from user where  id=:userinfo.getuserid()];
    System.runAs(objUser){   
    Test.startTest();    
    DeactivateOnTrackUserBatch d = new  DeactivateOnTrackUserBatch();    
    String deactID = System.scheduleBatch(d, 'job example10', 1); 
                Database.executeBatch(d, 200);
               // d.execute(null,null);  
    Test.stopTest();
    }  }
}