• Miroslav Smukov
  • NEWBIE
  • 150 Points
  • Member since 2015
  • Salesforce Developer


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

i have a two dimensinal array populated but need help on how to iterate thru it:

List<List<string>> Wdays = new List<list<string>>();
List<String> Mnth = new List<String>();    

Mnth.add('JAN'); Mnth.add(string.valueof(jan));
Wdays.add(mnth);

I wish to know how to loop thru the two dimensional list to display the values...any help please?
  • October 14, 2015
  • Like
  • 0
Hi

I'm using Jquery to handle the checkbox event to enable and disable the fields in visualforce page. Now i want to disable the fields by default when the edit page is loaded. how can i acheive this by using jquery?
 
my code is below:

<apex:page standardController="Product2" tabStyle="Product2" extensions="ProductSave" >
<apex:sectionHeader title="Product Edit" subtitle="{!Product2.name}"/>
<font style="font-family: Arial; font-size: 10pt;">Enter product details. Mark products as Active if you want them to be added to price books, opportunities, or quotes. </font> <br/><br/>
<apex:includescript value="{!URLFOR($Resource.jquery, 'js/jquery-1.11.3.js')}" />
<script>
       initialize();
</script>
<script>
function initialize(){
alert("r");
}

function handlefld(input, textid){   
    if (!input.checked){
      jQuery( 'input[id$=prodjan_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodfeb_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodmar_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodapr_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodmay_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodjun_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodjul_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodaug_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodsep_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodoct_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodnov_c]' ).prop('disabled', true);
      jQuery( 'input[id$=proddec_c]' ).prop('disabled', true);
      }
    else{
      jQuery( 'input[id$=prodjan_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodfeb_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodmar_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodapr_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodmay_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodjun_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodjul_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodaug_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodsep_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodoct_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodnov_c]' ).prop('disabled', false);
      jQuery( 'input[id$=proddec_c]' ).prop('disabled', false);
      }
}
</script>
<apex:form >
<body>
    <apex:pageBlock title="Product Edit" mode="edit"  >
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save" />
            <apex:commandButton action="{!Cancel}" value="Cancel"/>
        </apex:pageBlockButtons>
        <apex:pageblocksection title="Product Information" columns="2">
            <apex:inputfield value="{!Product2.name}" id="prodname"/> 
            <apex:inputfield value="{!Product2.Family}" id="prodfamily"/>
            <apex:inputfield value="{!Product2.ProductCode}" id="prodcode"/>
            <apex:inputfield value="{!Product2.IsActive}" id="prodisactive"/> 
            <apex:inputfield value="{!Product2.Opportunity__c}" id="prodoppr" onclick="select()"/>  
            <apex:outputText > </apex:outputText>
            <apex:inputfield value="{!Product2.Description}" id="proddescr" style="width:500px ; height:100px"  />            
        </apex:pageblocksection>
         <apex:pageblocksection title="Weightage" columns="4">   
            <input id="edit" type="checkbox" onclick="handlefld(this,'{!$Component.prodfeb_c}');"/>
            <label for="edit">Edit ?</label>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>                        
            <apex:inputfield value="{!Product2.January__c}" id="prodjan_c"/>
            <apex:inputfield value="{!Product2.February__c}" id="prodfeb_c"/>
            <apex:inputfield value="{!Product2.March__c}" id="prodmar_c"/>
            <apex:inputfield value="{!Product2.April__c}" id="prodapr_c"/> 
            <apex:inputfield value="{!Product2.May__c}" id="prodmay_c"/> 
            <apex:inputfield value="{!Product2.June__c}" id="prodjun_c"/>  
            <apex:inputfield value="{!Product2.July__c}" id="prodjul_c"/>
            <apex:inputfield value="{!Product2.August__c}" id="prodaug_c"/>
            <apex:inputfield value="{!Product2.September__c}" id="prodsep_c"/>
            <apex:inputfield value="{!Product2.October__c}" id="prodoct_c"/> 
            <apex:inputfield value="{!Product2.November__c}" id="prodnov_c"/> 
            <apex:inputfield value="{!Product2.December__c}" id="proddec_c"/>              
            <apex:outputText > </apex:outputText>         
        </apex:pageblocksection>        
    </apex:pageBlock>
