• silpa garikapati
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 20
    Replies
Hi All,

When I am installing my package in my org . I am not able to view my app getting error i.e; Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 73753900-21089 (-1050088343).
Please help me.
Hi ,

I am getting an issue when uploading jquery script file  to get pagination in lightning component.
Issue is  
Uncaught TypeError: Cannot read property 'expando' of undefined throw

 
Hi ,

I am getting an issue when uploading jquery script file  to get pagination in lightning component.
Issue is  
Uncaught TypeError: Cannot read property 'expando' of undefined throw

 
Hi ,

I am getting an issue when uploading jquery script file  to get pagination in lightning component.
Issue is  
Uncaught TypeError: Cannot read property 'expando' of undefined throw

 
I'm struggling with the custom lightning component on this part. I don't have much background coding and am having trouble finding resources to help me achieve coding the lightning component. If someone could help give me some framework code to create a custom lightning component to hold a URL or direct me to a resource that help break this down I'd be very appreciative.
 
Hello,

I started this new superbadge yesterday and I am wondering if there is an issue with step 7: Set up reporting for sales managers in Lightning Experience.

I believed to have done everything right () report was created, added to Account, Dashboard was created. But I received the following error: 
   
ERROR: The Opportunities Pipeline report must: 
        1. Display data for all time, 
        2. Show opportunities by stage, 
        3. Contain a funnel chart, 
        4. Provide the information required by the dashboard.
I am trying to understand it, but the requirements and point 4 in the error message makes it a little unspecific (I can dismiss error 1,2,3 easily)... What information do they want to show on the Dashboard? I created all 3 charts but I guess I am not displaying the correct metrics...    
  • September 06, 2017
  • Like
  • 0
Hey!

 So we installed Box app, and enabled all permissions, signed in with service account and personal accounts but still unable to see anything on the box files tab as well as box component panel on standard and custom objects .

Does the installation apply to the new salesforce lightning version?  Or are there specific admin settings that need to be changed as well for it to show up?

FYI:  box files tab is completely empty without any box  references as well as component boxes in standard and custom objects.  It looks as though it is not even connecting to Box.com 

 All help would be greatly appreciate it !
Hi I have a following lightning component code.
============My Component =============
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" controller="MyClass">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:attribute name="myMap" type="Map" />
</aura:component>
======================================

The map 'myMap' is loaded with some data through the controller.
Im not getting how will I access the value from the map "myMap" inside the component.

I dont want to iterate over the map
Just need to access a value from It something like myMap.get('Key1') inside the component;

=========MyComponentController==========
({
   doInit: function(component, event, helper) {      

       var action = component.get('c.getMap');
        
        action.setCallback(this,function(result){
            component.set('v.myMap',result.getReturnValue());
        });
        $A.enqueueAction(action);
     }
})
============================

==========MyClass=============
public with sharing class MyClass
{
      public static MAP<String,String> getMap()
      {
          Map<String,String> map = new Map<String,String>();
          map.put('key1','value1');
          map.put('key2','value2');
          return map;
      }
}
=================================
how can the roles impact on the security model?
Hi Everyone,

I want to get google map for current location viewing  & longitude and latitude without api key.

google javascript api v3  js file Link
https://maps.googleapis.com/maps/api/js

Codes:

1.VF Code:
<apex:page sidebar="false" showheader="false" standardController="Account"  extensions="FindNearby">
    
    <!-- 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?v=3.exp&sensor=false"> <!-- We try to get google mapy without API Key (Javascript V3) but i did not show the current location as well as longitude and latitude -->
