• Lukesh Karmore
  • NEWBIE
  • 15 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 50
    Questions
  • 62
    Replies
I am writing trigger " when account is updated, add all releted OpportunityLineItem to account asset releted list"
i successfully write code that working fine ,but  whenever i update account 2nd time it insert duplicate asset.
if Accounts Opp contain 4 opportunityLineItem, Let say 3 asset already added to account releted list and 1 Oli (line item) is remaining so in 2nd update only that remaining 1 is added
only i need code as answer on above functionality ,no any other ans please Thank you.

trigger CreateAnAssetWithAllReletedOppLineItemReletedTOAccount_WhenAccountIsUpdated on Account (After Update) {
set<Id> AccIds=new set<Id>();
for(account acc:Trigger.new){
    AccIds.add(acc.Id);
}
list<Opportunity> opplist=[SELECT id,AccountId FROM Opportunity WHERE AccountId In:accIds];
list<OpportunityLineItem> OliList=[SELECT pricebookentry.name,pricebookentry.product2Id,quantity,Description,unitprice FROM OpportunityLineItem WHERE OpportunityId IN :opplist];
list<asset> asslist=new list<asset>();
for(Opportunity opp:opplist){
    for(OpportunityLineItem oli:OliList){
        Asset a=new Asset();
       a.AccountId=opp.AccountId;
       a.product2Id=oli.pricebookentry.product2Id;
       a.quantity=oli.quantity;
       a.price=oli.unitprice;
       a.Description=oli.Description;
       a.name=oli.pricebookentry.name;
       asslist.add(a);
    }
}
insert asslist;
}
Hello i write a trigger (When account type is update send mail to all releted contacts)
trigger WhenAccountTypeIsChange_SendEmailToAllReletedContacts on Account (After Update) {
set<id> AccountId=new set<id>();
for(account a:Trigger.new){
    if( a.type!=Trigger.oldMap.get(a.id).type){
        AccountId.add(a.id);
    }
}
list<Messaging.singleEmailMessage> mailList=new list<Messaging.singleEmailMessage>();
list<contact> contactlist=[select email from contact where AccountId in:AccountId];
for(account acc:Trigger.new){
    for(integer i=0; i<contactlist.size();i++){
        contact con=contactlist.get(i);
    Messaging.singleEmailMessage mail=new Messaging.singleEmailMessage();
    list<string> toAddress=new list<string>();
    toAddress.add(con.Email);
    mail.setTargetObjectId(con.id);
   mail.setToAddresses(toAddress);
    mail.setsubject('Account Update Info');
    mail.setHTMLBody('Your Account information Updated successfully.<br/>account Name: ' +acc.Name+
    '<br/>Your AccountType Is Changed To '+Acc.Type);
    mailList.add(mail);
    
}
}
Messaging.SendEmail(mailList);
}
but getting error
WhenAccountTypeIsChange_SendEmailToAllReletedContacts: execution of AfterUpdate caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: SINGLE_EMAIL_LIMIT_EXCEEDED, Email limit exceeded: [] Trigger.WhenAccountTypeIsChange_SendEmailToAllReletedContacts: line 26, column 1
i have 2 contacts releted to account but mail goes to 1st contact only is  there any way to send more than one person without referencing exact email id
Thank you
trigger sendEmailToContactWhenfileIsCreated on ContentDocumentLink (after insert) {
   set<id> conDocId=new set<id>();
   for(contentDocumentLink cond:Trigger.new){
    if(cond.linkedEntityId!=null ){
        conDocId.add(cond.linkedEntityId);
   }
}
list<Messaging.SingleEmailMessage> emailList = new list<Messaging.SingleEmailMessage>();
    list<contact> conlist=[select id ,email from contact where id in:conDocId];
for(contentDocumentLink cond:Trigger.new){
    for(contact c:conlist){
        contentversion cv=[select title,versionData from contentversion where id=:cond.contentdocumentId ];
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        list<string> toaddress=new list<string>();
        toaddress.add(c.Email);
        semail.setToaddresses(toaddress);
        semail.setsubject('Email Attachment');
        semail.setPlaintextbody('This is first email attachment');
        semail.settargetobjectId(c.id);
        emailList.add(semail);
        Messaging.EmailFileAttachment efa=new Messaging.EmailFileAttachment();
        efa.setFilename(cv.Title[0]);
        efa.setbody(cv.versionData[0]);

        efa.setFileattachment(new  Messaging.EmailFileAttachment[]{efa});
    }
      }
      Messaging.sendEmail(emailList);
}
I am getting error in above bold line , how to setFilename &setbody  Help here Thank You.
i merge below  fields,but not receive in email
Hii,{!Contact.Name}
Your Order has been proceed
Your order detail is below.
Product Name:{!Product2.Name}
Product Code:{!Product2.code}
Unit Price:{!OpportunityLineItem.UnitPrice}
List Price:{!OpportunityLineItem.ListPrice}
Discount:{!OpportunityLineItem.Discount}
Thanks
{!Contact.Name}


