• sfdcdev
  • SMARTIE
  • 731 Points
  • Member since 2015

  • Chatter
    Feed
  • 14
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 78
    Replies
User-added image
How to bind Account Name in Accounts?
I am receiving an error with the Using the Report Builder when checking this challenge: Please check that you have a filter for Stages that are not equal to Closed Won or Closed Lost. I have selected 'stage' and 'not equal to' then 'Closed Won' and again with 'Closed Lost'. I have redone it a few times and keep getting the error. Hoping you can help, thanks! 
Here is a screen shot:

User-added image
Hello All,
I am stuck in below trailhead chanllange
Create a Visualforce page that displays the first name of the logged-in user.
  • The page must be named 'DisplayUserInfo'.
  • The displayed user information must be generated dynamically from the logged-in user.
Here below is my code. Please help me to find the solution.
<apex:page>
{!$User.FirstName } {!$User.LastName } ({!$User.Username })
</apex:page>
Hi all,
I am learning Visualforce and I am trying to add some VF code to a Custom Object, but I keep getting this error when I try to save:

Error: Unknown property 'Revenue_Recognition__cStandardController.revenue_recognition'

Controller:
public class revRecExtension
{
    ApexPages.StandardController stdCtrl;
    public revRecExtension(ApexPages.StandardController std)
    {
       stdCtrl=std;
    }
 
    public PageReference save()
    {
        stdCtrl.save();
        return null;
    }
}

VF Code:
<apex:page standardController="Revenue_Recognition__c" extensions="revRecExtension">
<apex:sectionHeader title="Revenue Recognition"/>
<apex:form >
    <apex:pageBlock title="Edit" mode="edit">
        <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!save}"/>
            <apex:commandButton value="Cancel" action="{!cancel}"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection title="Revenue Recognition Details" columns="2">
            <apex:inputField value="{!revenue_recognition.duration__c}"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>

Any help would be highly appreciated!!

Thanks!!
Heather
I've been trying to get my code to validate and keep receiving an error message that says 'The component does not implement the appHostable interface. That interface is required to add the component to Salesforce1." even though I have the appHostable interface in my code and the app also works for me in SF1. Below is my component and CSS code:
 
Component Code:  

<aura:component implements="force:appHostable"> 
    <h1 class="headline">My Lightning Component</h1> 
</aura:component> 

CSS Code

 .THIS {
 } 

.THIS.headline{ 
     font-size:24px; 
}

Can someone please tell me what the problem is and what I need to do to fix it? I've burned a lot of time trying to get this to validate by stripping it down to the most basic elements, adding things back in, etc. just to try and get it to pass. At this point, I don't know what else to do to try and get it to pass. 
I'm on the Creating List View module in TrailHead and I'm trying to follow the instruction to create a list view: "To create a new view, click Create New View at the top of any list page or in the Views section of any tab home page."

The thing is, I cannot find the top of any list page or the Views section. I've looked everywhere :-(

I'm new to Salesforce, so please forgive me if the answer is very obvious :-)
This is the component:

<aura:component implements='force:appHostable'>
    <h1 class="headline">My Lightning Component</h1>
</aura:component>


This is the app:

<aura:application >
    <h1>Hello Lightning App!</h1>
    <c:MyLightningComponent />
</aura:application>


This is the CSS:

.THIS{  
}

h1.THIS.headline {
    font-size:24px;
}

To me it seems to be doing what is it supposed to be doing. Which is "The component must include an H1 tag with a CSS class named 'headline'. The 'headline' CSS class must set a font-size of 24px."
Yet it complains that "The component is not using the correct CSS for the 'headline' class".
Anyone an idea of what I am doing wrong.
Much appreciated in advance.

 

Hi,
This is probably easy but I am a newbie and basically partially edited other code so not sure how to correct this issue.

IMAGE
OSHA

ISSUES:
There is no spacing or ideally other columns dividing the information.
There is no title.  Simply having the Name, ProductCode, Description, Notes would be fine.
I don't need the Product Id section but I tried using that info as it shows the Title.

I tried doing some searching and something called </apex:pageBlockSectionItem> but maybe that's for something else or I didn't use it properly.

CODE:
<apex:page standardController="Product2" extensions="prodsearchcontroller">  
  <apex:form >  
 <apex:inputText value="{!searchstring}" label="Input"/>   
  <apex:commandButton value="Search records" action="{!search}"/>  
  <apex:commandButton value="Clear records" action="{!search}"/>  
   <apex:pageBlock title="Search Result">  
    <apex:pageblockTable value="{!prod}" var="a">  
  <apex:column >  
      <apex:outputlink value="https://ap1.salesforce.com/{!a.id}">{!a.Name}</apex:outputlink>  
      <apex:outputlink value="https://ap1.salesforce.com/{!a.id}">{!a.ProductCode}</apex:outputlink>  
      <apex:outputlink value="https://ap1.salesforce.com/{!a.id}">{!a.Description}</apex:outputlink>  
      <apex:outputlink value="https://ap1.salesforce.com/{!a.id}">{!a.Notes__c}</apex:outputlink>  
     </apex:column>  
     <apex:column value="{!a.id}"/>  
    </apex:pageBlockTable>     
   </apex:pageBlock>   
  </apex:form>  
 </apex:page>

Thanks.

Hello,

I am finding a Tutorial for debugging in Visualforce.
I use Developer console, not much faimiliar to eclipse yet.

I used Jdev ide.  It was quite easy to debug, the code stops at ypur breakpoint and i could then run line by line.
Can i achive same in Visualforce with Dev console ( or eclipse) ?
  • March 13, 2015
  • Like
  • 0
Hello,

I want to create a lookup to text.

Obj 1
 - name1 (lookup to obj2.name)

Obj2
 -name2 (text, unique)

I am able to crete look up tp obj2.
But I want to create a lookup to text field of Obj2 (name2)

If i create lookup to Obj2 (type text) one fucntionality is met, that i can make lookup to text field. But i cant make it unique, hence i add other text field. Also, i want that this custom field should be displayed when i create lookup.
  • March 08, 2015
  • Like
  • 0
Hi, I have been trying the "Using expressions challenge" of the lightning module and when I check the challenge I receive the next message:

Challenge not yet complete... here's what's wrong: 
The component is not defining an attribute

And here is my component:
<aura:component implements="force:appHostable">
    <aura:attribute name="DayOfTheWeek" type="String" default="Monday" /> 
    <aura:if isTrue="{!v.DayOfTheWeek=='Monday'}">
    Today is {!v.DayOfTheWeek}
        .........
    </aura:if>
</aura:component>

So, basically I don´t know what the error message refers to.

Thanks in advance.
What is Sales Force? (Check all that apply)
 
  A. Sales Force Automation 
  B. Marketing Automation 
  C. Customer Support Management 
  D. Campaign Management

I think the answer should be all 4, i.e a,b,c,d . 

Can someone please confirm ? 
From the "Using Standard List Controllers" example, I tried following the code.  I see the filter option but I don't see "records per page" or previous/next.  Can someone help?  Image and code below.  Thanks, Aron.

User-added image

<apex:page standardController="Contact" recordSetVar="contacts">
        <apex:form >
     
            <apex:pageBlock title="Contacts List" id="contacts_list">
             
                Filter:
                <apex:selectList value="{! filterId }" size="1">
                    <apex:selectOptions value="{! listViewOptions }"/>
                    <apex:actionSupport event="onchange" reRender="contacts_list"/>
                </apex:selectList>
     
                <!-- Contacts List -->
                <apex:pageBlockTable value="{! contacts }" var="ct">
<!-- Pagination -->
    <table style="width: 100%"><tr>
     
        <td>
Page: <apex:outputText value=" {!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>
        </td>           
     
        <td align="center">
<!-- Previous page -->
    <!-- active -->
    <apex:commandLink action="{! Previous }" value="« Previous"
         rendered="{! HasPrevious }"/>
    <!-- inactive (no earlier pages) -->
    <apex:outputText style="color: #ccc;" value="« Previous"
         rendered="{! NOT(HasPrevious) }"/>
     
    &nbsp;&nbsp; 
     
    <!-- Next page -->
    <!-- active -->
    <apex:commandLink action="{! Next }" value="Next »"
         rendered="{! HasNext }"/>
    <!-- inactive (no more pages) -->
    <apex:outputText style="color: #ccc;" value="Next »"
         rendered="{! NOT(HasNext) }"/>
        </td>
         
        <td align="right">
    Records per page:
    <apex:selectList value="{! PageSize }" size="1">
        <apex:selectOption itemValue="5" itemLabel="5"/>
        <apex:selectOption itemValue="20" itemLabel="20"/>
        <apex:actionSupport event="onchange" reRender="contacts_list"/>
    </apex:selectList>
        </td>
     
    </tr></table>
                    <apex:column value="{! ct.FirstName }"/>
                    <apex:column value="{! ct.LastName }"/>
                    <apex:column value="{! ct.Email }"/>
                    <apex:column value="{! ct.Account.Name }"/>
                </apex:pageBlockTable>
                 
            </apex:pageBlock>
     
        </apex:form>
    </apex:page>
I have completed every challenge but this. Everything seems like normal but system keeps telling me this error:

Challenge 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.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Service__c]: [Service__c]


I tried same challange with my another account to make sure i am not doing it wrong, and it's accepted by trailhead. But with this account it keeps telling that error. Don't know what to do, any clue?

 
I am have a workflow rule which updates the field on quote and creates task 3 Days Before Quote Expiration Date.I have to move this rule to Process Builder and I can only see two evaluation criteria in process builder:

User-added image

The workflow rule has third evaluation criteria "Evaluate the rule when a record is created, and any time it's edited to subsequently meet criteria".What is equivalent of this criteria in Process builder?What should I select for this criteria in Process Builder?
Is "Recursion - Allow process to evaluate a record multiple times in a single transaction" same as above criteria?
I have written a trigger to update Billing_Country_Name__c custom field on Account.Country Codes are being saved in custom settings.

    trigger updateCountry on Account (before insert, before update) {
  
    if(Trigger.isBefore) {
      
        if(Trigger.isInsert) {
          for(Account acc : Trigger.new) {
              if(acc.BillingCountry != null) {
                  string country = Country_ISO_Codes__c.getInstance(acc.BillingCountry).Two_Digit_ISO_Code__c;
                  acc.Billing_Country_Name__c = country;                  
              }
                
          }
      }else
      if(Trigger.isUpdate) {
        for(Account acc : Trigger.new) {
            Account oldAccs = Trigger.oldMap.get(acc.Id);
        
            if(acc.BillingCountry != null && oldAccs.BillingCountry != acc.BillingCountry) {
                string country = Country_ISO_Codes__c.getInstance(acc.BillingCountry).Two_Digit_ISO_Code__c;
                acc.Billing_Country_Name__c = country;  
            }
         }
             
       }
    }
      
}

As you can see there are duplicate codes in Trigger.isInsert and Trigger.isUpdate.I seperated the logic in to helper class and getting null pointer error.

Helper Class-

    public with sharing class TriggerHelper {

      public static void updateAccountBillingCountry(List<Account> accs, Map<Id, Account> oldMap) {
  
        for(Account acc : accs)
        {
            Account oldAcc = oldMap.get(acc.Id);
            String country = Country_ISO_Codes__c.getInstance(acc.BillingCountry).Two_Digit_ISO_Code__c;
            
            f(acc.BillingCountry != null) {
              acc.Billing_Country_Name__c = country;
            }else
            if(acc.BillingCountry != null && oldAcc.BillingCountry != acc.BillingCountry) {
                  
                acc.Billing_Country_Name__c = country;
            }
            
        }

        
   }
}

Trigger-

    trigger updateCountry on Account (before insert, before update) {
      
      if(Trigger.isBefore) {
         if(Trigger.isInsert || Trigger.isUpdate) {
           TriggerHelper.updateAccountBillingCountry(Trigger.new, Trigger.oldMap);
         }
         
      }
}

The trigger is working fine when updating a record, but it's not working when I inserts a record.Also, I don't know, How to check for separate if condition as done in my single trigger.
Any one have any idea how to resolve this.Tried and tested into two different orgs: same error

User-added image
<aura:component>
    Observe!  Components within components!

    <auradocs:helloHTML/>

    <auradocs:helloAttributes whom="component composition"/>
</aura:component>

When I'm saving the above code in developer console, then getting this error:

FIELD_INTEGRITY_EXCEPTION
Failed to save undefined: No COMPONENT named markup://auradocs:helloHTML found : [markup://c:nestedComponents]: Source

I have already created helloHTML and helloAttributes components.Any idea what's happening!
 
There was a new critical update named "Remove Instance Names From URLs for Visualforce, Community Builder, Site.com Studio, and Content Files". But after active it, all of the Tabs which contains a Visualforce Page could not be shown on one/one.app when display with the Safari browser on the iPhone.

To make sure this issue was not caused by any other reason, I created the following simple Visualforce Page
<apex:page >
    <apex:outputPanel id="output">Test Page</apex:outputPanel>
</apex:page>
And I also make it be "Available for Lightning Experience, Lightning Communities, and the mobile app"
Then I create a new Tab and also I add it in the Salesforce Navigation in Mobile Administration.

When I deactive that critical update, I can see the text "Test Page" when I click my sample Tab. But unfortunately, it shows nothing after I active that option.

Why? Anybody else meets the same probelm with me?

It looks like that Claibome mets a similar issue, but I think there is a little difference: https://developer.salesforce.com/forums?id=9060G0000005TW2QAM

BTW, I also noticed that when the problem occurs, there were several errors reported in the console, several 404 errors and also a strange "Failed to load resource: too many HTTP redirect" error.
  • February 22, 2018
  • Like
  • 0
There is a new critical update called Remove Instance Names From URLs for Visualforce, Community Builder, Site.com Studio, and Content Files.

DANGER! DANGER! DO NOT ACTIVATE!

This changes links for visualforce pages.  <domain name>.visualforce.com replaces <domain name>.<instancename>.visual.force.com.

For whatever reason, this does not work with Visualforce tabs or with buttons that link to visualforce pages.

With the critical update deactivated, the link for visualforce tab is https://<domain name>.<instancename>.visual.force.com/apex/TimeEntryCalendar?sfdc.tabName=01r500000003bNn.

When the critical update is activated, the link for the visualforce tab is https://<domain name>.visualforce.com/apex/TimeEntryCalendar?sfdc.tabName=01r500000003bNn.

The problem is that clicking the "activated" link yields this:
 
This site can’t be reached
<domain name>.visualforce.com’s server IP address could not be found.

In my case, it was a really big problem because the visualforce tab was the default home page. So activating the Critical Update essentially locked all of my users out of salesforce.com. 

This also fails with a simple button link to a visual force page.

If you assign a url to a button or type the link in - /apex/TimeEntryCalendar for instance, it works fine when the update is deactivated.

But activate the update, and it fails on just the simple link.

Problem exists in both Classic and Lightning.

MAJOR SNAFU!
I have written a trigger to update Billing_Country_Name__c custom field on Account.Country Codes are being saved in custom settings.

    trigger updateCountry on Account (before insert, before update) {
  
    if(Trigger.isBefore) {
      
        if(Trigger.isInsert) {
          for(Account acc : Trigger.new) {
              if(acc.BillingCountry != null) {
                  string country = Country_ISO_Codes__c.getInstance(acc.BillingCountry).Two_Digit_ISO_Code__c;
                  acc.Billing_Country_Name__c = country;                  
              }
                
          }
      }else
      if(Trigger.isUpdate) {
        for(Account acc : Trigger.new) {
            Account oldAccs = Trigger.oldMap.get(acc.Id);
        
            if(acc.BillingCountry != null && oldAccs.BillingCountry != acc.BillingCountry) {
                string country = Country_ISO_Codes__c.getInstance(acc.BillingCountry).Two_Digit_ISO_Code__c;
                acc.Billing_Country_Name__c = country;  
            }
         }
             
       }
    }
      
}

As you can see there are duplicate codes in Trigger.isInsert and Trigger.isUpdate.I seperated the logic in to helper class and getting null pointer error.

Helper Class-

    public with sharing class TriggerHelper {

      public static void updateAccountBillingCountry(List<Account> accs, Map<Id, Account> oldMap) {
  
        for(Account acc : accs)
        {
            Account oldAcc = oldMap.get(acc.Id);
            String country = Country_ISO_Codes__c.getInstance(acc.BillingCountry).Two_Digit_ISO_Code__c;
            
            f(acc.BillingCountry != null) {
              acc.Billing_Country_Name__c = country;
            }else
            if(acc.BillingCountry != null && oldAcc.BillingCountry != acc.BillingCountry) {
                  
                acc.Billing_Country_Name__c = country;
            }
            
        }

        
   }
}