</body>
</apex:form>
</apex:page>
 
  • October 14, 2015
  • Like
  • 0
Hi, 
    I have two objects 'A' & 'B' and a VF page. A field from object 'A' is a lookup in object 'B'. On selecting a lookup field of 'A', the values corresponding to that field have to be auto populated in my VF page. But it was not happening. 
Can anyone please explain why?

Note: VF page is of object 'B'. Iam using Lightning Experience.

Thanks in advance.
I've started dabling in Lightning Components and worked through a tutorial last year and have done one of the trailheads a few days.  So I know how to code basic Lightning components and apps.  And I see in the metadata that these become AuraDefinitionBundles.  I also so an example of some code where a bit of JS is added to an empty VF page and that always a Lightning Component to be spun up inside a VF page.

What I want to do is take an exist VF page that is exposed to the internet as a SF "Sites" application and port it to Lightning.  What I included in the prior paragaph leads me to believe the page is codable.  Here's what I don't know.  When a Sites application is configured, you have to tell it what it has access to-- VF pages, Apex controllers, objects and fields, etc.  I don't know how you would give it access to the Aura bundle.  (Unless it's totally implicit and you don't have to and it automatically gets acces.)

Can anyone address the question of how to configure and deploy Sites application that includes a VF page that spins up an Lightning Component?
 
Hi
    My Scenrio is i m having one picklist field with values are X,Y,Z and W and one dependent text field is there.whenever i was select the W value in the picklist ,text field was populating after that i entered some text and saving the page upto its fine.The problem is whenever i was going to EDIT the page the picklist field value i was changing from W to X,the test field value didint erase. Thetest field value should come blank.
  
 THANKS
RANGA
I want to restrict the following characters ‘ “ , * % @ and if possible remove any extra spaces at the end of the field. I've found validation rules for allowing characters but none for just restricting, I don't really want to have to input every single charachter other than those listed above. (infact when I try to do that I get syntax errors). Any guidence would greatly be appreciated.
I have a VF page with a commandbutton. I am trying to get the page to refresh once the commandbutton is clicked. The code below does what it is supposed to do, but the page does not refresh. Does anyone know how I can do this?
<apex:commandButton action="{!approve}" oncomplete="window.opener.location.refresh();" styleClass="buttonStyle" style="background:#99C299; font-size:16pt; font-family:arial;" value="Submit for Final Approval"/>
Hi

i have a two dimensinal array populated but need help on how to iterate thru it:

List<List<string>> Wdays = new List<list<string>>();
List<String> Mnth = new List<String>();    

Mnth.add('JAN'); Mnth.add(string.valueof(jan));
Wdays.add(mnth);

I wish to know how to loop thru the two dimensional list to display the values...any help please?
  • October 14, 2015
  • Like
  • 0
Hi

I'm using Jquery to handle the checkbox event to enable and disable the fields in visualforce page. Now i want to disable the fields by default when the edit page is loaded. how can i acheive this by using jquery?
 
my code is below:

<apex:page standardController="Product2" tabStyle="Product2" extensions="ProductSave" >
<apex:sectionHeader title="Product Edit" subtitle="{!Product2.name}"/>
<font style="font-family: Arial; font-size: 10pt;">Enter product details. Mark products as Active if you want them to be added to price books, opportunities, or quotes. </font> <br/><br/>
<apex:includescript value="{!URLFOR($Resource.jquery, 'js/jquery-1.11.3.js')}" />
<script>
       initialize();
</script>
<script>
function initialize(){
alert("r");
}

