• abhishek_pandey1989@yahoo.com
  • NEWBIE
  • 35 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 29
    Replies
Hi Need quck help if possible, 

Created below modal and tried to iterate a list and created dynamic ids on the modal components, but after pressing button on modal , the find function on lightning controller always says "undefined" value for dynamic ids are just created on modal , I can see other values in modal getting iterated perfectly. 

Modal Code------------------------------------------------------------------>

<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                                <aura:iteration items="{!v.fileToBeUploaded}" var="fileDetails">
                                    <lightning:input aura:id="{!'fileName------'+fileDetails.documentId}" value="{!fileDetails.name}" required="true" name="input1" label="Confirm the file name" ></lightning:input>
                                    <lightning:select aura:id="{!'fileAttach-----'+fileDetails.documentId}" name="a_opt" label="Podklady Typ">
                                        <aura:iteration items="{!v.podklady}" var="pdkL">
                                            <option value="{!pdkL.idVal}">{!pdkL.idVal}</option>
                                        </aura:iteration>
                                    </lightning:select>
                                </aura:iteration>
                            </div>
                            <footer class="slds-modal__footer">
                                <lightning:button variant="neutral"
                                                  label="Cancel"
                                                  title="Cancel"
                                                  onclick="{! c.closeModel }"/>
                                <lightning:button variant="brand"
                                                  label="OK"
                                                  title="OK"
                                                  onclick="{!c.submitDetails}"/>
                            </footer>


Lightning Js controller code -------------------------------------------------->
var uploadedFiles = component.get("v.fileToBeUploaded");
for(var i=0; i< uploadedFiles.length; i++){
console.log(component.find('fileName------'+uploadedFiles[i].documentId).get("v.value"));
}
Getting below one , kindly help asap. 


Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: VBQXYIDO

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: JLJKDJUN
Close errors
I have a requirement to create HTML CMS connector , I tried to create connection with provided WP site, but as that website is on HTTP it is not working.. So I tried doing it with any Social website such as Facebook , Twitter , still I am not able to get any success. I went through the whole video by Salesforce, but it was not helpful. No code has been shared ,how CMS data is interacting with custom component. My question is, is there any way to intercept HTML CMS connector data so that we can create it in any lightning custom component for display. So that we can make changes as we want. 

https://www.youtube.com/watch?v=f0FB6t4RuL8&t=924s
Hey All, 
Just came across one interesting thing of Napili template, "Article List" standard component mentioned below is not available in Napili template. At least I can't find it. Is anyone aware how to get such interface for Napili template as this one is a prettry standard thing and every customer looks for the same. Any help will be appreciated. 
https://developer.salesforce.com/docs/atlas.en-us.community_templates.meta/community_templates/rss_article_list.htm
Here it says, it is not available:
https://developer.salesforce.com/docs/atlas.en-us.community_templates.meta/community_templates/rss_component_reference_table.htm

Hi ,the below actually converts the time from different time zones to pst time zone and save datetime repectively so the pst users always see date time field in their time zone only

 

Date objDate = System.Today().toStartOfWeek().addDays(6);        
        DateTime customerDateTimeString = Datetime.newInstanceGMT(objDate.year(), objDate.month(), objDate.day(), 2, 0, 0);
        DateTime customerDateTime = customerDateTimeString ;
        string customerTimeZoneSidId = 'America/Los_Angeles';
        TimeZone customerTimeZone = TimeZone.getTimeZone(customerTimeZoneSidId);
        ///calculates difference between time zones
        integer offsetToCustomersTimeZone = customerTimeZone.getOffset(customerDateTime);
        TimeZone tz = UserInfo.getTimeZone();
        integer offsetToUserTimeZone = tz.getOffset(customerDateTime);
        integer correction = offsetToUserTimeZone - offsetToCustomersTimeZone;
        DateTime correctedDateTime = customerDateTime.addMinutes(correction / (1000 * 60));              
        if(string.valueof(customerTimeZone)!=string.valueof(tz)){              
            saturdayDateTime  = correctedDateTime;   
            system.debug('--saturdayDateTime1--'+saturdayDateTime);      
        }else{            
            saturdayDateTime  = Datetime.newInstance(objDate.year(), objDate.month(), objDate.day(), 2, 0, 0);
            system.debug('--saturdayDateTime2--'+saturdayDateTime);                 
        }

 

 

 

