Whenever i click on lookup first time i am getting the contact id, But when i click on the same lookup and select any other contact then its throwing error. Please need some help

    <apex:pageblocktable value="{!lstWrapContactRoles}" var="cr" id="pbt" >
<apex:column headerValue="Contact">
<apex:inputfield value="{!cr.objConRole.Contact__c}" onchange="if(this.value){addfunc();}" id="conId"/> <!-- US 410 -->

<apex:actionfunction name="addfunc" action="{!addNew}" reRender="pbt" oncomplete="codeAddress();checkboxuse();"/>


 public void addNew() {
    contact objcontact = new contact();

1st debug gives the list of wrapper 2nd gives me the contact id.

  • I would suggest for consistent behaviour, send parameters from Actionfunction to Apex class using Apex:Param tag. – salesforcewithfunforce Feb 2 at 18:17

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.