-
ChatterFeed
-
2Best Answers
-
0Likes Received
-
0Likes Given
-
58Questions
-
17Replies
Throw an Error along with the error record
I want to show an error that already a record is made primary. 'Please uncehck primary on test11 record'
-
- SIVASASNKAR
- July 11, 2012
- Like
- 0
- Continue reading or reply
-
- ShravanKumarBagam
- October 16, 2012
- Like
- 0
- Continue reading or reply
What is the use of COUNT_DISTINCT function ?
Hi,
Unable to understand the use COUNT_DISTINCT function.Can anybody explain with an example
-
- ShravanKumarBagam
- October 11, 2012
- Like
- 0
- Continue reading or reply
s there an order of operations that workflow follow?
hi,
Is there an order of operations that workflow follow?
If it is there , how can i see the operations flow...
-
- ShravanKumarBagam
- October 06, 2012
- Like
- 0
- Continue reading or reply
-
- ShravanKumarBagam
- October 06, 2012
- Like
- 0
- Continue reading or reply
Query on Declare variable
Hi,
Integer i;
Public Integer i;
What is the difference between above two declaration.
-
- ShravanKumarBagam
- September 27, 2012
- Like
- 0
- Continue reading or reply
Query on Declare variable
Hi,
Integer i;
Public Integer i;
What is the difference between above two declaration..
-
- ShravanKumarBagam
- September 27, 2012
- Like
- 0
- Continue reading or reply
What is Public,Private,Global,and Abstract access modifiers in salesforce?
Hi,
What isthe diffrence between Public,Private,Global,and Abstract access modifiers in salesforce?
-
- ShravanKumarBagam
- September 26, 2012
- Like
- 0
- Continue reading or reply
-
- ShravanKumarBagam
- September 25, 2012
- Like
- 0
- Continue reading or reply
What is a Instanceof keyword
Hi,
Can anybody explain what is instanceof keyword in salesforce with small example?
In which scenario we can use this..
-
- ShravanKumarBagam
- September 25, 2012
- Like
- 0
- Continue reading or reply
-
- ShravanKumarBagam
- September 24, 2012
- Like
- 0
- Continue reading or reply
Why can't we use private variables on visualforce pages?
If we can't use private variables on visualforce pages then where we can use it ?
-
- ShravanKumarBagam
- September 24, 2012
- Like
- 0
- Continue reading or reply
Logout Functionality for developed applciation
Hi,
I have developed an application, in the application i want to implement logout funcionlaity.
if i use "/secur/logout.jsp" it will logout from salesforce...
i want to logout particular applilcation not from them salesforce...
-
- ShravanKumarBagam
- September 05, 2012
- Like
- 0
- Continue reading or reply
Export files from vf page to excel
Hi,
In a vf page i'm displayed two pageblocks,
In 1st pageblock - Account records are displayed
In 2nd pageblcok-Contact records are displayed.
when i click on a export link on vf page, i want export the Only account records in an excel sheet ...
-
- ShravanKumarBagam
- September 04, 2012
- Like
- 0
- Continue reading or reply
Bug on Removing dynamic Textboxes
Hi,
I've created page whenever click on add button two textboxes would be create.
When click on remove button textboxes would be delete. But when i delete Index [1] the textbox will deleted and when i try to delete Index[4] below error occuring.. Error occuring only on remove method
My code everything is correct except below bug
System.ListException: List index out of bounds: 3
public with sharing class textboxcls {
public PageReference save() {
List<Account> lst=new List<Account>();
for(wrapper w:lstwrap){
lst.add(w.acc);
}
insert lst;
return null;
}
public Integer rowId{get;set;}
public PageReference remove() {
system.debug('***********************************************************'+rowId);
lstwrap.remove(rowId);
return null;
}
public PageReference add() {
lstwrap.add(new wrapper(lstwrap.size() ,new Account()));
// system.debug('****************************size*****************************'+lstwrap.size());
return null;
}
public List<wrapper> lstwrap {get; set;}
public class wrapper {
public Integer Index {get; set;}
public Account acc {get; set;}
public wrapper(Integer i, Account a){
Index =i;
acc=a;
}
}
public textboxcls(){
lstwrap=new list<wrapper>();
lstwrap.add(new wrapper(0,new Account()));
}
}
<apex:page controller="textboxcls" showHeader="true">
<apex:form >
<apex:actionFunction name="remove" action="{!remove}" reRender="out">
<apex:param value=" " assignTo="{!rowId}" name="p"/>
</apex:actionFunction>
<apex:pageBlock >
<apex:outputPanel id="out">
<table>
<tr>
<td>Account Name</td>
<td>Phone</td>
</tr>
<apex:repeat value="{!lstwrap}" var="w">
<tr>
<td>
<apex:inputText value="{!w.acc.name}"/>
</td>
<td>
<apex:inputText value="{!w.acc.phone}"/>
</td>
<td>
<apex:commandButton value="+" action="{!add}" reRender="out"/>
</td>
<td>
<apex:commandButton value="-" style="{!if(w.index == 0,'visibility:hidden','visibility:visible')}" onclick=" return remove('{!w.Index}')" reRender="out"/>
</td>
</tr>
</apex:repeat>
</table>
</apex:outputPanel>
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
-
- ShravanKumarBagam
- August 15, 2012
- Like
- 0
- Continue reading or reply
-
- ShravanKumarBagam
- August 07, 2012
- Like
- 0
- Continue reading or reply
Error on apex code
Hi,
My Scenario is The primary focus of this assignment is to demonstrate a more complex user interaction. The user will select one (or more) accounts on the left, click “Show Selected Accounts” and the results will show in the right.
Class
My code almost ok except show method when i select an account click on “Show Selected Accounts” it getting error..
What wrong in my code..
public with sharing class assignment31cls {
public List<Account> lst {get; set;}
public list<wrapper> listwrap {get; set;}
public class wrapper {
public account acc {get; set;}
public boolean check {get; set;}
public wrapper(account a){
acc=a;
check=false;
}
}
public assignment31cls(){
listwrap =new List<wrapper>();
List<Account > lstacc=[select id,name,phone from account limit 10];
for(Account a:lstacc){
listwrap.add(new wrapper(a));
}
}
public PageReference Show() {
for(wrapper w:listwrap){
if(w.check == true){
lst.add(w.acc);
}
}
return null;
}
}
VF Page
<apex:page controller="assignment31cls">
<apex:form >
<table width="100%">
<tr>
<td width="50%">
<apex:pageBlock >
<apex:commandButton value="Show Selected Accounts" action="{!Show}"/>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockTable value="{!listwrap}" var="w">
<apex:column headerValue="Action">
<apex:inputCheckbox value="{!w.check}" />
</apex:column>
<apex:column value="{!w.acc.name}"/>
<apex:column value="{!w.acc.phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</td>
<td>
<apex:pageBlock >
<apex:pageBlockTable value="{!lst}" var="a">
<apex:column value="{!a.name}"/>
<apex:column value="{!a.phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</td>
</tr>
</table>
</apex:form>
</apex:page>
-
- ShravanKumarBagam
- August 06, 2012
- Like
- 0
- Continue reading or reply
Document for Opportunity management
Hi
Kindly Provide reference links for preparing opportunity management system.
-
- ShravanKumarBagam
- August 06, 2012
- Like
- 0
- Continue reading or reply
Query on Error message display
Hi,
I want to display an error msg whenever invalid account id entered. please let me know how can i achieve it.
Here is code..
Class
public with sharing class asgn2cls {
public string SearchAccount {get; set;}
public List<Account> Account {get; set;}
public asgn2cls(ApexPages.StandardController Controller){
}
public pagereference Search(){
try{
if (SearchAccount != '' ){
if(SearchAccount != '')
Account = [select id, name,BillingState,phone,website from Account where name=:SearchAccount ];
}
else {
ApexPages.Message msg=new ApexPages.Message(ApexPages.Severity.Warning,'Please Enter a Search String' );
ApexPages.addMessage(msg);
}
}
catch(exception e){
ApexPages.Message msg=new ApexPages.Message(ApexPages.Severity.Fatal,'No Accounts Found');
ApexPages.addmessage(msg);
}
return null;
}
}
VF Page
<apex:page showHeader="false" standardController="Account" extensions="asgn2cls">
<apex:form >
<apex:pageBlock id="pb">
<apex:pageBlockSection title="Search" collapsible="false" columns="3" >
<apex:outputLabel style="margin-left:190px"><b>Search</b></apex:outputLabel>
<apex:inputText value="{!SearchAccount}" />
<apex:commandButton value="Search" action="{!Search}" reRender="pb" style="margin-right:800px" />
</apex:pageBlockSection>
<apex:pageBlockSection title="Results" collapsible="false"></apex:pageBlockSection><br/><br/>
<apex:pageMessages ></apex:pageMessages>
<apex:pageBlockTable value="{!Account}" var="a">
<apex:column headerValue="Account Name" value="{!a.name}"/>
<apex:column headerValue="BillingState" value="{!a.BillingState}"/>
<apex:column headerValue="Phone" value="{!a.Phone}"/>
<apex:column headerValue="Website" value="{!a.website}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
-
- ShravanKumarBagam
- July 31, 2012
- Like
- 0
- Continue reading or reply
Error on apex code
Hi,
My Scenario is The primary focus of this assignment is to demonstrate a more complex user interaction. The user will select one (or more) accounts on the left, click “Show Selected Accounts” and the results will show in the right.
Class
My code almost ok except show method when i select an account click on “Show Selected Accounts” it getting error..
What wrong in my code..
public with sharing class assignment31cls {
public List<Account> lst {get; set;}
public list<wrapper> listwrap {get; set;}
public class wrapper {
public account acc {get; set;}
public boolean check {get; set;}
public wrapper(account a){
acc=a;
check=false;
}
}
public assignment31cls(){
listwrap =new List<wrapper>();
List<Account > lstacc=[select id,name,phone from account limit 10];
for(Account a:lstacc){
listwrap.add(new wrapper(a));
}
}
public PageReference Show() {
for(wrapper w:listwrap){
if(w.check == true){
lst.add(w.acc);
}
}
return null;
}
}
VF Page
<apex:page controller="assignment31cls">
<apex:form >
<table width="100%">
<tr>
<td width="50%">
<apex:pageBlock >
<apex:commandButton value="Show Selected Accounts" action="{!Show}"/>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockTable value="{!listwrap}" var="w">
<apex:column headerValue="Action">
<apex:inputCheckbox value="{!w.check}" />
</apex:column>
<apex:column value="{!w.acc.name}"/>
<apex:column value="{!w.acc.phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</td>
<td>
<apex:pageBlock >
<apex:pageBlockTable value="{!lst}" var="a">
<apex:column value="{!a.name}"/>
<apex:column value="{!a.phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</td>
</tr>
</table>
</apex:form>
</apex:page>
- ShravanKumarBagam
- August 06, 2012
- Like
- 0
- Continue reading or reply
ApexPages Message
Hi,
I' using page messages to display message on vf page.
I want to display message as show below...
How can i achieve that
Message:'You Selected'+' '+a.name
ApexPages.Message msg=new ApexPages.Message(ApexPages.Severity.Info,'You Selected'+' '+a.name );
ApexPages.addMessage(msg);
- ShravanKumarBagam
- July 17, 2012
- Like
- 0
- Continue reading or reply
Can we make it Field as Read only Through coding
Hi,
Can we make it Field as Read only to particular profile Through coding?
If it is possible,let me know how can we do that.
- ShravanKumarBagam
- July 17, 2012
- Like
- 0
- Continue reading or reply
Throw an Error along with the error record
I want to show an error that already a record is made primary. 'Please uncehck primary on test11 record'
- SIVASASNKAR
- July 11, 2012
- Like
- 0
- Continue reading or reply
Count number of Contacts for Particular Account
Take a number field on Account. Whnever a Contact is inserted for a particular account, number value in accoutn ahould be increamented by 1.
- SIVASASNKAR
- July 11, 2012
- Like
- 0
- Continue reading or reply
Make amount field read only on opportunity whenever an opportunity stage is closed won.
Hi,
How can i do that can any body explain?
- ShravanKumarBagam
- July 07, 2012
- Like
- 0
- Continue reading or reply
Error on SOQL
Hi,
I've write a query on opportunity to see avg amount.
How can i see avg amount of opportunity.
Error:line 1, column 1: Illegal assignment from LIST to LIST
List<Opportunity> lst = [SELECT AVG(Amount) FROM Opportunity];
- ShravanKumarBagam
- July 05, 2012
- Like
- 0
- Continue reading or reply
Using Triggers how can i send a mail?
Hi,
here is my code.Scenario is when a record is created on account object triggers then it will shoot mail.
trigger acctrig on Account (before insert) {
account a=trigger.new[0];
list<string> toaddress=new list<string>();
toaddress.add('shravankumabragam@yahoo.com');
String subject = 'Account Trigger';
String body = 'Hi, Account trigger has been fired,new account has been created.please check on Account object' ;
String Signature = 'B.Shravankumar';
Messaging.SingleEmailMessage mail=new Messaging.SingleEmailMessage();
mail.setToAddresses(toaddress);
mail.setSenderDisplayName('Salesforce Outbound Notification');
mail.setsubject(subject);
mail.setplaintextbody(body);
mail.setuseSignature(true);
Messaging.sendEmail(new Messaging.singleEmailmessage[]{mail});
}
- ShravanKumarBagam
- July 04, 2012
- Like
- 0
- Continue reading or reply
- ShravanKumarBagam
- July 02, 2012
- Like
- 0
- Continue reading or reply
Query Batch Apex
Hi,
I have 10 BatchApex Clases ,i need execute at a time.
Do i need to write a apex code for 10 batch classesin developer console .
Otherwise is there any other process.
- ShravanKumarBagam
- June 30, 2012
- Like
- 0
- Continue reading or reply
How to write a testclass for batch apex ?
Hi,
I am write a test class for batch apex,my code coverage is 33%, it is covered only start method.
How can i write test class for execute method?
Testclass for Batch Class
@isTest
private class testtrainingbatchcls {
static testmethod void m1() {
List<training__c> lst=new List<training__c>();
for(integer i=0;i<1500;i++) {
training__c t=new training__c();
t.name = 'T'+i;
lst.add(t);
}
trainingbatchcls obj=new trainingbatchcls();
Database.executeBatch(obj);
}
}
Batch Apex Class
global class trainingbatchcls implements Database.batchable <sobject>{
global list<training__c> start(Database.BatchableContext bc){
List<training__c> lst=new List<training__c>();
for(integer i=0;i<1500;i++){
training__c t=new training__c();
t.name = 'T'+i;
lst.add(t);
}
return lst;
}
global void execute(Database.BatchableContext bc,list<training__C>lst) {
insert lst;
}
global void finish(Database.BatchableContext bc){
list<string> toaddress = new list<string>();
toaddress.add('shravankumarbagam@yahoo.com');
String subject = 'Batch class run complete';
String body = '';
Messaging.singleEmailMessage mail = new Messaging.singleEmailMessage();
mail.setToAddresses(toaddress);
mail.setSenderDisplayName('Salesforce Outbound Notification');
mail.setSubject(subject);
mail.setPlainTextBody(body);
mail.setUseSignature(false);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}
- ShravanKumarBagam
- June 29, 2012
- Like
- 0
- Continue reading or reply
- ShravanKumarBagam
- June 28, 2012
- Like
- 0
- Continue reading or reply
how can i write test method delete event?
I write a test method for below class code coverage is 60% can any body tell how can i write a testmethod for the delete event...
Class TestMethod
Class
public with sharing class paramcls {
public PageReference delrec() {
System.debug('----------------RecordId---------------'+recordId);
Account acc = [Select id from account where id=:recordId];
delete acc;
pagereference ref = new pagereference('/apex/param');
ref.setredirect(true);
return ref;
}
public string recordId{get; set;}
public List<Account> lst {get; set;}
public paramcls(){
lst = [Select id, name, phone from Account];
}
}
- ShravanKumarBagam
- June 22, 2012
- Like
- 0
- Continue reading or reply
- ShravanKumarBagam
- June 22, 2012
- Like
- 0
- Continue reading or reply