User-added image
create custom field on account (client contact lookup to contact)
when account is insert  ,contact is also inserted with same name
and  that contact will be client contact on account
I am getting an error in above scenario.
Error is 
CreateDuplicateLead_WhenLeadIsInserted: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATES_DETECTED, Use one of these records?: [] Trigger.CreateDuplicateLead_WhenLeadIsInserted: line 14, column 1
trigger CreateDuplicateLead_WhenLeadIsInserted on lead (after insert) {
    List<Lead> dupLead = new List<Lead>();  
    for(Lead ld : Trigger.new)
    {
      Lead leadrec = ld.clone(false);
     dupLead.add(leadrec);
           }
    insert  dupLead;
}
Thank You
EmailTemplate et = [SELECT Id FROM EmailTemplate WHERE
 DeveloperName =:sendmailtocontactiscreated];
what is developer name here
Thank you.
Hello forum,
 I create custom profile name Employee profile having salesforce license but when going to assign it to perticular user not find option there.
how to assign custom profile??
Thank you
my code is -
trigger UpdateAccRatingToHot_WhenOppStageIsClosedWon on  Opportunity ( before insert) {
    list<account> accounts =  new list<account>();
    for(account acc : [select name, rating from account]){
    for(opportunity opp : trigger.new){
        if(opp.stagename == 'closed won'){
            acc.Rating = 'Hot';
            accounts.add(acc);
        }
    }
  }update accounts;
}

It gives me error of too many SOQL queries Why??
I created flow but stuck at some point , here is the question
whenever an Account is created or updated, auto-populate the number of open opportunities counts in a custom field on the Account i.e. No. of Open Opportunities (No_of_Open_Opportunities__c). 
Explain  it Thank you
Can any one explain me what is the use of picklistValueInfo  and EntityParticleId   can't  find any documents or provide me a document
Thank you
whenever i set required="{!a.Required}" i am getting above error why it is

<apex:pageBlockSection  >
<apex:repeat value="{!fieldList}" var="a">
    <apex:inputField value="{!actObj[a]}"  required="{!a.Required}"/>
</apex:repeat>
</apex:pageBlockSection>
I am creating validation rule "OR( ISBLANK(Email),ISBLANK(Phone) , ISNEW() )" I have to show the error below each field ,it is  possible to show error below each field email, phone.
or  need to create two diff  validation rule  on email and phone .
Thank You
What is the use of event.type and event.detail ,I used it in js file in lwc 
handlesubmit(event){
console.log(event.type);
console.log(event.detail);
}
Thank You
look at below code i put validation using javascript but it not throwing me error , i am unable to find error help me forum.
Thank you


public class insertcontact {
    public string FirstName{get; set;}
    public string LastName{get; set;}
    public string Phone{get; set;}
    public string Email{get; set;}
    contact con=new contact();
    public pagereference showcontact(){
        con.FirstName=FirstName;
        con.LastName=LastName;
        con.Phone=Phone;
        con.Email=Email;
        insert con;
        return null;
         }
}


