• chiranthAradhya
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies

HI below is the custom controller I have written

 

public with sharing class NewTask{
public String eid;
Public String cid;
public NewTask() {

}


List<RecordType> accounts;

 

public List<RecordType> getAccounts() {

if(accounts == null) accounts = [select Name,Description from RecordType where Name = 'Create SPEX Order' OR Name = 'Inside Sales Tasks' OR Name = 'Quote Defect' OR Name = 'Sales Activity' OR Name = 'Services Activity'];

return accounts;

}


public NewTask(ApexPages.StandardController controller) {}
public String selval{get;set;}
public List<SelectOption> getvalues() {
List<SelectOption> options = new List<SelectOption>();
List<RecordType> RT = new List<RecordType>([select Name from RecordType where Name = 'General Task' OR Name = 'Create SPEX Order' OR Name = 'Inside Sales Tasks' OR Name = 'Quote Defect' OR Name = 'Sales Activity' OR Name = 'Services Activity']);
for(RecordType S : RT)
options.add(new SelectOption(S.name,S.name));
return options;


}
public PageReference docontin(){
eid=Apexpages.currentpage().getparameters().get('id');
Entitlement__c ent=[Select id,Contract_Number__c from Entitlement__c where id=:eid];
string ifd=ent.Contract_Number__c ;
Contract contra=[Select id from Contract where Id =:ifd ];
cid=contra.id;
if(selval == 'General Task'){
Id id1 = [select Id from RecordType where Name = 'General Task'].ID;
Pagereference p = new Pagereference('https://cs15.salesforce.com/00T/e?tsk3_lktp=00N30000004rZUV&retURL=%2Fa1Me0000000Cai9&RecordType=01230000000ZgXL&ent=Task');
p.setredirect(true);
return p;
}else if(selval == 'Create SPEX Order'){
Id id1 = [select Id from RecordType where Name = 'Create SPEX Order'].ID;
Pagereference p = new Pagereference('https://cs15.salesforce.com/00T/e?retURL=%2Fa1Me0000000Cai9&RecordType=012e000000009DC&ent=Task');
p.setredirect(true);
return p;
}else if(selval == 'Quote Defect'){
Id id1 = [select Id from RecordType where Name = 'Quote Defect'].ID;
Pagereference p = new Pagereference('https://cs15.salesforce.com/00T/e?what_id=800e000000057cB&retURL=%2Fa1Me0000000Cai9&RecordType=012e000000008AR&ent=Task');
p.setredirect(true);
return p;
}else if(selval == 'Sales Activity'){
Id id1 = [select Id from RecordType where Name = 'Sales Activity'].ID;
Pagereference p = new Pagereference('https://cs15.salesforce.com/00T/e?what_id=800e000000057cB&retURL=%2Fa1Me0000000Cai9&RecordType=01230000000ZgXL&ent=Task');
p.setredirect(true);
return p;
}else if(selval == 'Services Activity'){
Id id1 = [select Id from RecordType where Name = 'Services Activity'].ID;
Pagereference p = new Pagereference('https://cs15.salesforce.com/00T/e?what_id=800e000000057cB&retURL=%2Fa1Me0000000Cai9&RecordType=01230000000ZgXM&ent=Task');
p.setredirect(true);
return p;
} else
return null;

}
public PageReference docancel(){
PageReference pref=new PageReference('/'+eid);
pref.setRedirect(true);
return pref;

}
}

 

 

 

How to pepoplate the fields in the page layout when calling the pagelayout through the custom controller.

 

When sending a mail from salesforce, The salesforce user will not come to know whether the mail is sent to customer or not.

Need a solution : when a mail is sent to customer , If it is not delivered , it should revert it back to salesforce. How we can achive this.

 

Please help me on this

How to configure Pre chat page!! Once I click on the Request chat button  the page gets refreshes, How to map this request chat button.