• Traveling Spoon
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
Our consultant has created some Flexible Pages before taking off the project. I see how you create a tab to point to the Flexible Page after the Page is created, but how are the Flexible Pages created in the first place? I need to know so we can maintain them. thanks.
I'm building an app with basic form using Lightning, the Submit button works, but the Clear button doesn't work - it's supposed to clear the field after user enters name and hit submit. Please advise what I missed. thanks.

HelloWorld.cmp:
<aura:component implements="force:appHostable" access="global">
    
    <ui:inputText aura:id="name" label="Find My TravelingSpoon:"/>
    <ui:button aura:id="button" buttonTitle="Click to see what you put into the field" class="button" label="Submit" press="{!c.getInput}"/>
    <ui:outputText aura:id="outName" value="" class="text"/>
    <ui:button aura:id="button" buttonTitle="Clear the field" class="button" label="Clear" press="{!c.clearName}"/>    
   
</aura:component>

HelloWorldController.js:
({
    getInput : function(cmp, evt) {
        var myName = cmp.find("name").get("v.value");
        var myText = cmp.find("outName");
        var greet = "Hi, " + myName;
        myText.set("v.value", greet);
    }
 clearName : function(cmp, evt) {
    var myName v= cmp.set("outName", []);
}    
})

User-added image
I'm beginning to learn coding on sfdc lightning. I read about Ionic, Aura, AngularJS, Lightning, but am confused about how they work with each other, and when to use what? Sorry about this broad question but just wanting to find a starting point. Do I understand correctly that Lightning + Process Builder is for minimum coding, while Ionic + Angular JS is for heavier coding for more customized mobile app? thanks
I was reading up on Lightning and found this in their docs (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_benefits.htm): 
"Components are encapsulated and their internals stay private, while their public shape is visible to consumers of the component. This strong separation gives component authors freedom to change the internal implementation details and insulates component consumers from those changes."
Can someone explain in layman's terms for someone who is a beginner developer? thanks.
Our consultant has created some Flexible Pages before taking off the project. I see how you create a tab to point to the Flexible Page after the Page is created, but how are the Flexible Pages created in the first place? I need to know so we can maintain them. thanks.
I'm building an app with basic form using Lightning, the Submit button works, but the Clear button doesn't work - it's supposed to clear the field after user enters name and hit submit. Please advise what I missed. thanks.

HelloWorld.cmp:
<aura:component implements="force:appHostable" access="global">
    
    <ui:inputText aura:id="name" label="Find My TravelingSpoon:"/>
    <ui:button aura:id="button" buttonTitle="Click to see what you put into the field" class="button" label="Submit" press="{!c.getInput}"/>
    <ui:outputText aura:id="outName" value="" class="text"/>
    <ui:button aura:id="button" buttonTitle="Clear the field" class="button" label="Clear" press="{!c.clearName}"/>    
   
</aura:component>

HelloWorldController.js:
({
    getInput : function(cmp, evt) {
        var myName = cmp.find("name").get("v.value");
        var myText = cmp.find("outName");
        var greet = "Hi, " + myName;
        myText.set("v.value", greet);
    }
 clearName : function(cmp, evt) {
    var myName v= cmp.set("outName", []);
}    
})

User-added image
I'm beginning to learn coding on sfdc lightning. I read about Ionic, Aura, AngularJS, Lightning, but am confused about how they work with each other, and when to use what? Sorry about this broad question but just wanting to find a starting point. Do I understand correctly that Lightning + Process Builder is for minimum coding, while Ionic + Angular JS is for heavier coding for more customized mobile app? thanks
I implemented SFDC sample FindNearbyWarehousesPage VF page and it was working and able to load google map until I created namespace in my org. Now it won't load anything when I click on FindWarehouse tab, it just gives a blank page (same thing on both desktop and salesforce1). Is it something to the new namespace? 

When I click the tab, the URL gives: https://a2z.na10.visual.force.com/apex/FindNearbyWarehousesPage?sfdc.tabName=01rF00000003KVR where a2z is the newly created namespace

here's code for FindNearbyWarehousesPage:

<apex:page sidebar="false" showheader="false" standardController="Warehouse__c" extensions="FindNearbyExt">
    
    <!-- Include in Google's Maps API via JavaScript static resource -->
    <apex:includeScript value="{!$Resource.googleMapsAPI}" /> 
    
    <!-- Set this API key to fix JavaScript errors in production -->
    <!--http://salesforcesolutions.blogspot.com/2013/01/integration-of-salesforcecom-and-google.html-->
    <!--<script type="text/javascript" 
        src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=false"> 
        </script>-->
        
    <!-- Setup the map to take up the whole window --> 
    <style>
        html, body { height: 100%; }
        .page-map, .ui-content, #map-canvas { width: 100%; height:100%; padding: 0; }
        #map-canvas { height: min-height: 100%; }
    </style>
    
    <script>
        function initialize() {
            var lat, lon;
              
             // If we can, get the position of the user via device geolocation
             if (navigator.geolocation) {
                 navigator.geolocation.getCurrentPosition(function(position){
                     lat = position.coords.latitude;
                     lon = position.coords.longitude;                    
                     
                     // Use Visualforce JavaScript Remoting to query for nearby warehouses      
                     Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.FindNearbyExt.getNearby}', lat, lon,
                         function(result, event){
                             if (event.status) {
                                 console.log(result);
                                 createMap(lat, lon, result);           
                             } else if (event.type === 'exception') {
                                 //exception case code          
                             } else {
                                            
                             }
                          }, 
                          {escape: true}
                      );
                  });
              } else {
                  // Set default values for map if the device doesn't have geolocation capabilities
                    /** San Francisco **/
                    lat = 37.77493;
                    lon = -122.419416;
                    
                    var result = [];
                    createMap(lat, lon, result);
              }
          
         }
    
         function createMap(lat, lon, warehouses){
            // Get the map div, and center the map at the proper geolocation
            var currentPosition = new google.maps.LatLng(lat,lon);
            var mapDiv = document.getElementById('map-canvas');
            var map = new google.maps.Map(mapDiv, {
                center: currentPosition, 
                zoom: 13,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            });
            
            // Set a marker for the current location
            var positionMarker = new google.maps.Marker({
                map: map,
                position: currentPosition,
                icon: 'http://maps.google.com/mapfiles/ms/micons/green.png'
            });
            
                        
            // Keep track of the map boundary that holds all markers
            var mapBoundary = new google.maps.LatLngBounds();
            mapBoundary.extend(currentPosition);
            
            // Set markers on the map from the @RemoteAction results
            var warehouse;
            for(var i=0; i<warehouses.length;i++){
                warehouse = warehouses[i];
                console.log(warehouses[i]);
                setupMarker();
            }
            
            // Resize map to neatly fit all of the markers
            map.fitBounds(mapBoundary);

           function setupMarker(){ 
                var warehouseNavUrl;
                
                // Determine if we are in Salesforce1 and set navigation link appropriately
                try{
                    if(sforce.one){
                        warehouseNavUrl = 
                            'javascript:sforce.one.navigateToSObject(\'' + warehouse.Id + '\')';
                    }
                } catch(err) {
                    console.log(err);
                    warehouseNavUrl = '\\' + warehouse.Id;
                }
                
                var warehouseDetails = 
                    '<a href="' + warehouseNavUrl + '">' + 
                    warehouse.Name + '</a><br/>' + 
                    warehouse.Street_Address__c + '<br/>' + 
                    warehouse.City__c + '<br/>' + 
                    warehouse.Phone__c;
               
               // Create the callout that will pop up on the marker     
               var infowindow = new google.maps.InfoWindow({ 
                   content: warehouseDetails
               });
               
               // Place the marker on the map   
               var marker = new google.maps.Marker({
                   map: map,
                   position: new google.maps.LatLng( 
                                   warehouse.Location__Latitude__s, 
                                   warehouse.Location__Longitude__s)
               });
               mapBoundary.extend(marker.getPosition());
               
               // Add the action to open up the panel when it's marker is clicked      
               google.maps.event.addListener(marker, 'click', function(){
                   infowindow.open(map, marker);
               });
           }
        }
        
        // Fire the initialize function when the window loads
        google.maps.event.addDomListener(window, 'load', initialize);
        
    </script>
    
    <!--  All content is rendered by the Google Maps code -->
    <!--  This minimal HTML justs provide a target for GMaps to write to -->
    <body style="font-family: Arial; border: 0 none;">
        <div id="map-canvas"></div>
    </body>
</apex:page>


 
I would like to sign up for the “Lightning Process Builder” and “Lightning App Builder” pilots.
I was reading up on Lightning and found this in their docs (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_benefits.htm): 
"Components are encapsulated and their internals stay private, while their public shape is visible to consumers of the component. This strong separation gives component authors freedom to change the internal implementation details and insulates component consumers from those changes."
Can someone explain in layman's terms for someone who is a beginner developer? thanks.