<apex:page controller="insertcontact"  lightningStylesheets="true">
    <apex:form id="EE" >     
    <apex:actionFunction name="callSave" action="{!showcontact}" reRender="out"/>
        <apex:pageblock title="insert contact" id="AA" tabstyle="Account">
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Save" onclick="myfunction(); return false"  />
                </apex:pageBlockButtons>
                
            <apex:pageblocksection id="xx">
                <apex:outputLabel value="First Name"/>
                <apex:inputtext value="{!FirstName}"   />
                <apex:outputLabel value="Last Name"/>
                <apex:inputtext value="{!LastName}"   />
                 <apex:outputLabel value="Email"/>
                 <apex:inputtext value="{!Email}" id="BB"  />
                 <apex:outputLabel value="Phone"/>
                 <apex:inputtext value="{!Phone}"  id="CC"   />
                
                <apex:outputPanel id="out">
                    {!FirstName} {!LastName}
                    {!Email}
                    {!Phone}
                </apex:outputPanel>
            </apex:pageblocksection>
      </apex:pageblock>
        <script type="text/javascript">
        function myfunction(){
        var Emailparam= document.getElementById('{!$Component.EE.AA.xx.BB}').value;
        var Phoneparam= document.getElementById('{!$Component.EE.AA.xx.CC}').value;
            if(Emailparam ==''||Phoneparam ==''){
            Alert('Email and phone field is mandatary, take care of this');
              
            }
            else{
            callSave(Emailparam,Phoneparam);
            }
        }
        </script>
    </apex:form>
</apex:page>
can any one help me to clear the error
Thank you

public  class ActionFunctionTest
{
   public string myVar{get; set;}
    public void showValue(){
        myVar='hey Lukesh How are you';       
    }
    }
    
<apex:page controller="ActionFunctionTest">
<apex:form>
    <apex:actionFunction Name="myAction" action="{!showValue}" reRender="out" />
    
    <apex:commandButton value="click me"  onclick="myfunction(); result false"/>
    <br/>
    <apex:outputPanel id="out">
     { !myVar}
    </apex:outputPanel>

    <script>
    function myfunction(){
    myAction();
    }
    </script>
</apex:form>
</apex:page>
my edit commandLink i s not working , when click no response  check the below code  help me to find error:
controller class:
public class contactSaveandEditClass {
    public List<wrapperclass> contactList{get; set;}
    public integer RowIndex{get; set;}
    public wrapperclass objwrapper;
    public  contactSaveandEditClass(){
        list<contact> contacts=[select id,FirstName,LastName,Phone,Title from contact];
        contactList=new list<wrapperclass>();
    for(integer i=0;i<contacts.size(); i++){
        objwrapper=new wrapperclass(); 
        objwrapper.con=contacts[i];
        objwrapper.doEdit=false;
        objwrapper.RowNo=contacts.size();
        contactList.add(objwrapper);
    }
    }
        public PageReference  EditMethod(){
            if(contactList.size()>RowIndex){
                contactList[RowIndex].doEdit=true;
            }
            return null;
        }
         public pageReference SaveMethod(){
            if(contactList.size()>RowIndex){
                contactList[RowIndex].doEdit=false;
            }
            return null;
        }
         public class wrapperclass{
        public contact con{get; set;}
        public boolean doEdit{get; set;}
        public integer RowNo{get; set;}
    }
}

