Skip to main content
edited body
Source Link
Eric
  • 54.4k
  • 11
  • 104
  • 196

Without seeing how you are doing things (and assuming you may be using the same controller) your options would be:

Using a dynamic query in the controller:

  1. use apexPages.currentPage().getURL() and determine the page
  2. Based on the page set the where clause of the query

or

  1. Use a URL parameter say 'filterOn' as set it when calling the page:

either way you get the idea from the code below.

public string filterOn;

public className(){
   filterOn = apexPages.currentPage().getParameters().get('filterOn');
}

public DATATYPE[] getmyMethod(){
    String qry = 'Select xxx from xxx ';
    if(!string.isBlnak(filterOn)
       tryqry += ' Where FILENAME = :filterOn';

    return database.query(tryqry);
}

Note you will get a much better and more direct answer if you post your code :)

Without seeing how you are doing things (and assuming you may be using the same controller) your options would be:

Using a dynamic query in the controller:

  1. use apexPages.currentPage().getURL() and determine the page
  2. Based on the page set the where clause of the query

or

  1. Use a URL parameter say 'filterOn' as set it when calling the page:

either way you get the idea from the code below.

public string filterOn;

public className(){
   filterOn = apexPages.currentPage().getParameters().get('filterOn');
}

public DATATYPE[] getmyMethod(){
    String qry = 'Select xxx from xxx ';
    if(!string.isBlnak(filterOn)
       try += ' Where FILENAME = :filterOn';

    return database.query(try);
}

Note you will get a much better and more direct answer if you post your code :)

Without seeing how you are doing things (and assuming you may be using the same controller) your options would be:

Using a dynamic query in the controller:

  1. use apexPages.currentPage().getURL() and determine the page
  2. Based on the page set the where clause of the query

or

  1. Use a URL parameter say 'filterOn' as set it when calling the page:

either way you get the idea from the code below.

public string filterOn;

public className(){
   filterOn = apexPages.currentPage().getParameters().get('filterOn');
}

public DATATYPE[] getmyMethod(){
    String qry = 'Select xxx from xxx ';
    if(!string.isBlnak(filterOn)
       qry += ' Where FILENAME = :filterOn';

    return database.query(qry);
}

Note you will get a much better and more direct answer if you post your code :)

Source Link
Eric
  • 54.4k
  • 11
  • 104
  • 196

Without seeing how you are doing things (and assuming you may be using the same controller) your options would be:

Using a dynamic query in the controller:

  1. use apexPages.currentPage().getURL() and determine the page
  2. Based on the page set the where clause of the query

or

  1. Use a URL parameter say 'filterOn' as set it when calling the page:

either way you get the idea from the code below.

public string filterOn;

public className(){
   filterOn = apexPages.currentPage().getParameters().get('filterOn');
}

public DATATYPE[] getmyMethod(){
    String qry = 'Select xxx from xxx ';
    if(!string.isBlnak(filterOn)
       try += ' Where FILENAME = :filterOn';

    return database.query(try);
}

Note you will get a much better and more direct answer if you post your code :)