• SKSANJAY
  • NEWBIE
  • 160 Points
  • Member since 2018
  • Salesforce Senior Developer
  • Accenture


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

I am trying to remove white space from a VF email template created from line-breaks associated with conditional IF statements. If all the conditions are meet, the email spacing is fine. However, if none of the conditions are meet, the email renders with a large white space. Is there a better way to render the data?

Here is my IF Statement

{!IF(relatedTo.hardcover_formula__c == 'Yes',A, NULL)} <br /><br />
{!IF(relatedTo.hardcover_formula__c == 'Yes','B NULL)} <br />
{!IF(relatedTo.ship_to_formula__c == 'Other', C, NULL)}<br /><br /><br />

Thanks in advance!

  • April 25, 2018
  • Like
  • 0
Someone can help?
I have a pageBlockSectionItem to display a selectList and i should render another pageBlockSectionItem if some option of the list is selected("Dinâmica").
*Mudanca variable in visualforce page is the realizaMudanca in the controller

This is the pageBlockSectionItem of the list:
<apex:pageBlockSectionItem>
                                <apex:outputLabel value="Nova Fase do Candidato"/>
                                    <apex:selectList value="{!NovaFaseCandidato}" multiselect="false" size="1">
                                        <apex:actionSupport event="onchange" action="{!Change}" reRender="{!IF({Mudanca, "Blockteste", "")}"/>
                                        <apex:selectOptions value="{!FasesCandidato}"/>
                                    </apex:selectList>
                                    
</apex:pageBlockSectionItem>
*this is giving a syntax error, I don't know why

This is the function that i called in the controller
public PageReference Change() {

		if(NovaFaseCandidato == 'Dinâmica')
		{
			realizaMudanca = true;
			system.debug('true');
		}
		else
		{
			realizaMudanca = false;
			system.debug('false');
		}
		return null;
	}

This is the pageBlockSectionItem that i should render if "Dinâmica" is the option selected
 
</apex:pageBlockSectionItem>
                            
                            <apex:pageBlockSectionItem id="Blockteste" rendered = "{!Mudanca}">
                                <apex:outputLabel value="Selecione o painel"/>
                                    <apex:selectList value="{!DataHoraPainel}" styleClass="flutua-direita" multiselect="false" size="1">
                                        <apex:selectOptions value="{!QualPainel}"/>
                                    </apex:selectList>
                                    
                            </apex:pageBlockSectionItem>


 
If type 15/10/95 it should change to 15/10/1995 where as 1/1/10 it should change to  1/1/2010

Hi Everyone,

I am currently facing an issue on a VF page I've created which uses a Javascript to count number of characters on a inputtextarea as users type in. This works very well but with the new requirements to improve the VF page wherein there has to be different character limit per country I was force to use render function. Before the section where the textarea field is located the counter works well but right after it gets rerendered the javascript stopped working.

I've inspected the page before the render and after the render, and this part of the code went missing after rerendering.
<div class="jqEasyCounterMsg" style="font-size: 12px; font-family: Arial; color: rgb(0, 0, 0); text-align: right; width: 600px; opacity: 0;">Characters: 0/210</div>

Thank you in advance for any inputs!

Hi,

I am using the below very basic VF code.

I would like to add a banner at the top and bottom in a colour of my choice that also included a reference to a field, for example Account.Name.

I would also like to change to the background colour to a colour of my choice.

Is this possible?



<apex:page standardController="Account" sidebar="false" showheader="false" readOnly="true" >

<apex:form >
<table width="100%">

  <tr>
        <td style="width:40%"><apex:outputLabel style="vertical-align:middle; text-align:center;font-family:calibri;font-size:50px;color:#004489;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <apex:outputField label="AccNAme" value="{!Account.Group_View_Account_Name__c}" /></apex:outputLabel></td>        
</tr>
<tr>
        <td style="width:40%"><apex:outputLabel style="vertical-align:top; text-align:centre;font-family:calibri;font-size:20px;color:#ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <apex:outputField label="AccNAme" value="{!Account.Powered_by_Salesforce_com__c}" /></apex:outputLabel></td>
</tr>  
</table>
</apex:form>

<apex:detail relatedList="false"/>
<apex:relatedList list="Group_Relationships__r"/>
<apex:relatedList list="Activities__r"/>
<apex:relatedList list="Opportunities1__r"/>
<apex:relatedList list="Threats1__r"/>
<apex:relatedList list="Cases__r"/>



</apex:page>

 
Hi Everyone,

i am having an issue where the edit button has been overridden by custom lightning component and there we are using force:recordEdit to load the standard edit layout. As I am passing the record id, when user clicks on change record type -> it shows modal for record type selection and then after selection it navigates to custom edit lightning component and loads the record with old record type. I am getting the new recordtype id in URL but its not updating the force:recordEdit loaded record with newly selected record type.

Thanks,
Sanjay Kumar

I am trying to remove white space from a VF email template created from line-breaks associated with conditional IF statements. If all the conditions are meet, the email spacing is fine. However, if none of the conditions are meet, the email renders with a large white space. Is there a better way to render the data?

Here is my IF Statement

{!IF(relatedTo.hardcover_formula__c == 'Yes',A, NULL)} <br /><br />
{!IF(relatedTo.hardcover_formula__c == 'Yes','B NULL)} <br />
{!IF(relatedTo.ship_to_formula__c == 'Other', C, NULL)}<br /><br /><br />

Thanks in advance!

  • April 25, 2018
  • Like
  • 0
I am re-styling existing VF pages. I have an inputField that is rendered as multiSelectPickList. I tried using 'slds-dueling-list', but I am not sure the code is right. There is no example code on the inputField with SLDS style class on lightning design system site. Does anyone has sample code? I get multiple Left and Right arrow buttons as shown below.
User-added image
<aura:iteration items="{! v.fields }" var="field">
           
            <div class="slds-size_5-of-12">
                <lightning:input aura:id="idName"   label="{!field.Label}"  required="{!field.DBRequired}"  type="{!field.Type}" class="slds-p-top_small slds-m-top_medium" />
            </div>
             <div class="slds-size_1-of-12"></div>
            </aura:iteration>
and i want  ,whatever i type in input box of firstname,lastname or whatever  the value of that field should be store in attribute of type Contact otherwise i want all the data as Json in lightning component  Js controller  Please help me to solve this...
Is it possible to build both a partner community and a customer community from scratch without the need for purchasing licenses? We have a client who could have up to 3000 customers and wants to explore a custom build partner / customer community. 
  • March 18, 2018
  • Like
  • 0

Hi All,
I have VF page with table like this:
 

<apex:page standardController="Account" extensions="ActivityController" > 
<apex:form >
        <apex:pageblock title="Activity" >
            <apex:pageBlockTable value="{!AllRecords}" var="rec">
                <apex:column value="{!rec.Type}" headerValue="Type"/>
                <apex:column  value="{!rec.Subj}" headerValue="Subject"/>
                </apex:column>
                <apex:column value="{!rec.description}" headerValue="Description"/>
            </apex:pageBlockTable>            
        </apex:pageblock>
    </apex:form>
</apex:page>
The description field is a text field and it's too long. So I need to add "Show more/ Show less" button for this in table. Can someone pls suggest the best way to do this?
Thanks!
For Example 
If I have 2 attributes as like below defined with same type as 'Account' or any in a lightning component
<aura:attribute name="retainedCustomer" type="Account" access="public"/>
    <aura:attribute name="customerDetails" type="Account" access="public"/>
The reason i defined 2 same is,
Account will be displayed as the form with firstname and last name and mobile where allowed to view and edit. When operation for edit and in the middle of editing clicked on cancel button, so wanted to display back form with original values, so delcared one more attribute as Account which has been set on Init as the copy of customerdetails.

But thought form elements refers to customerdetail attribute from the component definition, retainCustomer attributes also reflecting to same values as CustomerDetails. Which is all because of same type. I experienced this problem with custom type attributes but its now look like the general defect from Lightning

Anyone experienced same problem oand any thoughts on it.

For more clear

This is what I was doing at Componet controllers
doInit : function(component, event, helper) {
        component.set("v.retainedCustomer",component.get("v.customerDetails"));
     },
when clicked on Cancel
 
component.set("v.customerDetails",component.get("v.retainedCustomer"));

but no luck seems like for work around i need to retain them indivudually to a colelction instead as same type Account.

Thanks
sri


 
Hi everyone,

I have a picklist field called Engagement_model__c in Opportunity. it has the values
1.Fixed Bid
2.Time&Material
3.Fix Capacity

If 1 is selected it should display some 5 custom fields and values should be entered, and record should be saved.
 I wrote below  code in Debuglog window:
ScheduledApex_2 sa=new ScheduledApex_2();
String s='0 22 6 ? * *';
String myjob=System.schedule('Fifth', s, sa);
CronTrigger ct=[SELECT Status,TimesTriggered,NextFireTime From CronTrigger Where Id=:myjob];
when I want to know the  when it triggered and status for the first time it shceduled then only we are able to check by using above.
When I want to know the status once it is started and completed and number of times triggered, am unable do that.
for example: I shceduled and it ran for 2 times,
so when I am using above logic it is saying it is already shceduled.I am not getting any result.
I just want to know like status of myjob,  2 times triggered, and next schedule date is so and so etc 
could anyone please help me in this?
 
Hi,

i have created a component having three checkboxes - course 1 , course 2 and course 3.
also i have a button to select all courses.
My requirement is running a soql query and displaying the count of records for each course type ( the ones which are selected)

So far i have written this code:
<aura:component access="global">
    <aura:attribute name="selected" type="List" default="[]"/>
    <aura:attribute name="options" type="List" default="[{'label': 'Course 1', 'value': 'option1'}, {'label': 'Course 2', 'value': 'option2'},{'label': 'Course 3', 'value': 'option3'}]"/>
    <lightning:checkboxGroup
        aura:id="mygroup"
        name="checkboxGroup"
        label="Checkbox Group"
        options="{!v.options}"
        value="{!v.selected}"
        onchange="{!c.handleChange}"
        required="true" />

    <br/><br/>
    <lightning:button variant="brand" label="Select All" onclick="{!c.selectAll}"/> 
</aura:component>

SelectCheckBox.js
({
    selectAll : function(component, event, helper) {
        component.set("v.selected",['option1','option2','option3']);
    },

    handleChange : function(component, event, helper) {

    },
})


Can you all please give a sample code to proceed forward for the requirement?

Thanks​
  • March 15, 2018
  • Like
  • 0
Someone can help?
I have a pageBlockSectionItem to display a selectList and i should render another pageBlockSectionItem if some option of the list is selected("Dinâmica").
*Mudanca variable in visualforce page is the realizaMudanca in the controller

This is the pageBlockSectionItem of the list:
<apex:pageBlockSectionItem>
                                <apex:outputLabel value="Nova Fase do Candidato"/>
                                    <apex:selectList value="{!NovaFaseCandidato}" multiselect="false" size="1">
                                        <apex:actionSupport event="onchange" action="{!Change}" reRender="{!IF({Mudanca, "Blockteste", "")}"/>
                                        <apex:selectOptions value="{!FasesCandidato}"/>
                                    </apex:selectList>
                                    
</apex:pageBlockSectionItem>
*this is giving a syntax error, I don't know why

This is the function that i called in the controller
public PageReference Change() {

		if(NovaFaseCandidato == 'Dinâmica')
		{
			realizaMudanca = true;
			system.debug('true');
		}
		else
		{
			realizaMudanca = false;
			system.debug('false');
		}
		return null;
	}

This is the pageBlockSectionItem that i should render if "Dinâmica" is the option selected
 
</apex:pageBlockSectionItem>
                            
                            <apex:pageBlockSectionItem id="Blockteste" rendered = "{!Mudanca}">
                                <apex:outputLabel value="Selecione o painel"/>
                                    <apex:selectList value="{!DataHoraPainel}" styleClass="flutua-direita" multiselect="false" size="1">
                                        <apex:selectOptions value="{!QualPainel}"/>
                                    </apex:selectList>
                                    
                            </apex:pageBlockSectionItem>


 
I am using a repeat tag which consists of input fileds on click of a button the input field repeats dyanamically i have used wrapper class so that I can insert multiple records to the object but I have a dependent picklist field but I could not control the size of the field as the width varies dyanamically according to the text valu inside the picklist field I cannot set the width as the field's ID is dyanamic as the button is clicked will be helpful if someone could solve this issue
Hello

I've built a VF page along with a controller extension. This page is a long questionnaire that spans over four to five pages/screens that the users have to scroll through but once they hit the save button they get redirected back to the top of the page. I want the page to automatically scroll back to the place they were working at, much like a standard Salesforce record page does after refreshing. 

Here's a snippet of my VF page and save methods:

VF PAGE: 

<apex:pageBlock title="Properties" tabstyle="Mortgages__c">
           <apex:outputlabel style="color:red;font-style:italic;font-size:16px;white-space:pre;" value="Thank you for your responses so far, I’d now like to ask you some questions regarding your current address and your housing arrangements…."/>
           
           <apex:commandButton action="{!newProperty}" value="New Property" rendered="{!NOT(ISBLANK(Account.id))}"/>
           <apex:outputPanel id="propertyList"> 
                <apex:repeat value="{!Properties}" var="prop" >
                    <apex:pageBlockSection title="Property {!prop.name}"  columns="1" collapsible="true">
                     <apex:pageBlockSectionItem >
                              <apex:pageBlockSection columns="2">
                                <apex:outputField value="{!prop.Client__c}"/>
                                <apex:inputField value="{!prop.Joint_Client__c}"/>
                                <apex:inputField value="{!prop.Street__c}"/>
                                <apex:inputField value="{!prop.Town__c}"/>
                                <apex:inputField value="{!prop.Postcode__c}"/>
                                <apex:outputlabel style="color:Blue;font-style:italic;font-size:14px;" value="**Essential**"/>
                                <apex:inputField value="{!prop.Date_Acquired__c}" label="When did you purchase the property?"/>
                                <apex:inputField value="{!prop.Year_of_Build__c}" label="In what year was the property built?"/>
                              </apex:pageBlockSection>
                           </apex:pageBlockSectionItem>
                            <apex:commandButton value="Delete Property" action="{!deleteProperty}" rerender="propertyList">
                               <apex:param name="propertyIdent" value="{!prop.id}" assignTo="{!chosenpropertyId}"/>
                            </apex:commandButton>
                        </apex:pageBlockSection>
                </apex:repeat>
            </apex:outputPanel>
            </apex:pageBlock>

APEX CLASS:
public PageReference save()
    {
     Boolean result=true;
     PageReference pr=Page.myVFpage;
     if (null!=getAccount().id)
     {
      result=updateProperties();

     }
     else
     {
      pr.setRedirect(true);
     }
      
     if (result)
     {
        // call standard controller save, but don't capture the return value which will redirect to view page
        std.save();
           ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'Changes saved'));
     }
        pr.getParameters().put('id', getAccount().id);
      
     return pr;
    }
I've two methods that query on Account and a custom object, and I need values from both of them to initialize attributes on component. Can any one help to achieve this?

Hi Everyone,

I am currently facing an issue on a VF page I've created which uses a Javascript to count number of characters on a inputtextarea as users type in. This works very well but with the new requirements to improve the VF page wherein there has to be different character limit per country I was force to use render function. Before the section where the textarea field is located the counter works well but right after it gets rerendered the javascript stopped working.

I've inspected the page before the render and after the render, and this part of the code went missing after rerendering.
<div class="jqEasyCounterMsg" style="font-size: 12px; font-family: Arial; color: rgb(0, 0, 0); text-align: right; width: 600px; opacity: 0;">Characters: 0/210</div>

Thank you in advance for any inputs!