VF class:
<apex:page controller="contactSaveandEditClass">
    <apex:sectionHeader title="Contacts"/>
    <apex:form >
        <apex:pageblock id="acc" title="Contact List">
            <apex:pageBlockSection >
                <apex:pageblocktable value="{!contactList}" var="a">
                    <apex:column headerValue="Action">
                         <apex:commandlink action="{!EditMethod}" value="Edit" reRender="acc"  rendered="{!NOT(a.doEdit)}">
                             <apex:param Name="rowNumber"  Value="{!a.RowNo}"  assignTo="{!RowIndex}"/>
                        </apex:commandlink>
                     <apex:commandlink action="{!SaveMethod}" value="Save" reRender="acc"  rendered="{!(a.doEdit)}">
                             <apex:param Name="rowNumber"  Value="{!a.RowNo}"  assignTo="{!RowIndex}"/>
                        </apex:commandlink>
                    </apex:column>
                    <apex:column headerValue="FirstName" >
                        <apex:outputField value="{!a.con.FirstName}" rendered="{!NOT(a.doEdit)}" />
                        <apex:inputField value="{!a.con.FirstName}" rendered="{!(a.doEdit)}"/>
                     </apex:column>
                     <apex:column headerValue="LastName" >
                    <apex:outputField value="{!a.con.LastName}" rendered="{!NOT(a.doEdit)}" />
                     <apex:inputField value="{!a.con.LastName}" rendered="{!(a.doEdit)}"/>
                     </apex:column>
                    <apex:column headerValue="Phone">
                     <apex:outputField value="{!a.con.Phone}"  rendered="{!NOT(a.doEdit)}"/>
                     <apex:inputField value="{!a.con.Phone}" rendered="{!(a.doEdit)}"/>
                    </apex:column>
                    <apex:column headerValue="Title" > 
                     <apex:outputField value="{!a.con.Title}" rendered="{!NOT(a.doEdit)}"/>
                     <apex:inputField value="{!a.con.Title}"  rendered="{!(a.doEdit)}"/>
                    </apex:column>
                </apex:pageblocktable>
             </apex:pageBlockSection>
         </apex:pageblock>
     </apex:form>
</apex:page>
Thank You
  <apex:commandlink value="Edit" rerender="thePB" rendered="{!NOT(a.isEdit)}" action="{!editmethid}">
          <apex:param name="rowNumber" value="{!a.rowNo}" assignTo="{!rowIndex}"/>
      </apex:commandLink>

in above condition we use apex param it is necessary to use it with apex:commandLink  always.
if i remove this apex:param  then this commandLink  Edit not work  why it is..
Thank You.
The current value of a.isEdit is true. So NOT(a.isEdit) is  false???
and   the value of this {!NOT(a.isEdit)} ???
Reply me
what does it mean rendered="{!NOT(a.isEdit)}
<apex:commandlink value="Edit" rerender="thePB"
rendered="{!NOT(a.isEdit)}" action="{!editmethid}">
          <apex:param name="rowNumber" value="{!a.rowNo}" assignTo="{!rowIndex}"/>
      </apex:commandLink>
Can any one explain me what is the use of picklistValueInfo  and EntityParticleId   can't  find any documents or provide me a document
Thank you
my edit commandLink i s not working , when click no response  check the below code  help me to find error:
controller class:
public class contactSaveandEditClass {
    public List<wrapperclass> contactList{get; set;}
    public integer RowIndex{get; set;}
    public wrapperclass objwrapper;
    public  contactSaveandEditClass(){
        list<contact> contacts=[select id,FirstName,LastName,Phone,Title from contact];
        contactList=new list<wrapperclass>();
    for(integer i=0;i<contacts.size(); i++){
        objwrapper=new wrapperclass(); 
        objwrapper.con=contacts[i];
        objwrapper.doEdit=false;
        objwrapper.RowNo=contacts.size();
        contactList.add(objwrapper);
    }
    }
        public PageReference  EditMethod(){
            if(contactList.size()>RowIndex){
                contactList[RowIndex].doEdit=true;
            }
            return null;
        }
         public pageReference SaveMethod(){
            if(contactList.size()>RowIndex){
                contactList[RowIndex].doEdit=false;
            }
            return null;
        }
         public class wrapperclass{
        public contact con{get; set;}
        public boolean doEdit{get; set;}
        public integer RowNo{get; set;}
    }
}

