• V V Satyanarayana Maddipati
  • NEWBIE
  • 400 Points
  • Member since 2015
  • Tech Lead
  • ET Marlabs


  • Chatter
    Feed
  • 13
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 53
    Replies
Hi there,

I am testing a trigger with its test class:
trigger ownerManager on Opportunity (before insert, before update) {
	/*
	Write a trigger that populates an “Owner’s Manager” lookup field on opportunities 
	based on the opp owner’s (user’s) standard ManagerId field. 
	*/
	
	Set<Id> allUsersID = new Set<Id>();
	for (Opportunity so : Trigger.new) {
		//for each opportunity, get the owner's manager
		allUsersID.add(so.OwnerId);
	}

	List<User> users = new List<User>();
	users = [SELECT Id, ManagerId
			   FROM User
			  WHERE Id IN :allUsersID];

	Map<Id,Id> userToManager = new Map<Id,Id>();
	for (User us : users) {
		userToManager.put(us.Id,us.ManagerId);
	}

	for (Opportunity so : Trigger.new) {
		//for each opportunity, set the Owner's Manager Id to be the Owner's Manager from the Map
		so.Owner_s_Manager__c = userToManager.get(so.OwnerId);
	}
}
Test Class:
@isTest
private class ownerManagerTest {
	
	@isTest static void test_method_one() {
		// create a user, and populate his manager
		Profile myProfileId = [SELECT id
							     FROM profile
							    WHERE name = 'Standard User'
							    LIMIT 1];
			
		User u = new User(Alias = 'standt', Email='walidtestusers@walidtestorg.com', 
            EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
            LocaleSidKey='en_US', ProfileId = myProfileId.Id, ManagerId='0050Y000000Fm7z',
            TimeZoneSidKey='America/Los_Angeles', UserName='walidtestusers@walidtestorg.com');

		insert u;
		System.debug('1 No Opp yet, but User Manager ID: ' +u.ManagerId);

		Opportunity opp = new Opportunity (Name='Test Opp', CloseDate=date.TODAY(), 
			StageName='Prospecting', ownerID=u.Id);

		Insert opp;
		System.debug('2: OPP ownerID = ' +opp.ownerID +' should be = ' +u.Id 
						+' OPP ManagerId = ' + opp.Owner_s_Manager__c);

		System.assertEquals(u.ManagerId,opp.Owner_s_Manager__c, 'Not the same!');
	}
}

Manual testing succeeds, i.e, I when I create an opportunity from the UI, the field gets populated qithout any issue. But when performing the Unit Test, the assertion fails with the message

"System.AssertException: Assertion Failed: Not the same!: Expected: 0050Y000000Fm7zQAC, Actual: null
Stack Trace 
Class.ownerManagerTest.test_method_one: line 26, column 1"

What could be the issue?

Thanks.
Walid
  • January 29, 2017
  • Like
  • 0
I am trying to give a custom name to a campaign name, pulling from different values. One of those is a Team Leader, which is a lookup(contact) field.

When I use
"& Team_Leader__c"
it returns the contact ID.

When I use
"& Team_Leader__c.Name"
it produces an error saying "Error: Field Team_Leader__c does not exist. Check spelling."

Any thoughts on how I can get it to pull through the name of the Team Leader as displaying in the lookup field rather than the ID?
Hi, 

We have Email-To-Case implemented, and the Case Descriptioin field is receiving the Incoming Email message body. 
The Case Descriptioin Standard Field appears in our Case Feed Custom Console Component (and also in the standard layout) as a 'Long Text Area' which is a Text version of the incoming Email message, sent as HTML. 

How can I wokraround this, and present the HTML in Case Description? 
I thought of creating a custom Rich Text field (i.e - 'Description - HTML'), and use a Formula to 'copy' the data from the 'Case Description' field, but it appears the Formula throws the following error: 
"Error: You referenced an unsupported field type called "Long Text Area" using the following field: Description":
User-added image

Are there any other workarounds to present the HTML version of the Case Description? 

Thank you, 
Ido. 
(https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm)
"The maximum number of asynchronous Apex method executions (batch Apex, future methods, Queueable Apex, and scheduled Apex) per a 24-hour period: 250,000 or the number of user licenses in your organization multiplied by 200, whichever is greater"

