• Yappy
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

How to design a template page feature that is similar to E-mail template and can retrieve value from variable.

 

That means how to convert a text field like {!Object__c.Field__c} to retrieve the variable value

 

The schema--------

Object 1

[Name] (Text)

[Field1]  (Text)

[Field2] (Text)

[Result] (Text)

 

The Field2 is a plain text datatype field, and when input {!Object__c.Field1__c} to the Field2 and save. The Result field will display the string of Field1.

  • July 28, 2012
  • Like
  • 0

Hello... In a StandardController extention I would like to guery fields from records selected in a related list view. So, if the user selects 3 records in the custom object I would like to retrieve their Ids and then perfrom a query based on that List. The List command in red fails with :  ' Illegal assignment from LIST:SObject to LIST:SOBJECT:' I've tried different variations of the List with ctl.getSelected but have quite got it right.

 

How do I structure the List so I can retrieve the selected Ids? Perhaps using List isn't the best way to hold the Ids so I am certainly open for suggestions on how to use 'getSelected'

 

Regards,

 

The Extension controller looks like this:

 

 

Public class ConAE {
      private final Asset_Entitlement__c ae;
      ApexPages.StandardSetController ctl = null;
      public ConAE(ApexPages.StandardSetController controller) {
           if ( ctl == null )
            {
               ctl = controller;
              
               List<Asset_Entitlement__c> aeId = ctl.getSelected();  //ERROR HERE
               System.debug('aeId is: ' +aeId);
              List<Asset_Entitlement__c> ae = [select id, Name, Parent_Opty_Aggregate__c, Opty_Aggregate__c from Asset_Entitlement__c where id = :ctl.getSelected()];// This is probably incorrect too
               System.debug('*******************m ae is:' + ae);
            }
           
           
          
      }