VF class:
<apex:page controller="contactSaveandEditClass">
    <apex:sectionHeader title="Contacts"/>
    <apex:form >
        <apex:pageblock id="acc" title="Contact List">
            <apex:pageBlockSection >
                <apex:pageblocktable value="{!contactList}" var="a">
                    <apex:column headerValue="Action">
                         <apex:commandlink action="{!EditMethod}" value="Edit" reRender="acc"  rendered="{!NOT(a.doEdit)}">
                             <apex:param Name="rowNumber"  Value="{!a.RowNo}"  assignTo="{!RowIndex}"/>
                        </apex:commandlink>
                     <apex:commandlink action="{!SaveMethod}" value="Save" reRender="acc"  rendered="{!(a.doEdit)}">
                             <apex:param Name="rowNumber"  Value="{!a.RowNo}"  assignTo="{!RowIndex}"/>
                        </apex:commandlink>
                    </apex:column>
                    <apex:column headerValue="FirstName" >
                        <apex:outputField value="{!a.con.FirstName}" rendered="{!NOT(a.doEdit)}" />
                        <apex:inputField value="{!a.con.FirstName}" rendered="{!(a.doEdit)}"/>
                     </apex:column>
                     <apex:column headerValue="LastName" >
                    <apex:outputField value="{!a.con.LastName}" rendered="{!NOT(a.doEdit)}" />
                     <apex:inputField value="{!a.con.LastName}" rendered="{!(a.doEdit)}"/>
                     </apex:column>
                    <apex:column headerValue="Phone">
                     <apex:outputField value="{!a.con.Phone}"  rendered="{!NOT(a.doEdit)}"/>
                     <apex:inputField value="{!a.con.Phone}" rendered="{!(a.doEdit)}"/>
                    </apex:column>
                    <apex:column headerValue="Title" > 
                     <apex:outputField value="{!a.con.Title}" rendered="{!NOT(a.doEdit)}"/>
                     <apex:inputField value="{!a.con.Title}"  rendered="{!(a.doEdit)}"/>
                    </apex:column>
                </apex:pageblocktable>
             </apex:pageBlockSection>
         </apex:pageblock>
     </apex:form>
</apex:page>
Thank You
 I want to build a trigger on product object 
so the scenario is 
when a new product is created a field should get populated as a new product.
  • May 07, 2021
  • Like
  • 0