but problem is it works fine in my developer account but not in some other sandbox account ..

i have the same TimeZone and Locale i have crosschecked ....(ANy help on this , what else can i check )

Problem it it storing the same date a day ahead for all other uers and therefore showing one day ahead for pst users also..

 

Regards

Abhishek

 

            <span> <td align="center" width="100%" style="font-size: 23px;"><apex:OutputField value="{!Property_Analysis__c.Lead__r.Lastname}"/>&nbsp;<apex:OutputField value="{!Property_Analysis__c.Lead__r.Company}"/>, &nbsp;<apex:OutputField value="{!Property_Analysis__c.Lead__r.Property_City__c}"/>,&nbsp; <apex:OutputField value="{!Property_Analysis__c.Lead__r.Property_State_Province__c}"/>,&nbsp; <apex:OutputField value="{!Property_Analysis__c.Lead__r.Property_Zip_Postal_Code__c}"/></td> </span>
        </div>

 

 

I want to auto adjust the fontsize of the above any javascript and jquery and how to use jquery in vf ??Or any other solution

Page is being rendered as pdf

 

 

Thanks

 <apex:selectcheckboxes value="{!certificates}" layout="pageDirection"  onchange="Acfunc();" >
                    <apex:selectOptions value="{!options }"/>    
                </apex:selectcheckboxes><br />

 

Is there any way to send some of the selected checkboxes checked  from inside the controller so that they seem  checked by default ...??

 

Thanks

L = Database.query('SELECT Id,Name (Select QualificationStatus__c From Qualifications__r where QualificationStatus__c =\'Success\' AND QualificationType__c=:countries) FROM Contact WHERE Firstname= :text');

 

 

Getting error

System.QueryException: unexpected token: 'Select'

 

 

 

 

 

I am trying to read the Xml Format in salesforce  by doing this

 

bodyxml ='<?xml version="1.0"?><Data><Result>True</Result><Password>hello</Password></Data>';

 

But what i am unable to do is how to get it iterated , in XMLStreamReader Class , I have been through the example below but it iterates on the class and i m not able to understand how is it doing with the Class "Book" as shown below ...

 

What need is to learn how Iterate through the string as defined above ..... In an XMLStreamReader Class so i can see step by step working in debug . The Code given as help by salesforce is given below . Pls have look ......

 

I hope i have desbribed it right ....

 

public class XmlStreamReaderDemo {

   // Create a class Book for processing
   public class Book 
   {
     String name;
     String author;
   }

   public Book[] parseBooks(XmlStreamReader reader) 
   {
     Book[] books = new Book[0];
     while(reader.hasNext()) {
         //  Start at the beginning of the book and make sure that it is a book
         if (reader.getEventType() == XmlTag.START_ELEMENT) {
            if ('Book' == reader.getLocalName()) {
            //  Pass the book to the parseBook method (below) 
                Book book = parseBook(reader);
                books.add(book);
            }
         }
        reader.next();
     }
    return books;
   }

   // Parse through the XML, determine the author and the characters
   Book parseBook(XmlStreamReader reader) 
   {
     Book book = new Book();
     book.author = reader.getAttributeValue(null, 'author');
     while(reader.hasNext()) {
        if (reader.getEventType() == XmlTag.END_ELEMENT) {
           break;
        } else if (reader.getEventType() == XmlTag.CHARACTERS) {
           book.name = reader.getText();
        }
        reader.next();
     }
     return book;
   }
}

 

 

There is one more problem with this code that it gets saved for the first time but after some changes of like writing a simple debug it starts giving an error ...

 

Error: Save error: Method does not exist or incorrect signature: [XMLStreamReader].getLocalName()

 

Document Dom is one method i want to understand  XMLstreamReader

 

Thank you

 

 

Is there any method through which i can get the lookup field object name through id only that comes in that lookup field??

 

Thanks

 

 

I drew a small webservice out of my dev  org and consumed it into another ...It doesnt have login method so i also  drew a second enterprise type wsdl  and consumed it also into the other dev org ..So the login problem got sorted as i can see my debug log, but my method gives me null poiter dereferencing error "System.NullPointerException: Attempt to de-reference a null object  "  

 

My method goes like this and its written in future method ...