When we're talking about batch Apex, for example, are we just talking about start(), execute(), finish() methods being applied to that limit or are all methods - even custom methods - also included in that figure as well?

Also is there a way to see how close we are getting to that limit every day?  I looked at the Limits class but didn't see any direct methods there.  We have a couple of huge batch classes that run once a week and I want to make sure we're not getting too close to that limit.
Hello. I'd like to make custom button on list view, custom object.
It will update field value on all records that I checked.

So, I make custom button, and it's type is List button with visualforce page.

My question is,
How do I get the record lists that I checkd to visualforce code?
What variable is this data stored in?

please give me some sample code..
visualforce page, and that controller setting are maybe really helpful for me.

Thanks in advance.
When I place a system.debug statement inside a method, it doesn't show up in the log.  If it is not inside a method, it works fine.  Am I doing something wrong?
Hello,

How is it possible to create a account and contact details in one go

Account accTmp = new account(Name='Something, (new contact(Name = something))
Custom labels are accessible in JS when script is embedded in page. Below works fine
<apex:page>
<script>
$(document).ready(function(){
alert('{!$Label.myLabel}');   ///Displays 'myLabel content' just fine
});
<script>
</apex:page>
I want to externalize the javascript to an external file:
<apex:page>
<script src="https://www.ccnus.org/various/jquery/jquery-1.11.1.min.js"></script>
<script src="https://www.ccnus.org/........./myexternal.js" ></script>
</apex:page>
Myexternal.js :
$(document).ready(function(){
alert('{!$Label.myLabel}');   ///renders {!$Label.myLabel} rather than myLabel content
});
I have tried everything I could think of. No aval. How do you get it to work?
Thanks in advance for your help,
Jerome
How can I best write a trigger that detects if a record of object (MR_Opportunity) is deleted and create a new record of object (MR_Opportunity_Deletes) with the deleted MR_Opportunity's salesforceID and 'Type' field ? I plan to use the records deleted to delet corresponding Oracle records via Informatica Cloud.
Hi,
We have a scheduler class, which creates task on every Dec1. It checks for Date.Today().Day()==1 && Date.Today().Month()== 12.. Somebody please help me to how cover this.. 
Hi all,
I'm facing problems on accessing values of an object I passed to Database.executeBatch() method in a test class.
The following code sample is my Batchable Apex Class for sending eMails:
public without sharing class EmailHandler implements Schedulable, Database.batchable<Attachment>, Database.AllowsCallouts, Database.Stateful {
	
	/* Contains the total number of sent eMails for the last executed run */
	private Integer SentMailsLastRun;
	
	/* Constructs the eMail-Handler, initializing the count of eMails that have been sent during this run */
	public EmailHandler() {
		//Initialize count of sent mails for this run
		SentMailsLastRun = 0;
	}
	
	/*
	 * Starts the batch processing of attachments, collecting all attachments to process.
	 */
    public Iterable<Attachment> start(Database.BatchableContext BC){
       System.debug(LoggingLevel.INFO,'EmailHandler.start: Reading attachments to process in batch...');
       List<Attachment> attachmentList = processAttachments();
       if(attachmentList!=null) {
       	System.debug(LoggingLevel.INFO,'EmailHandler.start: Collected ' + attachmentList.size() + ' Attachments to process in batch-execution.');
       } else {
       	System.debug(LoggingLevel.INFO,'EmailHandler.start: No Attachments to process in batch-execution.');
       }
       if(attachmentList == null){
       		attachmentList = new List<Attachment>();	 
       }
       return attachmentList;
    }
    
    /*
     * Executes the eMail sending for a given batch of attachments. 
     */
    public void execute(Database.BatchableContext BC, List<Attachment> attachmentList){
       if(attachmentlist != null && attachmentList.size() > 0){
       		System.debug(LoggingLevel.INFO,'EmailHandler.execute: Batch execution started. Batch Size: ' + attachmentList.size());
       		emailServiceWorkOrder(attachmentList);
       		System.debug(LoggingLevel.INFO,'EmailHandler.execute: Batch processing of ' + attachmentList.size() + ' Attachments finished.');
       }else{
       	  System.debug(LoggingLevel.INFO,'EmailHandler.execute: No Attachments to process in this batch.');
       } 
    }

    /*
     * Is called after batch processing is finished.
     */
    public void finish(Database.BatchableContext BC){
    	 System.debug(LoggingLevel.INFO,'EmailHandler.finish: Batch execution finished.');
    }
    
    /*
     * Is called from system when its time to execute the planned job.
     */
    public void execute(SchedulableContext SC) {
    	System.debug(LoggingLevel.INFO,'EmailHandler.execute(SchedulableContext SC): Scheduled Job execution started.');
        EmailHandler emailhandler = new EmailHandler();
        Database.executebatch(emailhandler, 100);
        System.debug(LoggingLevel.INFO,'EmailHandler.execute(SchedulableContext SC): Batch execution triggered.');
    }

    /* Returns the number of mails sent the last run, if execution is still running returns -1 */
    public Integer getSentMails() {
        return SentMailsLastRun;
    }

    /*
     * Collects the attachments for Work Orders in status 'Closed' that have been modified after the last run time of the job.
     */
	private List<Attachment> processAttachments(){
		
[...] collecting of attachments [...]
		
		return attachmentList;
	}

	/*
	 * Processes the attachments passed over: Sends the attachments configured in 'BBMAG_Email_Notification_Settings__c' as 'Service Report Name'
	 * to the addresses configured in the Work Order.
	 */
	private void emailServiceWorkOrder(List<Attachment> newList){

			[...] preparing of eMail-Messages [...]

		//Send Emails
		if (messagesList.size() > 0){
			System.debug(LoggingLevel.INFO,'EmailHandler.emailServiceWorkOrder: Total Emails to be sent: ' + messagesList.size());
			Messaging.sendEmail(messagesList);
			System.debug(LoggingLevel.INFO,'EmailHandler.emailServiceWorkOrder: ' + messagesList.size() + ' Email sent.');
			SentMailsLastRun += messagesList.size();
			System.debug(LoggingLevel.INFO,'EmailHandler.emailServiceWorkOrder: In this run ' + getSentMails() + ' Emails have been sent in total.');
		}
	}
This is how I call Database.executeBatch() from Test-Class:
EmailHandler emailhandler = new EmailHandler();
        Test.StartTest();
        Database.executebatch(emailhandler);
        Test.StopTest();
        
        System.assertEquals(2,emailhandler.getSentMails(),'The expected count of eMails that should\'ve been sent did not match');

The log-output shows, that the variable "SentMailsLastRun" of the EmailHandler-Object has been set correctly and is read correctly from within the class by method getSentMails():
16:47:34:307 USER_DEBUG [521]|INFO|EmailHandler.emailServiceWorkOrder: In this run 2 Emails have been sent in total.
16:47:34:340 EXCEPTION_THROWN [35]|System.AssertException: Assertion Failed: The expected count of eMails that should've been sent did not match: Expected: 2, Actual: 0
Nevertheless, if the method is called from the test-class it delivers the value that has been set by the constructor (0). Does Database.executeBatch() clone the passed object and continues working with the clone?!
How may I access data collected during this process afterwards (Like in my case totally sent eMails) to verify the correctness?

Thanks in advance!
User-added imageThis is my custom object method,I use it to update my list; 
I also write a js code under the button.  But when I done the js code, the page can jump,but my custom metod is not execute.
I want ask how should I can execute the custom object method,and also execute the js method.
User-added imageUser-added image  Thin
Hi All,

When i execute the below SOQL query with around 100 fields from  the VF page,  it is counting the CPU Time. Where the SOQL is returning around  11K lineitems. 
System.debug('Start CPU Time===>'+Limits.getCpuTime());
Map<Id, OpportunityLineitem> oppMap = new Map<Id, OpportunityLineitem>([select Id, OpportunityId, ListPrice, CreatedDate, CurrencyIsoCode from OpportunityLineItem where OpportunityId = '006XXXXXXXXXXXX' ]);
System.debug('End CPU Time===>'+Limits.getCpuTime());
Due to security constraint i have removed remaining fields from the above code snippet.

Below is the screenshot of CPU Time consumed for the above SOQL code :
User-added image

User-added image

I am aware that the maximum synchronous CPU Time limit is 10000 milliseconds, due to this limit i am facing the Apex CPU Time limit exceeded error.
Can some one help me why it is consuming the CPU time for SOQL execution? 

As per the salesforce article (https://help.salesforce.com/articleView?id=000232681&language=en_US&type=1), it is mentioned that CPU Time is not counted for SOQL Queries.

P.S. As per business requirement, i don't want to do any changes to SOQL query (like reducing the no. of fields and adding additional filter conditions) and want to execute it from VF page(Syncronous).
  
Hi All,

When i execute the below SOQL query with around 100 fields from  the VF page,  it is counting the CPU Time. Where the SOQL is returning around  11K lineitems. 
System.debug('Start CPU Time===>'+Limits.getCpuTime());
Map<Id, OpportunityLineitem> oppMap = new Map<Id, OpportunityLineitem>([select Id, OpportunityId, ListPrice, CreatedDate, CurrencyIsoCode from OpportunityLineItem where OpportunityId = '006XXXXXXXXXXXX' ]);
System.debug('End CPU Time===>'+Limits.getCpuTime());
Due to security constraint i have removed remaining fields from the above code snippet.

Below is the screenshot of CPU Time consumed for the above SOQL code :
User-added image

User-added image

I am aware that the maximum synchronous CPU Time limit is 10000 milliseconds, due to this limit i am facing the Apex CPU Time limit exceeded error.
Can some one help me why it is consuming the CPU time for SOQL execution? 

As per the salesforce article (https://help.salesforce.com/articleView?id=000232681&language=en_US&type=1), it is mentioned that CPU Time is not counted for SOQL Queries.

P.S. As per business requirement, i don't want to do any changes to SOQL query (like reducing the no. of fields and adding additional filter conditions) and want to execute it from VF page(Syncronous).
  
Hi there,

I am testing a trigger with its test class:
trigger ownerManager on Opportunity (before insert, before update) {
	/*
	Write a trigger that populates an “Owner’s Manager” lookup field on opportunities 
	based on the opp owner’s (user’s) standard ManagerId field. 
	*/
	
	Set<Id> allUsersID = new Set<Id>();
	for (Opportunity so : Trigger.new) {
		//for each opportunity, get the owner's manager
		allUsersID.add(so.OwnerId);
	}

	List<User> users = new List<User>();
	users = [SELECT Id, ManagerId
			   FROM User
			  WHERE Id IN :allUsersID];

	Map<Id,Id> userToManager = new Map<Id,Id>();
	for (User us : users) {
		userToManager.put(us.Id,us.ManagerId);
	}

	for (Opportunity so : Trigger.new) {
		//for each opportunity, set the Owner's Manager Id to be the Owner's Manager from the Map
		so.Owner_s_Manager__c = userToManager.get(so.OwnerId);
	}
}
Test Class:
@isTest
private class ownerManagerTest {
	
	@isTest static void test_method_one() {
		// create a user, and populate his manager
		Profile myProfileId = [SELECT id
							     FROM profile
							    WHERE name = 'Standard User'
							    LIMIT 1];
			
		User u = new User(Alias = 'standt', Email='walidtestusers@walidtestorg.com', 
            EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
            LocaleSidKey='en_US', ProfileId = myProfileId.Id, ManagerId='0050Y000000Fm7z',
            TimeZoneSidKey='America/Los_Angeles', UserName='walidtestusers@walidtestorg.com');

		insert u;
		System.debug('1 No Opp yet, but User Manager ID: ' +u.ManagerId);

		Opportunity opp = new Opportunity (Name='Test Opp', CloseDate=date.TODAY(), 
			StageName='Prospecting', ownerID=u.Id);

		Insert opp;
		System.debug('2: OPP ownerID = ' +opp.ownerID +' should be = ' +u.Id 
						+' OPP ManagerId = ' + opp.Owner_s_Manager__c);

		System.assertEquals(u.ManagerId,opp.Owner_s_Manager__c, 'Not the same!');
	}
}

Manual testing succeeds, i.e, I when I create an opportunity from the UI, the field gets populated qithout any issue. But when performing the Unit Test, the assertion fails with the message

"System.AssertException: Assertion Failed: Not the same!: Expected: 0050Y000000Fm7zQAC, Actual: null
Stack Trace 
Class.ownerManagerTest.test_method_one: line 26, column 1"

What could be the issue?

Thanks.
Walid
  • January 29, 2017
  • Like
  • 0
I am trying to use Apex inputText control to input date from user using a jquery Date Picker.

The page code and used javascript function is given below, the code seems to me working absolutely fine when I am using HTML input control but not working with Apex inputText control.
<apex:page showHeader="false" id="mypage" docType="html-5.0" controller="ControllerCalculateIncentive" sidebar="false" standardStylesheets="false">
  <html>
    <head>
     <apex:stylesheet value="{!URLFOR($Resource.styles, 'bootstrap.css')}" />
     <apex:stylesheet value="{!URLFOR($Resource.styles, 'scrum.css')}" />
     <apex:stylesheet value="{!URLFOR($Resource.styles, 'jquery-ui.css')}" />
     <apex:stylesheet value="{!URLFOR($Resource.styles, 'font-awesome.css')}" />
     <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery-1.11.1.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.styles, 'bootstrap.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery.min.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery-ui.js')}"/>    
     <script type="text/javascript">
        var j$ = jQuery.noConflict();
        j$(document).ready(function(){           
           var v= '{!$Component.mypage:frm:StartDate}';
            j$(v).datepicker({
                dateFormat: 'dd-mm-yyyy',
                changeMonth: true,
                changeYear: true});

            });
     </script>
    </head>
    <body>
     <apex:form id="frm">
     <apex:inputText id="StartDate" value="{!StartDate}"  ></apex:inputText> 
     <apex:form>
    </body>
  </html>
</apex:page>

 
METHOD_NOT_ALLOWED
errorCode: METHOD_NOT_ALLOWED
message: HTTP Method 'POST' not allowed. Allowed are HEAD,GET


i m getting this error while using apex REST services
i m getting this in workbench
Hi All,
I am trying to implement a Formula for auto lead assignment that does the following in a more efficient way:
IF(Round_Robin_ID__c = 1 || Round_Robin_ID__c = 3 || Round_Robin_ID__c = 6 ....)
Basically I have an array of numbers that I want to compare the Round_Robin_ID against. Ideally it would look like:
IF(ISINARRAY(Round_Robin_ID__c,[1,3,4,6,7,9,.....])
Does anyone know a smart solution to this?
Thank you!
I am trying to give a custom name to a campaign name, pulling from different values. One of those is a Team Leader, which is a lookup(contact) field.

When I use
"& Team_Leader__c"
it returns the contact ID.

When I use
"& Team_Leader__c.Name"
it produces an error saying "Error: Field Team_Leader__c does not exist. Check spelling."

Any thoughts on how I can get it to pull through the name of the Team Leader as displaying in the lookup field rather than the ID?
Hi,

I am trying to use JQuery date picker in visualforce page. The JQuery date picker is not overwriting the standard salesforce style for apex:input field. Code below:

<apex:page id="thePage" standardController="Interaction__c">
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" target="_blank" rel="nofollow"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css</a>" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" target="_blank" rel="nofollow">
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js</a>"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" target="_blank" rel="nofollow">
  <script src="<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js</a>"></script>  
  
   <script>
    jQuery(function(){
            var $j = jQuery.noConflict();
            $j("input[id$=datepicker]").datepicker({
               changeYear: true,
               changeMonth: true,
               dateFormat: "mm/dd/yy"
            });
          });
</script>
</head> 
  <apex:form >
  <apex:pageBlock >

  <apex:pageblockSection >
  <apex:inputfield value="{!Interaction__c.Call_Date__c}" id="datepicker"/>
  <apex:pageBlockSectionItem />
  </apex:pageblockSection>
  </apex:pageBlock>

  
  </apex:form>

</apex:page>

Let me know if some thing else needs to be done.
Hi,
How can we insert record into object from static resource during the loading visualforce page.
e.g. I have one Object and created one visulaforce page, i want to insert the record from any static resource while that Visualforce is loading.
Please help me 

 
Hi, 

We have Email-To-Case implemented, and the Case Descriptioin field is receiving the Incoming Email message body. 
The Case Descriptioin Standard Field appears in our Case Feed Custom Console Component (and also in the standard layout) as a 'Long Text Area' which is a Text version of the incoming Email message, sent as HTML. 

How can I wokraround this, and present the HTML in Case Description? 
I thought of creating a custom Rich Text field (i.e - 'Description - HTML'), and use a Formula to 'copy' the data from the 'Case Description' field, but it appears the Formula throws the following error: 
"Error: You referenced an unsupported field type called "Long Text Area" using the following field: Description":
User-added image

Are there any other workarounds to present the HTML version of the Case Description? 

Thank you, 
Ido. 
(https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm)
"The maximum number of asynchronous Apex method executions (batch Apex, future methods, Queueable Apex, and scheduled Apex) per a 24-hour period: 250,000 or the number of user licenses in your organization multiplied by 200, whichever is greater"

When we're talking about batch Apex, for example, are we just talking about start(), execute(), finish() methods being applied to that limit or are all methods - even custom methods - also included in that figure as well?

Also is there a way to see how close we are getting to that limit every day?  I looked at the Limits class but didn't see any direct methods there.  We have a couple of huge batch classes that run once a week and I want to make sure we're not getting too close to that limit.
Good afternoon,

I need to know how works the endDate field in contract. If i the startDate = "01/12/2016", the endDate will be "31/12/2016". If i the startDate = "30/11/2016", the endDate will be "29/12/2016".  Why "29/12/2016"?
Can some help to write a test class for AutocreatedRegHandler. 
Hello,

I have a datetime field in which I need to insert date and time - 5th December 2016 7:30 AM.
I tried below code but I guess the datetime format is invalid as I get an error: Line: 5, Column: 23
unexpected token: '2016-12-05'
Anyone knows a valid date format, does it depend on my current location? 
Appreciate your help.

Milan

try {

   Opening_Hours__c openHours = [select Name, Day_Of_Week__c from Opening_Hours__c where Name = '1' AND Day_Of_Week__c ='Monday'];

   openHours.Open__c = 2016-12-05 07:30 AM;

   update openHours;

    } 

catch(Exception e) {
    System.debug('An unexpected error has occurred: ' + e.getMessage());
}
Hi

how to move Curser from one fileds other fields on Visualforce Page 

Thanks,
Manoj
Hi All,
I have written a Trigger to update from Task to Contact,

This is my trigger
 
trigger updateTask on Task (after update) {
List<Id> tsIds = new List<Id>();

for(Task ts : trigger.new){
        tsIds.add(ts.WhoId);
     }
     
     
     Map<ID, Task> mapAccounts = new Map<ID, Task>([SELECT Id, F1__c from Task where Id IN :tsIds]);
     
     
     if(Trigger.isUpdate){

List<Contact>  lstCon = [SELECT Id, name, CF1__c,AccountId FROM Contact where AccountId IN :tsIds];

For(Contact con : lstCon)
  {
     Task ts = mapAccounts.get(con.AccountId);
          con.CF1__c= ts.F1__c;
          
     
  }
update lstCon;
}
}

When I am updating Task record I am getting System.NullPointerException: Attempt to de-reference a null object:​ error.
Please 
tell me what changes need to be don.

Thanks in Advance
Hello. I'd like to make custom button on list view, custom object.
It will update field value on all records that I checked.

So, I make custom button, and it's type is List button with visualforce page.

My question is,
How do I get the record lists that I checkd to visualforce code?
What variable is this data stored in?

please give me some sample code..
visualforce page, and that controller setting are maybe really helpful for me.

Thanks in advance.
I am doing 2 webservice callouts from VF page contorller method which i am calling from action attribute of <apex:page> tag(onloading of page) and now i am trying to convert those two callouts into asynchronous callouts using continuation API class as stated in below link. Those two callouts need to happen in one single transaction.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_overview.htm

But i am getting below errors.

Error-1: line -1, column -1: Continuation is not serializable.

Error-2: 
An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 1529128587-55318 (-735899706)

So please help me?
Hi All,
I am new to Salesfroce.
I have written a batch apex to delete data from custom object.
Now, my requirement is to get that data from custom settings.

How to create that custom setting and what changes I have to do my below batch apex
global class batchDelete implements Database.Batchable<sobject>
{  
    
   
   global Database.QueryLocator start(Database.BatchableContext BC){
      
     return Database.getQueryLocator([SELECT Id,CreatedDate FROM Obj1__c WHERE createdDate = yesterday]);     
   }
   
global void execute(Database.BatchableContext BC,List<Obj1__c> rec){     
  //some code        
   
  delete rec;           

}  
   
global void finish(Database.BatchableContext BC){     
  
}

}

Please help me
Thanks in Advance!!