1.I am trying to come up with a Pdf Attachment in Email with the process builder.
2.In the Contact object, I have a Picklist field called Status__c values YES and No.
3.If Status__c is changed to Yes the email with pdf attachment to the particular contact.

 have Pdf coding, I need a PDF attachment in apex with process builder coding needed. Can help me out:(

PDF coding
 
<apex:page standardController="Account" renderAs="pdf">
 
Hey, the Account name is {!account.Name}
 
</apex:page>

 
  • April 28, 2021
  • Like
  • 0
trigger sendEmailToContactWhenfileIsCreated on ContentDocumentLink (after insert) {
   set<id> conDocId=new set<id>();
   for(contentDocumentLink cond:Trigger.new){
    if(cond.linkedEntityId!=null ){
        conDocId.add(cond.linkedEntityId);
   }
}
list<Messaging.SingleEmailMessage> emailList = new list<Messaging.SingleEmailMessage>();
    list<contact> conlist=[select id ,email from contact where id in:conDocId];
for(contentDocumentLink cond:Trigger.new){
    for(contact c:conlist){
        contentversion cv=[select title,versionData from contentversion where id=:cond.contentdocumentId ];
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        list<string> toaddress=new list<string>();
        toaddress.add(c.Email);
        semail.setToaddresses(toaddress);
        semail.setsubject('Email Attachment');
        semail.setPlaintextbody('This is first email attachment');
        semail.settargetobjectId(c.id);
        emailList.add(semail);
        Messaging.EmailFileAttachment efa=new Messaging.EmailFileAttachment();
        efa.setFilename(cv.Title[0]);
        efa.setbody(cv.versionData[0]);

        efa.setFileattachment(new  Messaging.EmailFileAttachment[]{efa});
    }
      }
      Messaging.sendEmail(emailList);
}
I am getting error in above bold line , how to setFilename &setbody  Help here Thank You.
i merge below  fields,but not receive in email
Hii,{!Contact.Name}
Your Order has been proceed
Your order detail is below.
Product Name:{!Product2.Name}
Product Code:{!Product2.code}
Unit Price:{!OpportunityLineItem.UnitPrice}
List Price:{!OpportunityLineItem.ListPrice}
Discount:{!OpportunityLineItem.Discount}
Thanks
{!Contact.Name}


User-added image
create custom field on account (client contact lookup to contact)
when account is insert  ,contact is also inserted with same name
and  that contact will be client contact on account
I created flow but stuck at some point , here is the question
whenever an Account is created or updated, auto-populate the number of open opportunities counts in a custom field on the Account i.e. No. of Open Opportunities (No_of_Open_Opportunities__c). 
Explain  it Thank you
Can any one explain me what is the use of picklistValueInfo  and EntityParticleId   can't  find any documents or provide me a document
Thank you
whenever i set required="{!a.Required}" i am getting above error why it is

<apex:pageBlockSection  >
<apex:repeat value="{!fieldList}" var="a">
    <apex:inputField value="{!actObj[a]}"  required="{!a.Required}"/>
</apex:repeat>
</apex:pageBlockSection>
Hello I am writing a trigger on contact object where if I select account lookup field than account s country also get populated in contact object.
code is working fine just need to optimised it .

 
public class UpdateContactRecordsFromAccount {

   
    public void beforeInsert(List<Contact > neWValues)
    {
       Set<ID> id_po = new Set<ID>();
      for(Contact po : newValues){
            id_po.add(po.AccountId);
        }
       
     List<Account> AccountList = [select id , Country__c  from Account where Id in : id_po];
     for(Contact con : neWValues){  
          for(Account  acc : AccountList)
          {
           con.Country__c = acc.Country__c;
            
          }
       }
    }
}

Please help 
I am creating validation rule "OR( ISBLANK(Email),ISBLANK(Phone) , ISNEW() )" I have to show the error below each field ,it is  possible to show error below each field email, phone.
or  need to create two diff  validation rule  on email and phone .
Thank You
What is the use of event.type and event.detail ,I used it in js file in lwc 
handlesubmit(event){
console.log(event.type);
console.log(event.detail);
}
Thank You
look at below code i put validation using javascript but it not throwing me error , i am unable to find error help me forum.
Thank you


public class insertcontact {
    public string FirstName{get; set;}
    public string LastName{get; set;}
    public string Phone{get; set;}
    public string Email{get; set;}
    contact con=new contact();
    public pagereference showcontact(){
        con.FirstName=FirstName;
        con.LastName=LastName;
        con.Phone=Phone;
        con.Email=Email;
        insert con;
        return null;
         }
}


<apex:page controller="insertcontact"  lightningStylesheets="true">
    <apex:form id="EE" >     
    <apex:actionFunction name="callSave" action="{!showcontact}" reRender="out"/>
        <apex:pageblock title="insert contact" id="AA" tabstyle="Account">
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Save" onclick="myfunction(); return false"  />
                </apex:pageBlockButtons>
                
            <apex:pageblocksection id="xx">
                <apex:outputLabel value="First Name"/>
                <apex:inputtext value="{!FirstName}"   />
                <apex:outputLabel value="Last Name"/>
                <apex:inputtext value="{!LastName}"   />
                 <apex:outputLabel value="Email"/>
                 <apex:inputtext value="{!Email}" id="BB"  />
                 <apex:outputLabel value="Phone"/>
                 <apex:inputtext value="{!Phone}"  id="CC"   />
                
                <apex:outputPanel id="out">
                    {!FirstName} {!LastName}
                    {!Email}
                    {!Phone}
                </apex:outputPanel>
            </apex:pageblocksection>
      </apex:pageblock>
        <script type="text/javascript">
        function myfunction(){
        var Emailparam= document.getElementById('{!$Component.EE.AA.xx.BB}').value;
        var Phoneparam= document.getElementById('{!$Component.EE.AA.xx.CC}').value;
            if(Emailparam ==''||Phoneparam ==''){
            Alert('Email and phone field is mandatary, take care of this');
              
            }
            else{
            callSave(Emailparam,Phoneparam);
            }
        }
        </script>
    </apex:form>
</apex:page>
can any one help me to clear the error
Thank you

public  class ActionFunctionTest
{
   public string myVar{get; set;}
    public void showValue(){
        myVar='hey Lukesh How are you';       
    }
    }
    
<apex:page controller="ActionFunctionTest">
<apex:form>
    <apex:actionFunction Name="myAction" action="{!showValue}" reRender="out" />
    
    <apex:commandButton value="click me"  onclick="myfunction(); result false"/>
    <br/>
    <apex:outputPanel id="out">
     { !myVar}
    </apex:outputPanel>

    <script>
    function myfunction(){
    myAction();
    }
    </script>
</apex:form>
</apex:page>
my edit commandLink i s not working , when click no response  check the below code  help me to find error:
controller class:
public class contactSaveandEditClass {
    public List<wrapperclass> contactList{get; set;}
    public integer RowIndex{get; set;}
    public wrapperclass objwrapper;
    public  contactSaveandEditClass(){
        list<contact> contacts=[select id,FirstName,LastName,Phone,Title from contact];
        contactList=new list<wrapperclass>();
    for(integer i=0;i<contacts.size(); i++){
        objwrapper=new wrapperclass(); 
        objwrapper.con=contacts[i];
        objwrapper.doEdit=false;
        objwrapper.RowNo=contacts.size();
        contactList.add(objwrapper);
    }
    }
        public PageReference  EditMethod(){
            if(contactList.size()>RowIndex){
                contactList[RowIndex].doEdit=true;
            }
            return null;
        }
         public pageReference SaveMethod(){
            if(contactList.size()>RowIndex){
                contactList[RowIndex].doEdit=false;
            }
            return null;
        }
         public class wrapperclass{
        public contact con{get; set;}
        public boolean doEdit{get; set;}
        public integer RowNo{get; set;}
    }
}

VF class:
<apex:page controller="contactSaveandEditClass">
    <apex:sectionHeader title="Contacts"/>
    <apex:form >
        <apex:pageblock id="acc" title="Contact List">
            <apex:pageBlockSection >
                <apex:pageblocktable value="{!contactList}" var="a">
                    <apex:column headerValue="Action">
                         <apex:commandlink action="{!EditMethod}" value="Edit" reRender="acc"  rendered="{!NOT(a.doEdit)}">
                             <apex:param Name="rowNumber"  Value="{!a.RowNo}"  assignTo="{!RowIndex}"/>
                        </apex:commandlink>
                     <apex:commandlink action="{!SaveMethod}" value="Save" reRender="acc"  rendered="{!(a.doEdit)}">
                             <apex:param Name="rowNumber"  Value="{!a.RowNo}"  assignTo="{!RowIndex}"/>
                        </apex:commandlink>
                    </apex:column>
                    <apex:column headerValue="FirstName" >
                        <apex:outputField value="{!a.con.FirstName}" rendered="{!NOT(a.doEdit)}" />
                        <apex:inputField value="{!a.con.FirstName}" rendered="{!(a.doEdit)}"/>
                     </apex:column>
                     <apex:column headerValue="LastName" >
                    <apex:outputField value="{!a.con.LastName}" rendered="{!NOT(a.doEdit)}" />
                     <apex:inputField value="{!a.con.LastName}" rendered="{!(a.doEdit)}"/>
                     </apex:column>
                    <apex:column headerValue="Phone">
                     <apex:outputField value="{!a.con.Phone}"  rendered="{!NOT(a.doEdit)}"/>
                     <apex:inputField value="{!a.con.Phone}" rendered="{!(a.doEdit)}"/>
                    </apex:column>
                    <apex:column headerValue="Title" > 
                     <apex:outputField value="{!a.con.Title}" rendered="{!NOT(a.doEdit)}"/>
                     <apex:inputField value="{!a.con.Title}"  rendered="{!(a.doEdit)}"/>
                    </apex:column>
                </apex:pageblocktable>
             </apex:pageBlockSection>
         </apex:pageblock>
     </apex:form>
</apex:page>
Thank You
The current value of a.isEdit is true. So NOT(a.isEdit) is  false???
and   the value of this {!NOT(a.isEdit)} ???
Reply me
Hi All,
I am not able to give any record Id, User Id In Recipient id field on Lightning flow notification action. What exactly It is. What we need to give on this field and what is Target Id.

Thanks
Mohan
Hi, can anyone please provide warehouse app in pdf ? I need for practice it. Appreciate your help.
Hey, is there any WhatsApp group available for salesforce developers? I want to list down it on https://wagrouplink.com

thank you.