• Big developers
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Before I begin, let me say that we're trying to avoid using JavaScript at all costs. We'd really like JavaScript to just be a last resort.

 

So, I have the following bit of code within a wrapper class in VisualForce:

 

                        <apex:selectList size="1">
                               <apex:selectOptions value="{!cond.PicklistValues}"/>
                        </apex:selectList>

 

PicklistValues is a function that returns a custom select list ( SelectOption[] ) for each object. The select list is different depending on one of the settings of the object.

 

Now, here's the question... How do I read off what the Picklist is set to in Apex? when the user hits save, I want to map their Picklist selection to an actual attribute.

 

Thanks for all the help!

So, I have a Rules object. Within the Rules object is an array of Condition objects. Each Condition Object has an associated Attribute_Definition object.

 

I'm trying to get the name of the Attribute_Definition object associated with each condition object.

 

                Rule_Condition__c[] condList = [select Attribute_Definition__c, Operator__c,
                                            Text_Value__c, Number_Value__c, IndexVar__c  
                                     from Rule_Condition__c where Configuration_Rule__c = :bmRule.Id];
                for (Integer j = 0; j<condList.size(); j++) {
                    if (('' +j).equals(s)) {
                        Attribute_Definition__c attrDef = new Attribute_Definition__c(condList[j].Attribute_Definition__c);
                        return attrDef.Name + ' OPERATOR val '; // RETURN THE ENGLISH
                        //return condList[j].Attribute_Definition__c + ' OPERATOR val '; // RETURN THE ENGLISH
                    }
                }
                
                return '!]error03 - ' + s;

 

 

Based on some brief testing, I know that s and j are firing true. If I remove the .Name tag, it'll pring out a01A0000001aR1vIAE

 

Error is this:

Error: Compile Error: Illegal assignment from Id to SOBJECT:Attribute_Definition__c at line 84 column 26

 

 

Thanks in advance

So, I have a Rules object. Within the Rules object is an array of Condition objects. Each Condition Object has an associated Attribute_Definition object.

 

I'm trying to get the name of the Attribute_Definition object associated with each condition object.

 

                Rule_Condition__c[] condList = [select Attribute_Definition__c, Operator__c,
                                            Text_Value__c, Number_Value__c, IndexVar__c  
                                     from Rule_Condition__c where Configuration_Rule__c = :bmRule.Id];
                for (Integer j = 0; j<condList.size(); j++) {
                    if (('' +j).equals(s)) {
                        Attribute_Definition__c attrDef = new Attribute_Definition__c(condList[j].Attribute_Definition__c);
                        return attrDef.Name + ' OPERATOR val '; // RETURN THE ENGLISH
                        //return condList[j].Attribute_Definition__c + ' OPERATOR val '; // RETURN THE ENGLISH
                    }
                }
                
                return '!]error03 - ' + s;

 

 

Based on some brief testing, I know that s and j are firing true. If I remove the .Name tag, it'll pring out a01A0000001aR1vIAE

 

Error is this:

Error: Compile Error: Illegal assignment from Id to SOBJECT:Attribute_Definition__c at line 84 column 26

 

 

Thanks in advance