function handlefld(input, textid){   
    if (!input.checked){
      jQuery( 'input[id$=prodjan_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodfeb_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodmar_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodapr_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodmay_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodjun_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodjul_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodaug_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodsep_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodoct_c]' ).prop('disabled', true);
      jQuery( 'input[id$=prodnov_c]' ).prop('disabled', true);
      jQuery( 'input[id$=proddec_c]' ).prop('disabled', true);
      }
    else{
      jQuery( 'input[id$=prodjan_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodfeb_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodmar_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodapr_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodmay_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodjun_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodjul_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodaug_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodsep_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodoct_c]' ).prop('disabled', false);
      jQuery( 'input[id$=prodnov_c]' ).prop('disabled', false);
      jQuery( 'input[id$=proddec_c]' ).prop('disabled', false);
      }
}
</script>
<apex:form >
<body>
    <apex:pageBlock title="Product Edit" mode="edit"  >
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save" />
            <apex:commandButton action="{!Cancel}" value="Cancel"/>
        </apex:pageBlockButtons>
        <apex:pageblocksection title="Product Information" columns="2">
            <apex:inputfield value="{!Product2.name}" id="prodname"/> 
            <apex:inputfield value="{!Product2.Family}" id="prodfamily"/>
            <apex:inputfield value="{!Product2.ProductCode}" id="prodcode"/>
            <apex:inputfield value="{!Product2.IsActive}" id="prodisactive"/> 
            <apex:inputfield value="{!Product2.Opportunity__c}" id="prodoppr" onclick="select()"/>  
            <apex:outputText > </apex:outputText>
            <apex:inputfield value="{!Product2.Description}" id="proddescr" style="width:500px ; height:100px"  />            
        </apex:pageblocksection>
         <apex:pageblocksection title="Weightage" columns="4">   
            <input id="edit" type="checkbox" onclick="handlefld(this,'{!$Component.prodfeb_c}');"/>
            <label for="edit">Edit ?</label>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>                        
            <apex:inputfield value="{!Product2.January__c}" id="prodjan_c"/>
            <apex:inputfield value="{!Product2.February__c}" id="prodfeb_c"/>
            <apex:inputfield value="{!Product2.March__c}" id="prodmar_c"/>
            <apex:inputfield value="{!Product2.April__c}" id="prodapr_c"/> 
            <apex:inputfield value="{!Product2.May__c}" id="prodmay_c"/> 
            <apex:inputfield value="{!Product2.June__c}" id="prodjun_c"/>  
            <apex:inputfield value="{!Product2.July__c}" id="prodjul_c"/>
            <apex:inputfield value="{!Product2.August__c}" id="prodaug_c"/>
            <apex:inputfield value="{!Product2.September__c}" id="prodsep_c"/>
            <apex:inputfield value="{!Product2.October__c}" id="prodoct_c"/> 
            <apex:inputfield value="{!Product2.November__c}" id="prodnov_c"/> 
            <apex:inputfield value="{!Product2.December__c}" id="proddec_c"/>              
            <apex:outputText > </apex:outputText>         
        </apex:pageblocksection>        
    </apex:pageBlock>
</body>
</apex:form>
</apex:page>
 
  • October 14, 2015
  • Like
  • 0
Error
Step not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.EmailException: SendEmail failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Either the plain text body or html body must be supplied.: []
Note: you may run into errors if you've skipped previous steps.


 
Hello!

I'm hoping someone can help. I've got 0% code coverage in a production org I'm working on but the only tests failing 7/363 are from managed packages.

Is there anything else that can cause the code coverage issue?

Thanks!

 
  • January 29, 2015
  • Like
  • 0

Hi All,

 

I am having really tough time dealing with Salesforce Test classes.

 

My first problem is when I write a test class, then the class I am testing does not show up in Overall Code Coverage.

 

Then when I click on test the class does show up in Class Code Coverage and show me the coverage % but when I click on it it opens without the colors telling me which line is covered and which is not.

 

 

Please let me know how to resolve this.

 

Thanks.

In designing an SF Object and deciding on a practical length for a text field - I would like to understand the associated representation in Salesforce's underlying database.  

 

Can someone shed light ( and preferably direct me to the correct document ) on whether I'm specifying the length on a fixed length field or a varchar?

 

Thanks,

 

Raf

  • August 24, 2009
  • Like
  • 1