• vinayakamurthy
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies
i used date field in an controller, my requirement is when i click input field in date the pop up of date calender should not appear,instead of  that custom style sheets which i have used for date should appear..

what is webservices and callouts  in salesforce ???

how can i get an visualforce error messages in a variable and can store that???

How to write a test class for a trigger??

i want to know about __r type of relationship in that which is master and which is child,and how to query and insert data...

How could i write a test class for a controller with out  its constructor class??

 

example 1)public class convertToCLA {
List<Contact> contacts;
List<Lead> leads;
List<Account> accounts;

public void convertType(Integer phoneNumber) {
List<List<sObject>> results = [FIND '4155557000'
IN Phone FIELDS
RETURNING Contact(Id, Phone, FirstName, LastName),
Lead(Id, Phone, FirstName, LastName), Account(Id, Phone, Name)];
sObject[] records = ((List<sObject>)results[0]);

if (!records.isEmpty()) {
for (Integer i = 0; i < records.size(); i++) {
sObject record = records[i];
if (record.getSObjectType() == Contact.sObjectType) {
contacts.add((Contact) record);
} else if (record.getSObjectType() == Lead.sObjectType){
leads.add((Lead) record);
} else if (record.getSObjectType() == Account.sObjectType) {
accounts.add((Account) record);
}
}
}
}
}

 

 

2)public with sharing class CustomPaginationExt {
public List<Account> accounts{get;set;}
public Integer pageSize{get;set;}
public Integer noOfPages{get;set;}
public Integer pageNumber{get;set;}
private String baseQuery = 'select name, industry, annualRevenue from Account order by name';
private Integer totalNoOfRecs;

public CustomPaginationExt(ApexPages.StandardController controller) {
pageSize = 2;
totalNoOfRecs = [select count() from Account limit 50000];
getInitialAccountSet();
}

public PageReference getInitialAccountSet()
{
pageNumber = 0;
noOfPages = totalNoOfRecs/pageSize;

if (Math.mod(totalNoOfRecs, pageSize) > 0)
noOfPages++;

try{
accounts = Database.query(baseQuery + ' limit '+pageSize);
}
catch(Exception e){
ApexPages.addMessages(e);
}
return null;
}

public PageReference next(){
pageNumber++;

queryAccounts();
return null;
}
public PageReference previous(){
pageNumber--;
if (pageNumber < 0)
return null;

queryAccounts();
return null;
}

private void queryAccounts()
{
Integer offset = pageNumber * pageSize;
String query = baseQuery + ' limit '+pageSize +' offset '+ offset;
System.debug('Query is'+query);
try{
accounts = Database.query(query);
}
catch(Exception e){
ApexPages.addMessages(e);
}
}
}

Hi i want to know about testclass can some one help me in knowing it.i am new to test class.

How could i write a test class for a controller with out  its constructor class??

 

example 1)public class convertToCLA {
List<Contact> contacts;
List<Lead> leads;
List<Account> accounts;

public void convertType(Integer phoneNumber) {
List<List<sObject>> results = [FIND '4155557000'
IN Phone FIELDS
RETURNING Contact(Id, Phone, FirstName, LastName),
Lead(Id, Phone, FirstName, LastName), Account(Id, Phone, Name)];
sObject[] records = ((List<sObject>)results[0]);

if (!records.isEmpty()) {
for (Integer i = 0; i < records.size(); i++) {
sObject record = records[i];
if (record.getSObjectType() == Contact.sObjectType) {
contacts.add((Contact) record);
} else if (record.getSObjectType() == Lead.sObjectType){
leads.add((Lead) record);
} else if (record.getSObjectType() == Account.sObjectType) {
accounts.add((Account) record);
}
}
}
}
}

 

 

2)public with sharing class CustomPaginationExt {
public List<Account> accounts{get;set;}
public Integer pageSize{get;set;}
public Integer noOfPages{get;set;}
public Integer pageNumber{get;set;}
private String baseQuery = 'select name, industry, annualRevenue from Account order by name';
private Integer totalNoOfRecs;

public CustomPaginationExt(ApexPages.StandardController controller) {
pageSize = 2;
totalNoOfRecs = [select count() from Account limit 50000];
getInitialAccountSet();
}

public PageReference getInitialAccountSet()
{
pageNumber = 0;
noOfPages = totalNoOfRecs/pageSize;

if (Math.mod(totalNoOfRecs, pageSize) > 0)
noOfPages++;

try{
accounts = Database.query(baseQuery + ' limit '+pageSize);
}
catch(Exception e){
ApexPages.addMessages(e);
}
return null;
}

public PageReference next(){
pageNumber++;

queryAccounts();
return null;
}
public PageReference previous(){
pageNumber--;
if (pageNumber < 0)
return null;

queryAccounts();
return null;
}

private void queryAccounts()
{
Integer offset = pageNumber * pageSize;
String query = baseQuery + ' limit '+pageSize +' offset '+ offset;
System.debug('Query is'+query);
try{
accounts = Database.query(query);
}
catch(Exception e){
ApexPages.addMessages(e);
}
}
}

I am new to salesforce 501 and i want to know that can some one teach me the 501 i am ready to pay a suitable amount for this

If you have less than 12 months experience with apex or visualforce we want you!

A position has opened up for a junior to join our development team providing innovative solutions to our business users (we are not an IT or consultancy company).  You will be working alongside some expert developers who will help you learn and enhance your skills.

The position is based in Amsterdam in an English speaking startup company.  Don't live in the area, then relocate!  Amsterdam is one of the most livable cities in the world...

Want to know more?