0

Iam using thsi generic code from this post for Opportunity object instead Account object.

It works fine untill one tweak I want to do with that.

This code allows me to pass values from visual force page to lookup page for account.

but what I want is I also want selected value of type from the same page to go with that. Because using that value I want to filter the search result.

What I am trying is as below

Inside this function ( Be informed that I am doing it for Opportunity but only using Account here in the question as the reference to the blog code.)

/* Visual Force Edit Page */

if(txtId.indexOf('Account') > -1 ){
        baseURL = baseURL + "&projId=" + document.getElementById('page:frm:pb:pbsLeaseActionInfo:pbsTempSection:pbsiProject:OppProject_lkid').value; // I am getting this value fine on lookup page
        baseURL = baseURL + "&fieldId_2=(page:frm:pb:pbsLeaseActionInfo:pbsTempSection:pbsiLeaseType:OppLeasetype).value"; // I don't get this Value
    isCustomLookup = true;

     // where oppleasetype is id of picklist field on the same page. 

  }

/* Controller for Lookup Page */

Here I am storing passed values in string

// For Project ID

 projectId = string.escapeSingleQuotes(ApexPages.currentPage().getParameters().get('projId')); // I am getting this fine in debug. 
  system.debug('I am in ProjectID'+ projectId);

//for OppLeaseType

LeaseType = string.escapeSingleQuotes(System.currentPageReference().getParameters().get('fieldId_2'));
  system.debug('Lease Type' + LeaseType); // --> I get this as debug output page:frm:pb:pbsLeaseActionInfo:pbsTempSection:pbsiLeaseType:OppLeasetype

I need urgent help with this. Someone can please help me identify the issue.

1 Answer 1

0

I think this is a minor mistake

if(txtId.indexOf('Account') > -1 ){
        baseURL = baseURL + "&projId=" + document.getElementById('page:frm:pb:pbsLeaseActionInfo:pbsTempSection:pbsiProject:OppProject_lkid').value;
        baseURL = baseURL + "&fieldId_2="+document.getElementById('page:frm:pb:pbsLeaseActionInfo:pbsTempSection:pbsiLeaseType:OppLeasetype').value;
    isCustomLookup = true;

     // where oppleasetype is id of picklist field on the same page. 

  }

You missed document.getElementById in the third line. I hope thats what you intended

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .