• joshbirk
  • SMARTIE
  • 973 Points
  • Member since 2010

  • Chatter
    Feed
  • 36
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 315
    Replies
For trailhead challenge (https://developer.salesforce.com/trailhead/lightning_components/lightning_components_uiforce), I am using below code. I am not able to figure out whats wrong in below code. I am getting error saying "The component is not using the ui:inputText component"
 
<aura:component >       
    <aura:attribute name="fName" type="String" default="Jitendra"/>
    <aura:attribute name="lName" type="String" default="Zaa"/>
    <aura:attribute name="pNumber" type="String" default="201"/>
    <aura:attribute name="sal" type="String" default="Mr."/>
 
    <ui:inputText label="First Name" value="{!v.fName}" />  
    <ui:inputText label="Last Name" value="{!v.lName}"  /> 
    <ui:inputText label="Phone Number" value="{!v.pNumber}"  />  
    
    <ui:inputSelect multiple="false" label="Salutation" value="{!v.sal}" >
        <ui:inputSelectOption text="Dr." label="Dr." />
        <ui:inputSelectOption text="Mr." label="Mr."/>
        <ui:inputSelectOption text="Mrs." label="Mrs."/>
        <ui:inputSelectOption text="Ms." label="Ms."/>
	</ui:inputSelect> 
    <ui:button label="Submit"/>
</aura:component>

 
https://developer.salesforce.com/trailhead/visualforce_mobile_salesforce1/visualforce_mobile_salesforce1_layouts_cards

I am working on above challenge and code is working in my org and is as below
 
<apex:page standardController="Opportunity"> <apex:outputText value="{!IF(Opportunity.StageName="Prospecting", 'Teststs', IF(Opportunity.StageName="Proposal/Price Quote", 'Teststs', IF(Opportunity.StageName="Proposal/Price Quote", 'Teststs', IF(Opportunity.StageName="Proposal/Price Quote", 'Teststs','Teststs'))))}"/> </apex:page>


I am getting an error as below 

User-added image

Let me know if i am doing anything wrong .
This client-side DisplayCaseController does not pass the challenge with error "The client side controller does not refer to the 'getCaseFromId' method of the Apex controller class".  Component and controller are pasted below.  The component runs from a test lighnting app.  getCaseFromId is correctly referenced as "var action = component.get("c.getCaseFromId");" in the first line of code


component
<aura:component controller="DisplayCaseController" >
    <aura:attribute name="record" type="Case"/>
	<ui:inputText aura:id="caseId" label="Enter Case Id: "/>
    <ui:button label="Get Case" press="{!c.getCaseRecord}"/><br/>

    Subject: <ui:outputText value="{!v.record.Subject}"/><br/>
    Description: <ui:outputText value="{!v.record.Description}"/><br/>
    Status: <ui:outputText value="{!v.record.Status}" /><br/>
</aura:component>
client-side controller
({
	getCaseRecord : function(component) {
        var action = component.get("c.getCaseFromId");
        var caseId = component.find("caseId").get("v.value");
        action.setParams({ "caseID" : caseId });
        action.setCallback(this, function(action) {
			if (action.getState() === "SUCCESS") {
 				component.set("v.record", action.getReturnValue());
            }
            else {
                alert("Action state: " + action.getState());
            }
        });
        $A.enqueueAction(action);
	}
})
Test Application
<aura:application>
    <c:DisplayCase/>
</aura:application>


 
I'm working through the Using Apex in Components (https://developer.salesforce.com/trailhead/force_com_programmatic_beginner/lightning_components/lightning_components_apex) challenge.

When checking the challenge I'm getting the response:
Challenge not yet complete... here's what's wrong: 
The client side controller is not using the return value from the 'getCaseFromId' method

If I put the same lightning component in an app I can see it is retrieving the Case details via the Apex controller method via the client controller.
Testing working Apex Component
I can see the call going through to the Apex Controller in the logs.
User-added image

I can put a debugger; statement in the client controller within the actions setCallback method and hit that immediately after passing the return value back to the records view attribute.

So I'm fairly certain that the client side controller is using the return value from `getCaseFromId` in the Apex controller.

Any ideas on what the challenge is checking for here?

Okay, I'm pretty close to wrapping up my 4-week worths of days, nights, weekdays & weekends, lost hair and dark circles below my eyes :) But I can't really find how do I submit my entry. Can anyone point me to the submission link?

The rules state "A maximum 2 minute demo video of the working application uploaded to
your YouTube or Vimeo account"

 

In the past for Salesforce Mobile Developer Challenge, I've seen entries with larger durations accepted. Can you confirm if the 2 min duration limit is in stone of can it exceed by few seconds?

How do we go about delivering code for the project for review? I assume we're submitting a zip or similar for any mobile code and then just some org creds for SFDC parts? 

Hey guys,

 

I need  the community's opinion on using geolocation. I'm currently creating a dynamic query of GeoLocation datatype field and using it with a Web Service.

 

So my concern are:

1. Should I continue to use the GeoLocation field in my query even though it is in BETA? And besides the limitation that is in the winter 13 release, are there are any other limitation I should worry about since this is still in beta?

my sample code is below:

String add1 = 'Select Id, Account__r.Name, Account__r.Type__c, Name, GeoLocation__Latitude__s, GeoLocation__Longitude__s, (select id, Name, Certification__c, HCP_Account__r.Name from HCP_Authorized__r) ';
    	add1 += 'from Address__c where Account__r.Type__c includes (\'Business\') ';
    	add1 += 'and Distance(GeoLocation__c, GEOLOCATION('+strLat +',' +strLong +'), \'mi\') < ' +rad;

2. Will there be a chance that SFDC will eliminate the geoLocation Datat Type in the future?

3. And is there another solution besides using a GeoLocation Data Type and query distance of the Latitude and Longitude? For example I can create 2 fields for Latitude and Longitude and use those field to add in my query instead of using the new GeoLocation.

 

Any help would be great.

 

Thanks

 

So im trying to figure out how to query Contacts for a specific distance and I was looking into the documenation to create a sample query in the Developer Console.

 

I created a new field called Location__c under Contact, i set the a contact record with following Lat and Long.

 

And I tried runnign the query editior in developer console:

 

SELECT Name FROM Contact WHERE DISTANCE(Location__c, GEOLOCATION(37.7945391,-122.3947166), "mi") < 1

 

and i get the following error:

Unknown error parsing query

 

 

Also tried running the schema builder off the Eclipse IDE and i get a different errors stating:

Malformed Query -  GEOLOCATION(37.7945391,-122.3947166

 

and it goes on saying error on line 1:91 no viable alternative ""

 

Any help would be great.

 

BTW i was following the instructions from here the

 

http://www.salesforce.com/us/developer/docs/soql_sosl/salesforce_soql_sosl.pdf

http://blogs.developerforce.com/developer-relations/2012/10/winter-13-using-apex-and-soql-with-geolocation.html

 

 

 

 

I am creating an alert tab for my customer portal users via a visualforce tab. I am grabbling the contactId via {$User.ContactID} and want to set the current page to this ID when a user click this tab from the Home tab.  Am I going to have to make every tab a VF tab and pass the param that way or is there a way to set the Current Page id to a default id?

I'd like to have it automically set to something like this 

https://c.cs7.visual.force.com/apex/Customer_Alerts?id=aid

 

<apex:page standardcontroller="Contact" showHeader="true">

<apex:param name="aid" value="{!$User.ContactId}"/>

<h1>Alerts will go here</h1><br/>
{!$User.ContactId}
{!Contact.name}<br/>
{!Contact.Alert_Management__r.Alert_Message__c}<br/>
{!Contact.Account.Name}

</apex:page>

 

Thanks in advance,

 

D

 

I'm trying link our own application via oAuth 2.0 to retrieve data from SF and display it in our own applicatie, but I get the follow error after the user entered his credentials: 'Package for this consumer is not installed in your organization' with the error code '1714'.

I followed this description: https://na14.salesforce.com/help/doc/en/remoteaccess_oauth_web_server_flow.htm

And this is the link that is generated: https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=<MY CLIENT ID>&redirect_uri=<MY REDIRECT URL>

The client_id is the one that I created and could be found under 'Remote Access' and then 'Authentication'.

What I'm I missing in the proces?

I am coding dynamic visual force components in my controller and have had success rendering the Inputfield component and SelectList compnent where the Multi-Select Attribute is False however having trouble when the attribute is set to true.

 

Here is the controller code and page code snippet:  Red text shows the error I am receiving.

 

Thanks in advance for your help

 

  for(Service_Task_STQ_Joiner__c STQ: STQList){
        
                STRRList.add(new Service_Task_Request_Response__c());


    // Picklist field code block
                        
                        if(STQ.Service_Task_Request_Questionnaire__r.Type__c == 'Picklist (Multi-Select)'){
                                 
                                 Component.Apex.SelectList STQPicklist = new Component.Apex.SelectList();
                                 
                                 List<String> STQPicklistValues =         STQ.Service_Task_Request_Questionnaire__r.Values__c.Split(':',0);
                                 
STQPicklist.Multiselect = True; /* ERROR when I load VF page: System.VisualforceException: Invalid value for property multiselect: Attribute multiselect for component <apex:selectList> cannot be changed after the component has been created */
//If STQPicklist.Multiselect = False; renders fine, however I need Multi-Select option

	STQPicklist.expressions.value = '{!STRRList[0].Response__c}';
        STQPicklist.Size = STQPicklistValues.Size();
        STQPicklist.id = 'STQPicklist'+i;
       STQPicklist.Required = STQ.Service_Task_Request_Questionnaire__r.Required__c;
        STQPicklist.Title = STQ.Service_Task_Request_Questionnaire__r.Help_Text__c;
                                
      Component.Apex.selectOptions STQOptions = new Component.Apex.SelectOptions();
                                 
                                                                 
          Component.Apex.OutputLabel STQOutputLabel = new Component.Apex.OutputLabel();
          STQOutputLabel.value = STQ.Service_Task_Request_Questionnaire__r.Label__c;
          STQOutputLabel.for = 'STQPicklist'+i;  
                                 
         STRRList[0].Service_Task_Question__c = STQ.Service_Task_Request_Questionnaire__r.Label__c;
                                 
                                 dynPageBlockSection.childComponents.add(STQOutputLabel);
                                 dynPageBlockSection.childComponents.add(STQPicklist);
                                 
                                  for(String s: STQPicklistValues){
                                Component.Apex.selectOption STQOption = new Component.Apex.SelectOption();
                                 	STQOption.itemValue = s;
                                 	STQOption.itemLabel = s; 
                                 	STQPicklist.childComponents.add(STQOption);
                                  }
                        } 

 

 <apex:page showheader="false" controller="CusReqController" action="{!ServiceTaskQuestionnairePageLoad}">
   
 
   <apex:form >

   
   <apex:dynamicComponent componentValue="{!DynamicForm}"/>  
    

    </apex:form>

   
</apex:page>

 

  • February 02, 2012
  • Like
  • 0

Hi All,

 

Is there any way we can get SFDC to offer AMF? Does Salesforce supports making AMF calls ?

 

Thanks

Hi

 

I have this requirement and I need some expert advice.

 

I need to inform a 3rd party system with changes to my records (Create, Update and Delete) using a REST callout.

 

I have these constraints:

  • Inform on record updates only when specific fields have been changed (only these fields that the other system is interested in)
  • If the other system is not available, keep trying to inform it, or retry in predefined intervals

What is the best way to achieve this?

 

Does anyone know of a solution for this available out there or had implemented something like this before?

 

Thanks a lot

 

Kruvi

  • January 11, 2012
  • Like
  • 0

Hi,

 

I have some code that gets some JSON data from a web service callout, then parses it into a collection (map) or object. I'm wondering if there's a best practice or method people are using to then cache this data for some amount of time so that it's not being retrieved and parsed everytime it is needed.

 

I'm thinking I can create an custom object for this and store the data there, either in a structured format, or serialize it to a JSON string and then store the whole string. I'd store it with a timestamp so that I know when to refresh it.

 

Is there a better way to do this? And by better I mean recommended or faster?

 

thanks

Hi,

 

Can anyone please help me on how to write Test Method in apex class in which I am calling the REST Service.

 

When the corresponding service is called from the testMethod, the code below the service call is not complied i.e the code is appearing in blue color upto

"JSONObject resp = this.getJSONObject('http://localhost:8080/service/testService.json', 'GET');   "

and the rest of the code is in red color.

 

Please help me on this.

 

Thanks in advance.



Hi all, 

 

I'm working on the sharing recalculation coding and have tried to implement the example code in the Apex Code documentation (http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_recalc.htm).  I'm getting errors when saving the test code as documented at the bottom.  The calls to start() and execute() are not saving with the error that the method does not exist. 

 

Has anyone else figured it out?  

 

Cheers,

Niki

  • November 16, 2011
  • Like
  • 0

I have created a command button that rerenders some Other fields Using the ReRender attribute. However I need the page to return to the top after the button is pressed. I have tried removing the rerender attribute but this leads the page to do something like a refresh and some values on the page change. I would like to know if there was a way to force the page to go to the top while keeping the rerender attribute. Thanks.

 

Here is the command button:

 

<apex:commandButton value="Save" action="{!SaveCand}" reRender="Error, Error2"/>

Hello,

 

I just want to show or hide the output panel "flight" on chaging the value of drop dwon box .

 

my code is

 

<apex:page showHeader="false" standardController="travel_booking__c" extensions="travel">
<html><br></br><br></br>
<head> <b><big><center> <font face="Times New Roman" size="+3" color="#ff0000">Capgemini Travel Desk</font></center></big></b></head>
<br></br><br></br>
<apex:form id="f1" rendered="true">
 <apex:pageBlock id="block" >
  <apex:pageBlockSection title="Login" id="pageblock" >

     <apex:outputtext value="Corp ID"/>
   
     <apex:outputtext value="Name"/>
   
   <apex:outputtext value="Project Name"/>
   
     <apex:outputtext value="Manager"/>
  
      <apex:inputField id="piclist" value="{!travel_booking__c.Travel_type__c}"  onchange="changevalue(document.getElementById('{!$Component.piclist}'));" />
  <br></br>
  <apex:outputText value="*This site is powered by Megha Travel agency"/>
  <br></br>
 
  <apex:outputPanel id="flight" rendered="false">
  <apex:outputText value="From Country" />
     <apex:inputField value="{!travel_booking__c.Fromcountry__c}"/>
      <apex:outputText value="To Country" />
     <apex:inputField value="{!travel_booking__c.To_Country__c}"/>
    </apex:outputPanel>
   
<apex:outputPanel layout="block" id="train" rendered="false"> 
<apex:outputText id="test" value="From City" />
     <apex:inputField value="{!travel_booking__c.From_City__c}"/>
      <apex:outputText value="To City" />
     <apex:inputField value="{!travel_booking__c.To_City__c}"/>
    </apex:outputPanel>
 
 
  </apex:pageBlockSection>

  <script type="text/javascript">
       
        function changevalue(txt)
        {
    
             if(txt.value=="Flight     (International)")
             {
                   
                 document.getElementById('{!$Component.block.pageblock.flight}').innerHTML.style.visibility ='visible';

             }
                           
        }  
</script>


 </apex:pageBlock>
 
 
</apex:form>
</html>
</apex:page>

 

Moreover plz tell me how to implement this with actionfunction

I would like to either 1. Not display or remove the datepicker input link (the link after the input field) 2.Make the datepicker input link  display below the input field in a table i.e. a double row height. The datepicker input widget takes up alot of space in the table and I want a narrow column with just the input field, not the link or the link below the input field.  I currently use an HTML <table><tr><td><apex:inputField value="{!date}/> format.  I tried using style=”word-wrap: break-word” in <td> and <apex:inputField> with no luck.  I don't know if you can and how to do it, to modify the datepicker class to put the style in an HTML head section. I was able to shrink the <td> usning colwidth, but either the link overflows into the next <td> section or you can still see the "[", brace, that overflows slightly into the next <td> column. Thanks.

 

  • November 03, 2011
  • Like
  • 0
For trailhead challenge (https://developer.salesforce.com/trailhead/lightning_components/lightning_components_uiforce), I am using below code. I am not able to figure out whats wrong in below code. I am getting error saying "The component is not using the ui:inputText component"
 
<aura:component >       
    <aura:attribute name="fName" type="String" default="Jitendra"/>
    <aura:attribute name="lName" type="String" default="Zaa"/>
    <aura:attribute name="pNumber" type="String" default="201"/>
    <aura:attribute name="sal" type="String" default="Mr."/>
 
    <ui:inputText label="First Name" value="{!v.fName}" />  
    <ui:inputText label="Last Name" value="{!v.lName}"  /> 
    <ui:inputText label="Phone Number" value="{!v.pNumber}"  />  
    
    <ui:inputSelect multiple="false" label="Salutation" value="{!v.sal}" >
        <ui:inputSelectOption text="Dr." label="Dr." />
        <ui:inputSelectOption text="Mr." label="Mr."/>
        <ui:inputSelectOption text="Mrs." label="Mrs."/>
        <ui:inputSelectOption text="Ms." label="Ms."/>
	</ui:inputSelect> 
    <ui:button label="Submit"/>
</aura:component>

 
https://developer.salesforce.com/trailhead/visualforce_mobile_salesforce1/visualforce_mobile_salesforce1_layouts_cards

I am working on above challenge and code is working in my org and is as below
 
<apex:page standardController="Opportunity"> <apex:outputText value="{!IF(Opportunity.StageName="Prospecting", 'Teststs', IF(Opportunity.StageName="Proposal/Price Quote", 'Teststs', IF(Opportunity.StageName="Proposal/Price Quote", 'Teststs', IF(Opportunity.StageName="Proposal/Price Quote", 'Teststs','Teststs'))))}"/> </apex:page>


I am getting an error as below 

User-added image

Let me know if i am doing anything wrong .
This client-side DisplayCaseController does not pass the challenge with error "The client side controller does not refer to the 'getCaseFromId' method of the Apex controller class".  Component and controller are pasted below.  The component runs from a test lighnting app.  getCaseFromId is correctly referenced as "var action = component.get("c.getCaseFromId");" in the first line of code


component
<aura:component controller="DisplayCaseController" >
    <aura:attribute name="record" type="Case"/>
	<ui:inputText aura:id="caseId" label="Enter Case Id: "/>
    <ui:button label="Get Case" press="{!c.getCaseRecord}"/><br/>

    Subject: <ui:outputText value="{!v.record.Subject}"/><br/>
    Description: <ui:outputText value="{!v.record.Description}"/><br/>
    Status: <ui:outputText value="{!v.record.Status}" /><br/>
</aura:component>
client-side controller
({
	getCaseRecord : function(component) {
        var action = component.get("c.getCaseFromId");
        var caseId = component.find("caseId").get("v.value");
        action.setParams({ "caseID" : caseId });
        action.setCallback(this, function(action) {
			if (action.getState() === "SUCCESS") {
 				component.set("v.record", action.getReturnValue());
            }
            else {
                alert("Action state: " + action.getState());
            }
        });
        $A.enqueueAction(action);
	}
})
Test Application
<aura:application>
    <c:DisplayCase/>
</aura:application>


 
I'm working through the Using Apex in Components (https://developer.salesforce.com/trailhead/force_com_programmatic_beginner/lightning_components/lightning_components_apex) challenge.

When checking the challenge I'm getting the response:
Challenge not yet complete... here's what's wrong: 
The client side controller is not using the return value from the 'getCaseFromId' method

If I put the same lightning component in an app I can see it is retrieving the Case details via the Apex controller method via the client controller.
Testing working Apex Component
I can see the call going through to the Apex Controller in the logs.
User-added image

I can put a debugger; statement in the client controller within the actions setCallback method and hit that immediately after passing the return value back to the records view attribute.

So I'm fairly certain that the client side controller is using the return value from `getCaseFromId` in the Apex controller.

Any ideas on what the challenge is checking for here?
I'm doing the simple lightning components challenge and have hit this problem in my existing trailhead org and a brand new dev org that I've just created:

Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: QVWBQHAG
Hello,

I'm trying to complete the "Using Formula Fields" section in trailhead.
The task is:

For easier reporting and filtering, create a new custom formula field on the standard account object which looks at the SLA Expiration Date field and returns true if the current date comes after it. Otherwise, it should return false.The account object should have a custom date field with the Field Label 'SLA Expiration Date' and Field Name of 'SLAExpirationDate'. The resulting API Name should be 'SLAExpirationDate__c'. On a Developer Edition, the 'SLA Expiration Date' field may already exist.
The new formula field should have the Field Label 'SLA Expired' and Field Name of 'SLA_Expired'. The resulting API Name should be 'SLA_Expired__c'.
The formula field should be of type 'Checkbox'.
The formula field should calculate its response based on the current date.
The formula field should return true if the SLA has expired, and false if it has not.


My syntax is: SLA_Expiration_Date__c < Today()

The error message I am receiving is: 
Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: LUVRAIPP


Any help is appreciated.
 
Hi,
I am using AngularJS to build a page on Salesforce1 mobile app. I have ability for users to upload attachments which are then saved in Attachment object. On Inserting the attachment, I am populating the id of the attachment on the object. Lets call it AttachmentId__c.

Normally ill simply use the '/servlet/servlet.FileDownload?file=' link to generate attachment link.

However, on Salesforce1 this link goes nowhere, it takes the user on the chatter feed and displays error. please login to correct org. 

Is there a way to get ServerURL for Salesforce1? Any pointers appreciated.
I have discovered a bug in the Spring 14 release in my sand box.

In the apex class used as the controller for the VF page I set a public Boolean variable called rightNow.

In the Visualforce page I have a command button <apex:commandButton value="Do It" action="{!doit}" immediate="{!NOT(rightNow)}" />. This has been working for several releases.

Click this button in Spring 14 generates an immediate system error.

If I do not use the "NOT" function it works fine.

This works - <apex:commandButton value="Do It" action="{!doit}" immediate="{!rightNow}" />

Adding another global variable notRightNow works as well

This works - <apex:commandButton value="Do It" action="{!doit}" immediate="{!notRightNow}" />

Please get this fixed.


Okay, I'm pretty close to wrapping up my 4-week worths of days, nights, weekdays & weekends, lost hair and dark circles below my eyes :) But I can't really find how do I submit my entry. Can anyone point me to the submission link?

I'm almost done with my iOS app. In addition to the code, I want to provide a working build (IPA) of my app via TestFlight or a similar mechanism just in case judges face any issues in compiling the code. Can you let me know the UDID for a couple of test devices? Else, please provide some guidance on how can I provide a build to you for judging.

 

An early response would be appreciated.

The rules state "A maximum 2 minute demo video of the working application uploaded to
your YouTube or Vimeo account"

 

In the past for Salesforce Mobile Developer Challenge, I've seen entries with larger durations accepted. Can you confirm if the 2 min duration limit is in stone of can it exceed by few seconds?

How do we go about delivering code for the project for review? I assume we're submitting a zip or similar for any mobile code and then just some org creds for SFDC parts? 

"On or before 2:01 pm on November 19th, Participants will be 

provided with a URL to the third-party vendor website to submit their Entry"

 

"Upon completion of 

the registration process, Participants will be able to submit their Entries. Entries consist
of:

-A mobile application useable by the judges (see below for more details)"

 

Looking below:

"All submitted Entries must be fully functional applications. We need to be able to use 

your application in order to judge it!"

With an iOS app, we can't just submit any old app to anyone.  It needs to be signed to work on specified devices for ad hoc deployment.  How is this possible when we are required to submit to some unknown url?