Trigger-

    trigger updateCountry on Account (before insert, before update) {
      
      if(Trigger.isBefore) {
         if(Trigger.isInsert || Trigger.isUpdate) {
           TriggerHelper.updateAccountBillingCountry(Trigger.new, Trigger.oldMap);
         }
         
      }
}

The trigger is working fine when updating a record, but it's not working when I inserts a record.Also, I don't know, How to check for separate if condition as done in my single trigger.
I am trying to complete the step where you have to set up the Master-Detail Relationship. I followed all the steps but I got this message.
I have already set up such Master-Detail Relationship before during the trailhead, it worked but this time i don't know what is wrong

"Step not yet complete... here's what's wrong:
A sample Session Speaker record could not be inserted. Please check the relationship fields with the Speaker and Session objects
Note: you may run into errors if you've skipped previous steps"

Schema builder

I double check all should be allright?

Here are my two related fields :
User-added image

and the last one :
User-added image

Thanks in advance
How to know the API names of fields of a Standard Objects like Accounts, Contacts etc & what's the navigation to view the API names of fields of standard objects
How do I populate my Excel spreadsheet with specific information (e.g. First Name, Last Name, E-mail) given an Account Name in column A?
Hi,
what are the best practices of creating a VF page,its limitations? ,
things to keep in mind while creating a VF page and @Max how many records can be displayed on a VF page and
Does Trasient keyword avoids the VF page from touching the limit (view state limit 135 KB) or will it bypass the view state limit size?
User-added image
How to bind Account Name in Accounts?
I am receiving an error with the Using the Report Builder when checking this challenge: Please check that you have a filter for Stages that are not equal to Closed Won or Closed Lost. I have selected 'stage' and 'not equal to' then 'Closed Won' and again with 'Closed Lost'. I have redone it a few times and keep getting the error. Hoping you can help, thanks! 
Here is a screen shot:

User-added image
Hello All,
I am stuck in below trailhead chanllange
Create a Visualforce page that displays the first name of the logged-in user.
  • The page must be named 'DisplayUserInfo'.
  • The displayed user information must be generated dynamically from the logged-in user.
Here below is my code. Please help me to find the solution.
<apex:page>
{!$User.FirstName } {!$User.LastName } ({!$User.Username })
</apex:page>
I keep getting a message telling me " The 'Call Assistant' action wasn't added to the Contact page layout." despite the fact that I've added it to the Contact Page layout. 

Here's my page code:
<apex:page docType="html-5.0" standardController="Contact" title="Show Assistant Info" >                       

    <div>
    
    <p>Assistant Name : {!Contact.AssistantName}</p> 
    
    <p>Assistant Phone : <a href="tel:{!Contact.AssistantPhone}">{!Contact.AssistantPhone}</a></p>

    </div>
    
    </apex:page>
A screen shot of the Page Editor to show it's enabled for SF1 and properly named:

Page Editor Screen Shot

A screen shot of the Contact Action:
Contact Action
A screen shot of where it's been added to the Salesforce1 Action Bar on the Page Layout:
Page Layout - Salesforce1 Action Bar
And finally, a screen shot of where the page has also been added to the SF1 Mobile Navigation Menu: 
Mobile Navigation Menu

I don't know what else I can do differently to get this to validate. Is there something I've missed? I've even added the fields to the mini page layout! I've no clue what the real problem is that's behind this not passing the challenge. 
hep me out to how to use $resource globla variable......in so many examples i seen like
{!$Resource.example_js} ,i am not getting one thing here...from where i am including this javasctipt file....am i need to upload this file into my documents by using document tab...otherwise where can i upload this document to refer in my visualforce page. 
 
I have completed every challenge but this. Everything seems like normal but system keeps telling me this error:

Challenge 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.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Service__c]: [Service__c]


I tried same challange with my another account to make sure i am not doing it wrong, and it's accepted by trailhead. But with this account it keeps telling that error. Don't know what to do, any clue?

 

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.