• Mukul
  • NEWBIE
  • 200 Points
  • Member since 2009

  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 58
    Replies

Hi all,

 

I have a selectList and I am populating the values of the pick list by doing an AJAX call to a function in the controller. It all works fine but when i try to edit the values on the form and click on the submit button, it gives me an error "Value is not valid.". It forgets what the picklist values are when i click the submit button.

 

Any help is appreciated!!

 

Regards

Mukul

Hi all,

 

I have a dynamic query which returns me some field names 

 

public List<leadStore> getStoredLeadVals() { String myId = getRuleSetId(); String limitClause = ApexPages.currentPage().getParameters().get('lt'); System.debug('LIMIT VAL: ' + limitClause); String query; query = 'select lead_id__c, score__c, map__c '+ ' from lead_store__c ' + ' where ruleSetId__c =\'' + myId + '\' order by lead_id__c limit ' +limitClause; System.debug('Query:' + query); List<lead_store__c> storedLeads = Database.Query(query); String AllIds = ''; String AllIds1 = ''; for (lead_store__c lsc : storedLeads) { AllIds += '\'' + lsc.lead_id__c + '\','; } AllIds1 = AllIds.substring(0, AllIds.length()-1); String allFldNames = ''; // TODO: Get me the fieldNames from the scoringRule List. // Store it in a Map so that we see only right values Map<String, String> ruleNamesMap = new Map<String, String>(); List<ScoringRule__c> scoringFlds = [select rulename__c, Id from ScoringRule__c where RuleSetId__c =: myId]; for(ScoringRule__c s : scoringFlds) { ruleNamesMap.put(s.ruleName__c, s.Id); } Set <String> s = ruleNamesMap.keyset(); for (string si : s) { allFldNames += si + ','; } String lstQry = 'select id, '+ allFldNames + ' name from lead where id in ('+ allIds1+ ')'; System.debug('Lead qry: ' + lstQry); List<Lead> ldSto = Database.Query(lstQry); for (Lead l : ldSto) { for (lead_store__c lsc : storedLeads) { if (lsc.lead_id__c == String.valueOf(l.Id)) { lSt.add(new leadStore(lsc,l)); } } } return lSt; }

 

I want to display the field names taht i get in this list on my visualforce page.

 

Any idea on how can i do that? Any help is much appreciated!!

 

 

Regards

Mukul

 

 

Hello all,

 

I am trying to achieve this:

 

I have a param thats passed through URL. The param is essentially a lead's field name which is picklist e.g.  Industry and so on.

 

I want to get these picklist values in a list.

 

Here is how am i doing it:-

 

String lookup = ApexPages.currentPage().getParameters().get('lookup'); Schema.DescribeFieldResult F; sObject s = new Lead(); // Get the sObject describe result for the Account object Schema.DescribeSObjectResult r = Lead.sObjectType.getDescribe(); // TODO: Get it dynamically if (lookup == 'Industry') { F = Lead.Industry.getDescribe(); } if (lookup == 'leadsource') { F = Lead.leadsource.getDescribe(); } if (lookup == 'Productinterest__c') { F = Lead.Productinterest__c.getDescribe(); } if (lookup == 'status') { F = Lead.status.getDescribe(); } if (lookup == 'Salutation') { F = Lead.Salutation.getDescribe(); } if (lookup == 'rating') { F = Lead.rating.getDescribe(); }

 

 

 

 However i dont want to hardcode the lookup value in If statements. Is there any way i can do a getDescribe dynamically on the leads field?

 

like - Lead.getFieldName(Lookup).getDescribe() ?

 

Thanks much!

Regards

Mukul 

Hi all,

 

Is there any Salesforce Library that i can use to utilize this feature in Custom Reports? Like if i pick a field that is a picklist for e.g. Industry, it shows a little search box kind of button on the right hand side of the input field which on clicking opens a new window which gives all options of that field.

 

Any help is appreciated!!

 

Regards

Mukul 

I'm setting up a few custom tab splash pages to introduce and explain custom objects in an app. I created these splash pages as Visualforce pages and linked them up through the Home > Custom Links section and applied them to the respective tabs.

 

The Visualforce page displays as the splash page, but the "don't show this message again" and "continue" buttons do not appear at the bottom. These buttons do display if I use a URL or s-control type custom link.

 

Are those buttons not currently supported on Visualforce splash pages, or does something need to be configured to enable them?

I am missing something basic here and I don't know what it is.  How do you get the "Continue" and "Don't show me this again" buttons to be incorporated into the page?

 

I've created a VF Page (mostly stock html thus probably missing a apex section or something) and set it up as a Home tab Custom Link and then set it as my splash page for my custom tab. The page shows fine, but there are no buttons to dismiss the splash because there are no buttons.

 

So, what am I missing?  The only information I could dig up in Help, Apex Help and VF Help is the following:

 


 

Custom Tab Splash Page

You can add a splash page to any custom tabs in your app. Custom splash pages can include information about using the custom tab and custom object with links to additional information. They include a Continue button and a Don’t show me this again button.
Create the splash page for your app in the form of a custom link for the Home tab via Setup | Customize | Home | Custom Links. Custom links can be a URL to an HTML page or a custom s-control or Visualforce page. Create your custom splash page as a Home tab custom link and then add it as the splash page option to any custom tabs you plan to upload to AppExchange

I have a client who is experiencing the following error on a custom controller and we can't find any solutions. 

 

It's just a selectList with a value tied to a String.

 

"j_id0:theForm:j_id2:j_id13:j_id14:j_id16:mySolutionOption: Validation Error: Value is not valid"

 

Any ideas?

 

Thanks,

Jon

Folk,

 

I am having one dropdown on Visual Force page. Onchange event i am creating new options for this select using java script. And for this select option one String varible on controller.

 

VF tag:

  <apex:selectList onchange="javascript:change()" id="myselect" size="1" value="{!testSelect}">

<apex:selectOptions value="{!picklist}"></apex:selectOptions> </apex:selectList>

 JS Funtion:

 

<script language='JavaScript'>function change(){alert('{!$Component.form.block.myselect}'); tbox = document.getElementById('{!$Component.form.block.myselect}'); clearlistbox(tbox); for(i=0; i < 5 ; i++) { var no = new Option(); no.value = 'karthi' + i; no.text = 'karthi' + i; tbox[i] = no; } } function clearlistbox(lb){ for (var i=lb.options.length-1; i>=0; i--){ lb.options[i] = null; } lb.selectedIndex = -1; }</script>

 

 

 

Controller:

 

public List<SelectOption> getPicklist(){ List<SelectOption> options = new List<SelectOption>{new SelectOption('Silambarasan','Silambarasan'),new SelectOption('Velu','Velu'),new SelectOption('Banu','Banu')}; return options; } public String testSelect {set;get;}

 

On clicking the save button i am getting the following error:

 

j_id0:form:block:myselect: Validation Error: Value is not valid

 

 Full code for VF PAge:

 

<apex:page standardController="VbApp__c" extensions="VBAPPController" ><script language='JavaScript'>function change(){alert('{!$Component.form.block.myselect}'); tbox = document.getElementById('{!$Component.form.block.myselect}'); clearlistbox(tbox); for(i=0; i < 5 ; i++) { var no = new Option(); no.value = 'karthi' + i; no.text = 'karthi' + i; tbox[i] = no; } } function clearlistbox(lb){ for (var i=lb.options.length-1; i>=0; i--){ lb.options[i] = null; } lb.selectedIndex = -1; }</script> <apex:form ID="form"> <apex:sectionHeader title="Welcom to VB Application"/> <apex:pageBlock id="block"> <apex:pageBlockButtons location="both"> <apex:commandButton action="{!save}" value="Save"/> </apex:pageBlockButtons> Name:<apex:inputText value="{!vbname}"/><br/> PickList: <apex:selectList size="1" multiselect="false"> <apex:selectOptions value="{!picklist}"></apex:selectOptions> </apex:selectList> <br/> Myselect: <apex:selectList onchange="javascript:change()" id="myselect" size="1" value="{!testSelect}"> <apex:selectOptions value="{!picklist}"></apex:selectOptions> </apex:selectList> </apex:pageBlock> </apex:form></apex:page>

 and 

 

Example for page shows

 

After changed the dromdown. I am trying to save on this time I am gettingerror "j_id0:form:block:myselect: Validation Error: Value is not valid"

Hello. I have a custom VF component which contains an <apex:selectList> component, as follows:

 

<apex:component controller="picklistController" id="compPickList">
<apex:attribute name="SystemEntity" description="" type="String" required="true" default="Account" assignTo="{!systemObject}"></apex:attribute>
<apex:attribute name="picklistField" description="" type="String" required="true" default="Type" assignTo="{!picklist_Field}"></apex:attribute>
<apex:attribute name="value" description="" type="String[]" required="true"></apex:attribute>
<apex:selectList id="ddlPickList" value="{!value}" multiselect="true" size="4">
<apex:selectOptions value="{!pickListOptions}"></apex:selectOptions>
</apex:selectList>
</apex:component>

 

The component's controller is obvious, so am skipping it for now.

 

The component acceps two attributes which it uses to populate the selectList options. I am using this component in a page and it works fine, i.e. am able to retrieve the selected values from the component into the page as long as am working with the pre-populated options, the code is as follows:

 

 

<apex:page controller="sampleCon" id="myPage"> <apex:form id="myForm"> <c:sObjectFieldPicklistComponent id="accountPicklist" value="{!accountIndustry}" picklistField="Ownership" systemEntity="Account" /> <apex:commandButton value="Test" action="{!SaveValues}" /> </apex:form> </apex:page>

 

I am again skipping the page controller code as it's obvious, but do let me know if you want to see it.

 

Now, the problem starts when I add dynamic <option> to this multi-select picklist through JavaScript, am able to add them in the browser on the client side, but when I click on the command button to submit the user selected values, the previously working code breaks, the values are not submitted, the execution never enters the action function (in this case - SaveValues()), and I get a message in the System Log window:

 

myPage:myForm:accountPicklist:compPickList:ddlPickList: Validation Error: Value is not valid

 

Any idea what's happening here? I am suspecting that the system (not me) is checking the submitted values against the viewstate and is throwing an error somewhere which I am unable to trap and trace.

 

Can someone please explain this behavior, and if possible, a solution to get this thing going?

 

Thanks in advance!

Ajay

I have a new native app on the app exchange and a professional edition customer tried to install it. They got a bunch of errors like this:

 

Missing feature

Apex Classes

Installing this package requires the following feature and its associated permissions: Apex Classes

 

 

My app uses a few custom classes, objects, and a visualforce page. I was told that even a pro edition can install an app that uses custom apex classes. 

 

Does anyone have ideas of how to dig into this further?

 

Thanks!

Hi folks - I've got mixed answers on this one. If I create an AppExchange application that uses Apex Code as part of it, can I install that application into a customer's professional edition org?

If not, that would severely reduce the chance that we could actually use Apex Code since it would mean that we couldn't sell to a big chunk of customers.

Ryan