<!-- src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAowmYdY3dZwoe4qI1I_X8Ry-UPepb5dpA&sensor=false">   previously we used API key to generate Google Map but  the usage of API key is very limited(Only 4 times)  -->

        </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 accts      
                     Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.FindNearby.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
                    /** Eindhoven **/
                    lat = 12.9172;
                    lon = 80.1929;
                    
                    var result = [];
                    createMap(lat, lon, result);
              }
          
         }
    
         function createMap(lat, lon, accts)
    {
            // 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.ROADTYPE
            });
           
            // 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/pink.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 acct;
            for(var i=0; i<accts.length;i++){
                acct = accts[i];
                console.log(accts[i]);
                setupMarker();
            }
            
            // Resize map to neatly fit all of the markers
            map.fitBounds(mapBoundary);

           function setupMarker(){ 
                var acctNavUrl;
                
                // Determine if we are in Salesforce1 and set navigation link appropriately
                try{
                    if(sforce.one){
                        acctNavUrl = 
                            'javascript:sforce.one.navigateToSObject(\'' + acct.Id + '\')';
                    }
                } catch(err) {
                    console.log(err);
                    acctNavUrl = '\\' + acct.Id;
                }
                
                var acctDetails = 
                    '<a href="' + acctNavUrl + '">' + 
                    acct.Name + '</a><br/>' + 
                    acct.BillingStreet + '<br/>' + 
                    acct.BillingCity + '<br/>' + 
                    acct.Phone;
               
               // Create the callout that will pop up on the marker     
               var infowindow = new google.maps.InfoWindow({ 
                   content: acctDetails
               });
               
               // Place the marker on the map   
               var marker = new google.maps.Marker({
                   map: map,
                   position: new google.maps.LatLng( 
                                   acct.Location__Latitude__s, 
                                   acct.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>
    
    
    <body style="font-family: Arial; border: 0 none;">
       
   <!--  All content is rendered by the Google Maps code -->
    <!--  This minimal HTML justs provide a target for GMaps to write to -->
        <div id="map-canvas"></div>
    </body>
</apex:page>

2.Apex Class --- FindNearby
global with sharing class FindNearby {

   public FindNearby(ApexPages.StandardController sc){} 
    
    @RemoteAction
    // Find Accounts nearest a geolocation
    global static List<Account> getNearby(String lat, String lon) {

        // If geolocation isn't set, use Eindhoven (or any other city)
        // Put a default location latitue and longitude here, this could be where you are located the most
        // and will only be used as a backup if the browser can not get your location details
        if(lat == null || lon == null || lat.equals('') || lon.equals('')) {
            lat = '51.096214';
            lon = '3.683153';
        }

        // SOQL query to get the nearest accounts
        //you can change km (kilometers) into mi (miles)
        // < 20 means within a radius of 20 km or mi (you can change that)
        //limit 25 shows 25 records (you can adapt that too if you want)
        String queryString =
            'SELECT Id, Name, Location__Longitude__s, Location__Latitude__s, ' +
                'BillingStreet, Phone, BillingCity ' +
            'FROM Account ' +
            'WHERE DISTANCE(Location__c, GEOLOCATION('+lat+','+lon+'), \'km\') < 20 ' +
            'ORDER BY DISTANCE(Location__c, GEOLOCATION('+lat+','+lon+'), \'km\') ' +
            'LIMIT 25';

        // Run and return the query results
        return(database.Query(queryString));
    }
}

3.Apex Trigger
// Trigger runs getLocation() on Accounts with no Geolocation
trigger SetGeolocation on Account (after insert, after update) {
    for (Account a : trigger.new){
        if(Trigger.isUpdate){
            if(a.BillingStreet != Trigger.oldMap.get(a.id).BillingStreet || a.BillingCity != Trigger.oldMap.get(a.id).BillingCity || a.BillingPostalCode != Trigger.oldMap.get(a.id).BillingPostalCode){
                LocationCallouts.getLocation(a.id);
            }
        }
        if (a.Location__Latitude__s == null)
            LocationCallouts.getLocation(a.id);
}
}

4.Apex Class

public class LocationCallouts {
 
     @future (callout=true)  // future method needed to run callouts from Triggers
      static public void getLocation(id accountId){
        // gather account info
        Account a = [SELECT BillingCity,BillingCountry,BillingPostalCode,BillingState,BillingStreet FROM Account WHERE id =: accountId];
 
        // create an address string
        String address = '';
        if (a.BillingStreet != null)
            address += a.BillingStreet +', ';
        if (a.BillingCity != null)
            address += a.BillingCity +', ';
        if (a.BillingState != null)
            address += a.BillingState +' ';
        if (a.BillingPostalCode != null)
            address += a.BillingPostalCode +', ';
        if (a.BillingCountry != null)
            address += a.BillingCountry;
 
        address = EncodingUtil.urlEncode(address, 'UTF-8');
 
        // build callout
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint('http://maps.googleapis.com/maps/api/geocode/json?address='+address+'&sensor=false');
        req.setMethod('GET');
        req.setTimeout(6000);
 
        try{
            // callout
            HttpResponse res = h.send(req);
             System.debug(res.getBody());
            // parse coordinates from response
            JSONParser parser = JSON.createParser(res.getBody());
            double lat = null;
            double lon = null;
            while (parser.nextToken() != null) {
                if ((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&
                    (parser.getText() == 'location')){
                       parser.nextToken(); // object start
                       while (parser.nextToken() != JSONToken.END_OBJECT){
                           String txt = parser.getText();
                           parser.nextToken();
                           if (txt == 'lat')
                               lat = parser.getDoubleValue();
                           else if (txt == 'lng')
                               lon = parser.getDoubleValue();
                       }
 
                }
            }
 
            // update coordinates if we get back
            if (lat != null){
                a.Location__Latitude__s = lat;
                a.Location__Longitude__s = lon;
                update a;
            }
 
        } catch (Exception e) {
        }
    }
}

Thanks in advance,
If anybody know please tell me.

Thanks and Regards,
Sivasankari.M
I am calling a rest API from javascript from third party appplication outside salesforce and  getting this issue:-

XMLHttpRequest cannot load https://login.salesforce.com/services/oauth2/token. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 400.


My Code:- 
$.ajax({
                    type: 'GET',
                    url: 'https://login.salesforce.com/services/oauth2/token',
                    contentType: 'application/json',
                    dataType: 'json',
                    beforeSend: function(xhr) {
                        xhr.setRequestHeader('grant_type','password'),
                        xhr.setRequestHeader('client_id',  'CLIENT_ID'),
                        xhr.setRequestHeader('client_secret', 'LIENT_SECRET'),
                        xhr.setRequestHeader('username', 'Username'),
                        xhr.setRequestHeader('password', "Password+securityToken")
                    },
                    success: function(response) {
                        console.log('Successfully retrieved ' + response);
                        //Other logic here
                    },
                    error: function(response) {
                        console.log('Failed ' + response.status + ' ' + response.statusText);
                        //Other logic here
                    }
                });


I have made an Connected app adn provide access to that user in Profile settings.

Here are some of my questions:-
1. The callback url in connected app can be http://localhost or should be a proper server URL.
2. Do i need to add http://localhost(server URL) in CORS and REMOTE settings
3. Server URL should be HTTPS (secured)

Please help me in this.

Thanks in advance!
4. I mentioned my error above , please help me in resolving it.
                

 

Create a formula field that determines the number of days between today and the last activity date for a case's account.
Your support team has asked for improved visibility on account activity level at the time they’re helping with customer issues. Specifically, when they’re looking at a case, they’d like to see an at-a-glance view of the number of days since the case’s related account was last active. Create the formula using these requirements.The formula should be on the Case object.
The formula should be of return type Number.
The formula should be named 'Days Since Last Update' and have a resulting API Name of 'Days_Since_Last_Update__c'.
The formula should return the number of days between the account’s Last Activity Date and today.

I tried doing this using this formula. TODAY()  -  Account.LastActivityDate  No errors on the formula but I get this when I try to check challenge.

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: Delete failed. First exception on row 0 with id 0016100000JUWKJAA5; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You can't delete this record!: []

I need help with this. Thanks in advance.

 
Hey Friends,
I am new in salesforce,
I am Stuck on writting test class for Trigger .
Below my  Code:
trigger add_questions_balwadi_batch on UP_Batch__c (before insert, before update)
{
List<UP_Question__c> piq = [Select id,Name from UP_Question__c];
for(UP_Batch__c upb : trigger.new)
{
    if(upb.Program__c == 'Balwadi')
    {
        upb.Q_1__c = piq[0].id;
        upb.Q_2__c = piq[1].id;
        upb.Q_3__c = piq[19].id;
        upb.Q_4__c = piq[2].id;
        upb.Q_5__c = piq[5].id;
        upb.Q_6__c = piq[12].id;
        upb.Q_7__c = piq[6].id;
        upb.Q_8__c = piq[15].id;
        upb.Q_9__c = piq[3].id;
        upb.Q_10__c = piq[14].id;
        upb.Q_11__c = piq[11].id;
        upb.Q_12__c = piq[10].id;
        upb.Q_13__c = piq[9].id;
        upb.Q_14__c = piq[13].id;
        upb.Q_15__c = piq[17].id;
        upb.Q_16__c = piq[18].id;
        upb.Q_17__c = piq[8].id;
        upb.Q_18__c = piq[16].id;
        upb.Q_19__c = piq[7].id;
        upb.Q_20__c = piq[4].id;
                                                       
    }
}

}
 

I know how to get into the page layout editor and add fields and buttons and move things around.

 

I need to add a new section.  I don't see any button or menu item or anything for adding sections.

 

Anyone know where it is?

 

Hi,

I have created a custom list button and want to add this to the list view as well as related lists. I was able to add this custom button to the related list, but not to the standard list page. I am going to the object settings and am adding it to the list view layout, but the button is not showing. How do I get this displayed in the List view?

Thanks

KD 

  • June 20, 2009
  • Like
  • 0