• Sami Ullah Azam
  • 0 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
  • 4
I am using Jepson Theme in Salesforce community, and I want to have 4 topics where users can 'Ask a question. Ask a Question is showing 4 topics in the 'Post to' List, but whenever a user goes to another topic and clicks on Ask a Button, it is automatically adding that value in the Post to the picklist.
I want to restrict 'Post To' by showing only 4. How can I do that?

Can I restrict Post to Picklist?
I have a method that returns nothing and take no parameters. It just take values from VF page and query the Object to retrieve results and set them to variables. How can I write test case for this functions.?
Please Help!!
I am haing two picklists and show thier values using javascript. When I select first picklist1 value the below picklist2 values got populated. This works fine whenever I changed picklist1 value to something else that cause the picklist2 value to --None-- (Unique Values shown for each Picklist1 Value).
I got Internal error whenever I changed picklist1 value that does not cause the picklist2 value to --None--. How can I resolve that error.
How can I set picklist2 Value to --None-- everytime onChange of Picklist1 or is there any other solution.
<!--     VF-->
           <apex:inputField id="filterModel" label="Valve Model" value="{!c.level__c}"  onchange="manageFilters()"/>
     <apex:inputField id="filterValveType" label="Valve Type" value="{!c.level2__c}"  onchange="update(); manageFilters();" >

<!--                JAVASCRIPT    -->

    function manageFilters() {
        var valveModelObj = document.getElementById('VWValveSearch:VWSiteTemplate:frm1:filterModel');
var valveModel = valveModelObj.options[valveModelObj.selectedIndex].value;
        var valveTypeObj = document.getElementById('VWValveSearch:VWSiteTemplate:frm1:filterValveType');
        var valveType = valveTypeObj.options[valveTypeObj.selectedIndex].value;
            //manage Valve Types
            var valveTypesAr = new Array();
            valveTypesAr.choose = function(selections) { 
                var arr = new Array();
                for (index = 0; index < selections.length; ++index) {
                return arr;
            valveTypesAr.addItem = function(item) { 
                var newValue = new Object();
                newValue.label = item;
                newValue.value = item;

            valveTypesAr.addItem('--None--');       //0
            valveTypesAr.addItem('20');   //1
            valveTypesAr.addItem('22');   //2
            valveTypesAr.addItem('23');   //3
            valveTypesAr.addItem('28');   //4
            valveTypesAr.addItem('30');   //5
            valveTypesAr.addItem('32');   //6
            valveTypesAr.addItem('40');   //7
            valveTypesAr.addItem('48');   //8
            valveTypesAr.addItem('50');   //9

            if (valveModel == 'AMA' ) {
                  var    vals = valveTypesAr.choose([0,9]);
              setPickVals("#VWValveSearch\\:VWSiteTemplate\\:frm1\\:filterValveType", vals);
                        if (valveModel == 'AMB' ) {
                    var     vals = valveTypesAr.choose([0,6,1,4,5]);
              setPickVals("#VWValveSearch\\:VWSiteTemplate\\:frm1\\:filterValveType",vals );
               if (valveModel == 'AMC' ) {
                 var vals = valveTypesAr.choose([0,1,2,3,5,6]);

                setSelectedPickVal(valveTypeObj, valveType);
                valveType = valveTypeObj.options[valveTypeObj.selectedIndex].value;

Please Help How Can I set the Picklist2 value to --None-- and show the remaining values onClick.

The Porblem occurs on the update() which is basically action:Function and pass the selected values to controoler side.
I am having 5 picklists in the visualforce page. The first picklist have 2 values (e.g Product 1, Product 2). When the product 1 value selected then it will show only 2 remaining picklists and thier values but when product 2 is selected it should show remaining 4 picklist fields how can I do that. Please help. My Vf Code is.
<apex:page StandardController="Account" extensions="accpickvalues">
    <apex:form >
<apex:pageBlock mode="edit">
        <apex:message id="msg" />
        <apex:pageBlockSection title="Select Model Attributes" >
            <apex:inputField value="{!c.Valve_Series__c}"/>
            <apex:inputField value="{!c.Model__c}"/>
              <apex:inputField value="{!c.Valve_Type__c}"/>
            <apex:inputField value="{!c.Body_Size__c}"/>
            <apex:inputField value="{!c.Body_Material__c}"/>

I have a method that returns nothing and take no parameters. It just take values from VF page and query the Object to retrieve results and set them to variables. How can I write test case for this functions.?
Please Help!!
Hello Everyone,
I am getting SOQL exception whenever I will insert records more than 1000. Now the scenario is when all the records inserted it only executes 3 SOQL statements but then Trigger fired (Before Insert,After Insert,Before Update,After Update) in a batch of 200. 

The same code of trigger repeats for each 200 batch of records and then the SOQL limits increased to 100 in the last batch and then ultimately failed.

The issue is it all executed in one apex transaction.(Apex Transaction Limit 100)

NOTE: I cannot change the functionality inside the trigger.

Is there any solution for this sceanrio?

Thanks in advance.