enterpriseSoapSforceCom.LoginResult lr= new enterpriseSoapSforceCom.LoginResult();
      enterpriseSoapSforceCom.Soap Esoap= new enterpriseSoapSforceCom.Soap();      
    //  try
     // {       
       lr=Esoap.login(username,password);
       //lr.serverUrl;
       //lr.sessionId;
       system.debug('lr.userId'+lr.userId);
       system.debug('lr.sessionId'+lr.sessionId);       
       system.debug('lr.userId'+lr.userId);
       //MYWebservice34.SessionHeader_element sh = new MYWebservice34.SessionHeader_element();
       //sh.sessionId=lr.sessionId;
      // String authEndPoint = Esoap.Url;
    //  }
     // catch (SoapException e)
     // {
       // Console.WriteLine('An unexpected error has occurred: ' + e.Message + '\n' + e.StackTrace);
     // }
      soapSforceComSchemasClassMywebservi.Account myass= new soapSforceComSchemasClassMywebservi.Account();
      Account a=[Select BillingCity,Name,BillingCountry,BillingPostalCode,BillingStreet,Phone,Site from Account where id=:aa Limit 1];
      //soapSforceComSchemasClassMywebservi.BillingCity=a.BillingCity;
      myass.Name=a.Name;    
      //myass.BillingCountry=a.BillingCountry;
      //myass.BillingPostalCode=a.BillingPostalCode;
      //myass.BillingStreet=a.BillingStreet;
      //myass.Phone=a.Phone;
      //myass.Site=a.Site;
      soapSforceComSchemasClassMywebservi.MyWebService  Serv=new soapSforceComSchemasClassMywebservi.MyWebService ();
      Serv.SessionHeader.sessionId=lr.sessionId;
      Serv.makeContact('Rick',myass);  //error occurs here ....

 Help needed ....

 

What could be possible reason .....

 

Code of my webservice is this ....

global class MyWebService 
{
    webService static Id makeContact(String lastName, Account a) 
    
    {
        Contact c = new Contact(lastName = 'Weissman',firstname = a.Name);
        insert c;
        return c.id;
    }
    
}

 

It simply receives a string and an account which i am sending  from the other org as given above ..

 

Thanks

Can i schedule a class quarterly ????How??

I developed  simple soap api from one of my org and consumed it in another one ....

 

When i am calling it from another org ....it gives me the below error

First error: Web service callout failed: WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=

 

