• Vinod Admin
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
Hi Every One,

I have created a Vf page, In this when ever we mouseover the output lable it needs to rerender the pageblock table but it is not diplaying. Please help me on this,
VF:
<apex:page controller="exampleCon">
    <apex:form >
        <apex:outputpanel id="counter">
            <apex:outputText value="Click Me!: {!count}"/>
            <apex:actionSupport event="onmouseover"
                                action="{!incrementCounter}"
                                rerender="op" status="counterStatus"/>
        </apex:outputpanel>
        <apex:actionStatus id="counterStatus"
                           startText=" (incrementing...)"
                           stopText=" (done)"/>
                       
         <apex:outputpanel id="op" rendered="{!opc}">                  
            <apex:pageBlock id="pb" >
                <apex:pageBlockTable value="{!acc}" var="a">
                    <apex:column value="{!a.Name}"/>
                </apex:pageBlockTable>
           </apex:pageBlock>
       </apex:outputpanel>
    </apex:form>
</apex:page>

Controller:
/***  Controller: ***/
public class exampleCon {
    Integer count = 0;
    public boolean opc {get; set;}
    public Account acc{get; set;}
   
   public exampleCon(){
       opc=false;
   }             
    public PageReference incrementCounter() {
            opc=true;
            count++;
            display();
            return null;
    }
    public PageReference display() {
            opc=true;
             acc=[select id,Name from Account limit 1];
             system.debug('>>>>>>>xxx>>>>>>>>>>');
            return null;
    }
                    
    public Integer getCount() {
        return count;
    }
}

Please correct me where i did mistake.
trigger prevent_duplicate_account on Account (before insert) {
    map<id,Account> mapAcc = new map<id,Account>([Select id,name,rating from Account ]);
    for(Account a : Trigger.new)
    {
        if(a.Name==mapAcc.get(a.id).name && a.rating==mapAcc.get(a.id).rating)
            a.adderror('you cant add duplicate account');
    }

}
I have already an account with name as IGA ,i am updating this account with rating =warm ,it is preventing to save record .since I have used && condition ,if both are true then only it should save the record to save . Also If i am creating a record with name as IGA and rating different from the previous one than also I am getting error .What can be done please help
Thanks in advance!!
wrapper class:
public class AccountWrapper {
    public account acc {get;set;}
    public boolean flag  {get;set;}       
}
class:
public class Dmlexamle6 {
    public string allrec                 {get;set;}
    public list<AccountWrapper> aws      {get;set;}
    
    public void searched(){
        aws=new list<AccountWrapper>();
        list<account> accs=[select name,phone,industry from account];
        for(account a:accs){
            AccountWrapper aw=new AccountWrapper();
            aw.acc=a;
            aw.flag=false;
            aws.add(aw);
        }
    }
    public void delects(){
        list<account> a= new list<account>();
        list<AccountWrapper> aes=new list<AccountWrapper>();
        for(AccountWrapper aw:aws){
               if(aw.flag==true){
               a.add(aw.acc);
               }
        }
        delete a;
    }
}
vf page:
<apex:page controller="Dmlexamle6">
    <apex:form >
        <apex:inputText value="{!allrec}"/>
        <apex:commandButton value="search" action="{!searched}"/>
        <apex:pageblock rendered="{! !isnull(aws)}">
            <apex:pageBlockButtons location="top">
                <apex:commandbutton value="delete" action="{!delects}"/>
            </apex:pageBlockButtons>
            <apex:pageblocktable value="{!aws}" var="b">
                <apex:column >
                    <apex:facet name="header"><apex:inputcheckbox /></apex:facet>
                    <apex:inputCheckbox value="{!b.flag}"/>
                </apex:column>
                <apex:column value="{!b.acc.name}"/>
                <apex:column value="{!b.acc.phone}"/>
                <apex:column value="{!b.acc.industry}"/>
            </apex:pageblocktable>
        </apex:pageblock>
    </apex:form>
</apex:page>

it gives  all records but after press delete button from database it delets but in list it not delets.User-added image
  • September 08, 2017
  • Like
  • 0
Hi, 

I add a new formula field Complete_Date__c in a custom object named TDR, and want it shown in a VF page: 
<apex:outputField value="{!tdr.Complete_Date__c}" />
And I have added its readonly access to proper profile and permission set. 
But it is still blank in VF page. 
Anybody saw a similar issue before? thanks. 

Regards,
Tan Wenlong
Hi
I am plannning to give salesforce developer winter 17 maintenance exam. But in my Webassessor account I dont see any option to register for maintenance Exam. Can any one pls help me to register for salesforce developer winter 17 maintenance exam.

Thanks,
Dilip
What is the standard crm functionality?
thanks in advance

Hello all,

 

I'm trying to create a lead using the Force.com REST API and able to do so successfully.

 

Now, I go ahead and delete that lead from Salesforce. 

 

If I try to create the same lead again via API, then it gives the following error:

[{"fields":[],"message":"entity is deleted","errorCode":"ENTITY_IS_DELETED"}]

 

I also tried deleting the lead from Recycle Bin in Salesforce, but that didn't helped.

 

Please let me know what I'm doing wrong.

  • March 26, 2013
  • Like
  • 0