public class LogInfo {
public String category;
public String level;
private String[] category_type_info = new String[]{'category','http://soap.sforce.com/schemas/class/MyWebService','LogCategory','1','1','false'};
private String[] level_type_info = new String[]{'level','http://soap.sforce.com/schemas/class/MyWebService','LogCategoryLevel','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/MyWebService','true','false'};
private String[] field_order_type_info = new String[]{'category','level'};

 

public class LoginHistory {
public String ApiType;
public String ApiVersion;
public String Application;
public String Browser;
public String ClientVersion;
public DateTime LoginTime;
public String LoginType;
public String LoginUrl;
public String Platform;
public String SourceIp;
public String Status;
public String UserId;
private String[] ApiType_type_info = new String[]{'ApiType','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] ApiVersion_type_info = new String[]{'ApiVersion','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Application_type_info = new String[]{'Application','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Browser_type_info = new String[]{'Browser','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] ClientVersion_type_info = new String[]{'ClientVersion','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] LoginTime_type_info = new String[]{'LoginTime','http://www.w3.org/2001/XMLSchema','dateTime','0','1','true'};
private String[] LoginType_type_info = new String[]{'LoginType','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] LoginUrl_type_info = new String[]{'LoginUrl','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Platform_type_info = new String[]{'Platform','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] SourceIp_type_info = new String[]{'SourceIp','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Status_type_info = new String[]{'Status','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] UserId_type_info = new String[]{'UserId','http://soap.sforce.com/schemas/class/MyWebService','ID','0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/MyWebService','true','false'};
private String[] field_order_type_info = new String[]{'ApiType','ApiVersion','Application','Browser','ClientVersion','LoginTime','LoginType','LoginUrl','Platform','SourceIp','Status','UserId'};
}

 

 

public class LoginIp {
public DateTime ChallengeSentDate;
public DateTime CreatedDate;
public Boolean IsAuthenticated;
public String SourceIp;
public MYWebservice34.User_x Users;
public String UsersId;
private String[] ChallengeSentDate_type_info = new String[]{'ChallengeSentDate','http://www.w3.org/2001/XMLSchema','dateTime','0','1','true'};
private String[] CreatedDate_type_info = new String[]{'CreatedDate','http://www.w3.org/2001/XMLSchema','dateTime','0','1','true'};
private String[] IsAuthenticated_type_info = new String[]{'IsAuthenticated','http://www.w3.org/2001/XMLSchema','boolean','0','1','true'};
private String[] SourceIp_type_info = new String[]{'SourceIp','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Users_type_info = new String[]{'Users','http://soap.sforce.com/schemas/class/MyWebService','User','0','1','true'};
private String[] UsersId_type_info = new String[]{'UsersId','http://soap.sforce.com/schemas/class/MyWebService','ID','0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/MyWebService','true','false'};
private String[] field_order_type_info = new String[]{'ChallengeSentDate','CreatedDate','IsAuthenticated','SourceIp','Users','UsersId'};
}

 

 

how to rectify the error?????

THanks

I have I requirement of or you can say situation in which , I have reached a position in which i have to insert the records in the start method of batch Class ......Is it possible ???? If not why,. how to overcome .....If yes what should i keep in mind ..

 

Thanks 

Abhishek 

This is the code for test class of batch 

 

 system.Test.StartTest();
         
       LeadBatchAlertforIdleLead TA = new LeadBatchAlertforIdleLead();
       LeadBatchAlertforIdleLeadSchedule Sa =new LeadBatchAlertforIdleLeadSchedule();
       database.executebatch(TA);    
        
 system.Test.StopTest();

 

 

Following is the error i am having while deploying it ...Code Coverage is although 80%

 

 

 

Error:-

 

LeadBatchAlertforIdleLead_Test.myUnitTest System.UnexpectedException: No more than one executeBatch can be called from within a testmethod.  Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation.

 

It will be helpful if any body can provide me solution for setting the record limit  during test ,,, According to my search till now people are suggesting some query is returning more than 200 records.......

 

Error is focussed on my start method return query of Database.querylocator:

 

return Database.getquerylocator[  ma query];

 

My whole code is in start method of performing several tasks , no error with  that ....

Although some execution does goes in execute method

 

Thanks

 

 

I am writing a batch class in which the last step is to send emails to assigned user , that these many " no.s" of tasks are needed to attended by him. So I want  send email in which all tasks are mentioned . What challenge i am facing is how to get all those tasks iterated in the " SingleEmailMessage" class .

 

The code below for now sends different emails for every different task . What I want is to consolidate all tasks into one email to that user.

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
	        for(integer k=0;k<accns.size();k++)
	        {
		        
		       	mail.setToAddresses(new String[] {'abhishek.pandey@sfclouds.com'});
				mail.setReplyTo('abhishek.pandey@sfclouds.com');
				mail.setSenderDisplayName('Saleforce Tasks');
				mail.setSubject(accns[k].Subject);
				mail.setPlainTextBody('Below is the task created for you as respectively');
				String sfdcBaseURL = URL.getSalesforceBaseUrl().toExternalForm();
                //System.debug('Base URL: ' + sfdcBaseURL );
				mail.setHtmlBody('<br/><b>Status of task : ' + accns[k].Status +'<br/>Priority :'+accns[k].Priority +'<br/>Due Date :'+accns[k].ActivityDate+'</b><p>'+
			    '<b> To view your task : </b><a href='+sfdcBaseURL+'/'+accns[k].Id+'>click here.</a>');
				Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
	        }

 

 

I want below area to traversed with the list of all tasks assigned to user , when email is sent . That means no. of tasks is variable and changes for every other user.

 

mail.setHtmlBody('<br/><b>Status of task : ' + accns[k].Status +'<br/>Priority :'+accns[k].Priority +'<br/>Due Date :'+accns[k].ActivityDate+'</b><p>'+
			    '<b> To view your task : </b><a href='+sfdcBaseURL+'/'+accns[k].Id+'>click here.</a>');

Thanks......

 

 

I have a list of records and now i have a requirement that  the list of records should get sorted according the date field in the inner query .

list<contact> conmap=new list<contact>([SELECT Id, (SELECT Status,Subject,ActivityDate FROM Tasks order by ActivityDate ASC) FROM Contact where id=:conid]);

 

Now in list "conmap ": i want tasks records to get sorted according to the activitydate field , which means the activitydate field record of  min value  belonging to record should come at 0th index of   the new list....

 

 

I have a inner soql query  in  which i am trying to get results order by a  date field mentioned below in code

Please help 

 Thanks in advance

map<id,contact> conmap=new map<id,contact>([SELECT Id, (SELECT Status,Subject,ActivityDate FROM Tasks ORDER by ActivityDate ) FROM Contact where id=:conid]);

 

The error that i am getting is 

 

 

Error: Unknown property 'AccountStandardController.i'

 

 

For the code  posted below

 

 

 

function codeAddress()
{

for(i=0;i<"{quan}";i++)       (quan is integer with get set value of 2 )
{

var address3="{!conaddlst[i]}";       (Error occurs on this line , "conaddlst" is the string type list , it works fine with standard                object value like"{!account.billingcity}" and gives the desired result)  

 

geocoder.geocode( { 'address': address3}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK)
{
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,

 

 

 

 

 

Thanks for help in advance

Getting below one , kindly help asap. 


Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: VBQXYIDO
 <apex:selectcheckboxes value="{!certificates}" layout="pageDirection"  onchange="Acfunc();" >
                    <apex:selectOptions value="{!options }"/>    
                </apex:selectcheckboxes><br />

 

Is there any way to send some of the selected checkboxes checked  from inside the controller so that they seem  checked by default ...??

 

Thanks

I am trying to read the Xml Format in salesforce  by doing this

 

bodyxml ='<?xml version="1.0"?><Data><Result>True</Result><Password>hello</Password></Data>';

 

But what i am unable to do is how to get it iterated , in XMLStreamReader Class , I have been through the example below but it iterates on the class and i m not able to understand how is it doing with the Class "Book" as shown below ...

 

What need is to learn how Iterate through the string as defined above ..... In an XMLStreamReader Class so i can see step by step working in debug . The Code given as help by salesforce is given below . Pls have look ......

 

I hope i have desbribed it right ....

 

public class XmlStreamReaderDemo {

   // Create a class Book for processing
   public class Book 
   {
     String name;
     String author;
   }

   public Book[] parseBooks(XmlStreamReader reader) 
   {
     Book[] books = new Book[0];
     while(reader.hasNext()) {
         //  Start at the beginning of the book and make sure that it is a book
         if (reader.getEventType() == XmlTag.START_ELEMENT) {
            if ('Book' == reader.getLocalName()) {
            //  Pass the book to the parseBook method (below) 
                Book book = parseBook(reader);
                books.add(book);
            }
         }
        reader.next();
     }
    return books;
   }

   // Parse through the XML, determine the author and the characters
   Book parseBook(XmlStreamReader reader) 
   {
     Book book = new Book();
     book.author = reader.getAttributeValue(null, 'author');
     while(reader.hasNext()) {
        if (reader.getEventType() == XmlTag.END_ELEMENT) {
           break;
        } else if (reader.getEventType() == XmlTag.CHARACTERS) {
           book.name = reader.getText();
        }
        reader.next();
     }
     return book;
   }
}

 

 

There is one more problem with this code that it gets saved for the first time but after some changes of like writing a simple debug it starts giving an error ...

 

Error: Save error: Method does not exist or incorrect signature: [XMLStreamReader].getLocalName()

 

Document Dom is one method i want to understand  XMLstreamReader

 

Thank you

 

 

I drew a small webservice out of my dev  org and consumed it into another ...It doesnt have login method so i also  drew a second enterprise type wsdl  and consumed it also into the other dev org ..So the login problem got sorted as i can see my debug log, but my method gives me null poiter dereferencing error "System.NullPointerException: Attempt to de-reference a null object  "  

 

My method goes like this and its written in future method ...

enterpriseSoapSforceCom.LoginResult lr= new enterpriseSoapSforceCom.LoginResult();
      enterpriseSoapSforceCom.Soap Esoap= new enterpriseSoapSforceCom.Soap();      
    //  try
     // {       
       lr=Esoap.login(username,password);
       //lr.serverUrl;
       //lr.sessionId;
       system.debug('lr.userId'+lr.userId);
       system.debug('lr.sessionId'+lr.sessionId);       
       system.debug('lr.userId'+lr.userId);
       //MYWebservice34.SessionHeader_element sh = new MYWebservice34.SessionHeader_element();
       //sh.sessionId=lr.sessionId;
      // String authEndPoint = Esoap.Url;
    //  }
     // catch (SoapException e)
     // {
       // Console.WriteLine('An unexpected error has occurred: ' + e.Message + '\n' + e.StackTrace);
     // }
      soapSforceComSchemasClassMywebservi.Account myass= new soapSforceComSchemasClassMywebservi.Account();
      Account a=[Select BillingCity,Name,BillingCountry,BillingPostalCode,BillingStreet,Phone,Site from Account where id=:aa Limit 1];
      //soapSforceComSchemasClassMywebservi.BillingCity=a.BillingCity;
      myass.Name=a.Name;    
      //myass.BillingCountry=a.BillingCountry;
      //myass.BillingPostalCode=a.BillingPostalCode;
      //myass.BillingStreet=a.BillingStreet;
      //myass.Phone=a.Phone;
      //myass.Site=a.Site;
      soapSforceComSchemasClassMywebservi.MyWebService  Serv=new soapSforceComSchemasClassMywebservi.MyWebService ();
      Serv.SessionHeader.sessionId=lr.sessionId;
      Serv.makeContact('Rick',myass);  //error occurs here ....

 Help needed ....

 

What could be possible reason .....

 

Code of my webservice is this ....

global class MyWebService 
{
    webService static Id makeContact(String lastName, Account a) 
    
    {
        Contact c = new Contact(lastName = 'Weissman',firstname = a.Name);
        insert c;
        return c.id;
    }
    
}

 

It simply receives a string and an account which i am sending  from the other org as given above ..

 

Thanks

Can i schedule a class quarterly ????How??

I developed  simple soap api from one of my org and consumed it in another one ....

 

When i am calling it from another org ....it gives me the below error

First error: Web service callout failed: WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=

 

public class LogInfo {
public String category;
public String level;
private String[] category_type_info = new String[]{'category','http://soap.sforce.com/schemas/class/MyWebService','LogCategory','1','1','false'};
private String[] level_type_info = new String[]{'level','http://soap.sforce.com/schemas/class/MyWebService','LogCategoryLevel','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/MyWebService','true','false'};
private String[] field_order_type_info = new String[]{'category','level'};

 

public class LoginHistory {
public String ApiType;
public String ApiVersion;
public String Application;
public String Browser;
public String ClientVersion;
public DateTime LoginTime;
public String LoginType;
public String LoginUrl;
public String Platform;
public String SourceIp;
public String Status;
public String UserId;
private String[] ApiType_type_info = new String[]{'ApiType','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] ApiVersion_type_info = new String[]{'ApiVersion','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Application_type_info = new String[]{'Application','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Browser_type_info = new String[]{'Browser','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] ClientVersion_type_info = new String[]{'ClientVersion','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] LoginTime_type_info = new String[]{'LoginTime','http://www.w3.org/2001/XMLSchema','dateTime','0','1','true'};
private String[] LoginType_type_info = new String[]{'LoginType','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] LoginUrl_type_info = new String[]{'LoginUrl','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Platform_type_info = new String[]{'Platform','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] SourceIp_type_info = new String[]{'SourceIp','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Status_type_info = new String[]{'Status','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] UserId_type_info = new String[]{'UserId','http://soap.sforce.com/schemas/class/MyWebService','ID','0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/MyWebService','true','false'};
private String[] field_order_type_info = new String[]{'ApiType','ApiVersion','Application','Browser','ClientVersion','LoginTime','LoginType','LoginUrl','Platform','SourceIp','Status','UserId'};
}

 

 

public class LoginIp {
public DateTime ChallengeSentDate;
public DateTime CreatedDate;
public Boolean IsAuthenticated;
public String SourceIp;
public MYWebservice34.User_x Users;
public String UsersId;
private String[] ChallengeSentDate_type_info = new String[]{'ChallengeSentDate','http://www.w3.org/2001/XMLSchema','dateTime','0','1','true'};
private String[] CreatedDate_type_info = new String[]{'CreatedDate','http://www.w3.org/2001/XMLSchema','dateTime','0','1','true'};
private String[] IsAuthenticated_type_info = new String[]{'IsAuthenticated','http://www.w3.org/2001/XMLSchema','boolean','0','1','true'};
private String[] SourceIp_type_info = new String[]{'SourceIp','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
private String[] Users_type_info = new String[]{'Users','http://soap.sforce.com/schemas/class/MyWebService','User','0','1','true'};
private String[] UsersId_type_info = new String[]{'UsersId','http://soap.sforce.com/schemas/class/MyWebService','ID','0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/MyWebService','true','false'};
private String[] field_order_type_info = new String[]{'ChallengeSentDate','CreatedDate','IsAuthenticated','SourceIp','Users','UsersId'};
}

 

 

how to rectify the error?????

THanks

I have I requirement of or you can say situation in which , I have reached a position in which i have to insert the records in the start method of batch Class ......Is it possible ???? If not why,. how to overcome .....If yes what should i keep in mind ..

 

Thanks 

Abhishek 

This is the code for test class of batch 

 

 system.Test.StartTest();
         
       LeadBatchAlertforIdleLead TA = new LeadBatchAlertforIdleLead();
       LeadBatchAlertforIdleLeadSchedule Sa =new LeadBatchAlertforIdleLeadSchedule();
       database.executebatch(TA);    
        
 system.Test.StopTest();

 

 

Following is the error i am having while deploying it ...Code Coverage is although 80%

 

 

 

Error:-

 

LeadBatchAlertforIdleLead_Test.myUnitTest System.UnexpectedException: No more than one executeBatch can be called from within a testmethod.  Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation.

 

It will be helpful if any body can provide me solution for setting the record limit  during test ,,, According to my search till now people are suggesting some query is returning more than 200 records.......

 

Error is focussed on my start method return query of Database.querylocator:

 

return Database.getquerylocator[  ma query];

 

My whole code is in start method of performing several tasks , no error with  that ....

Although some execution does goes in execute method

 

Thanks

 

 

I am writing a batch class in which the last step is to send emails to assigned user , that these many " no.s" of tasks are needed to attended by him. So I want  send email in which all tasks are mentioned . What challenge i am facing is how to get all those tasks iterated in the " SingleEmailMessage" class .

 

The code below for now sends different emails for every different task . What I want is to consolidate all tasks into one email to that user.

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
	        for(integer k=0;k<accns.size();k++)
	        {
		        
		       	mail.setToAddresses(new String[] {'abhishek.pandey@sfclouds.com'});
				mail.setReplyTo('abhishek.pandey@sfclouds.com');
				mail.setSenderDisplayName('Saleforce Tasks');
				mail.setSubject(accns[k].Subject);
				mail.setPlainTextBody('Below is the task created for you as respectively');
				String sfdcBaseURL = URL.getSalesforceBaseUrl().toExternalForm();
                //System.debug('Base URL: ' + sfdcBaseURL );
				mail.setHtmlBody('<br/><b>Status of task : ' + accns[k].Status +'<br/>Priority :'+accns[k].Priority +'<br/>Due Date :'+accns[k].ActivityDate+'</b><p>'+
			    '<b> To view your task : </b><a href='+sfdcBaseURL+'/'+accns[k].Id+'>click here.</a>');
				Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
	        }

 

 

I want below area to traversed with the list of all tasks assigned to user , when email is sent . That means no. of tasks is variable and changes for every other user.

 

mail.setHtmlBody('<br/><b>Status of task : ' + accns[k].Status +'<br/>Priority :'+accns[k].Priority +'<br/>Due Date :'+accns[k].ActivityDate+'</b><p>'+
			    '<b> To view your task : </b><a href='+sfdcBaseURL+'/'+accns[k].Id+'>click here.</a>');

Thanks......

 

 

I have a list of records and now i have a requirement that  the list of records should get sorted according the date field in the inner query .

list<contact> conmap=new list<contact>([SELECT Id, (SELECT Status,Subject,ActivityDate FROM Tasks order by ActivityDate ASC) FROM Contact where id=:conid]);

 

Now in list "conmap ": i want tasks records to get sorted according to the activitydate field , which means the activitydate field record of  min value  belonging to record should come at 0th index of   the new list....

 

 

I have a inner soql query  in  which i am trying to get results order by a  date field mentioned below in code

Please help 

 Thanks in advance

map<id,contact> conmap=new map<id,contact>([SELECT Id, (SELECT Status,Subject,ActivityDate FROM Tasks ORDER by ActivityDate ) FROM Contact where id=:conid]);