• vignesh balasubramanian 14
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 4
    Replies
Hi Everyone,

I have got the error while doing "Lightning Experience Customization" trailhead, please find the attached image give me the solution to complete this...


User-added image

Thanks in Advance,
Vignesh.B
Hi Everyone, Following code is not covered in test class, kindly help me to make it works,
 
queryString = 'SELECT '; for(Schema.FieldSetMember relationshipField :SObjectType.npe4__Relationship__c.FieldSets.Relationship_Field_Set.getFields()) { queryString += relationshipField.getFieldPath()+','; } queryString = queryString .removeEnd(','); queryString += ' FROM npe4__Relationship__c WHERE npe4__Contact__c IN (' + contactIdFilter + ')';

    relationshipList= new List<relationshipWrapper>();
    relationshipWrapper rel;
    for(npe4__Relationship__c  currRec: Database.query(queryString) ){
        rel= new relationshipWrapper(currRec);
        relationshipList.add(rel);
    }

 
Hi Everyone,

I have a picklist called relation If I choose the value(Step Brother) and save the record.It is displayed as stepbrother instead of Step Brother.Both label and API names are given as Step Brother.
Can you guys explain me why it is happen.

Thanks,
Vignesh.B
Hi Everyone,

Could you guys share me the code to save Salesforce lead records as CSV file using java bulk API.

Thanks, Vignesh.B
Hi Everyone,

Could you guys explain to me that how to add footnote in Salesforce email template.

Thanks,
Vignesh.B
Hi Everyone,

I have installed Public Knowledge Base in my Dev Org.But I have some problem when implementing the app.Give me a solution that how to configure the app.

Please find attached the file....

User-added image

Thanks,
Vignesh.B
Hi Everyone,

Could you please explain what is DKIM Key.How to use that in salesforce.Kindly provide example to explain the functinalities of this.

Thanks in Advance,
Vignesh.B
Hi Everyone,

I have a field called "Age" in contact object.when I create report for the contact records if Age<18 should be in red color and Age>=18 should be in green color.

How can we achieve this

Thanks in Advance,
Vignesh.B
Hi Everyone,

I want to display static List<String> in VF Page, give me solution for below problem,


Public static List<String> reslist{get;set;}
@future(callout=true)
    public static void futuremethod(Decimal lat,Decimal lng)
    {
        reslist=new List<String>();
        system.debug('future called');
        HttpRequest req = new HttpRequest();
        req.setEndPoint('https://developers.zomato.com/api/v2.1/geocode?lat='+lat+'&lon='+lng+'');
        req.setMethod('GET');
        req.setHeader('Accept', 'application/json');
        req.setHeader('user-key', '806bc2fff09af32e5cf1ed4b9c11de5c');
        Http http = new Http();
        HttpResponse res;
        if(!Test.isRunningTest())
        {
                String s='some text from response';
                reslist.add(s); 
        }
    }
    
    VF page:
    --------
    <apex:page standardController="Account" extensions="ShowRestaurant_AC">
    <apex:form >
        <apex:pageBlock >
            <apex:commandButton value="Show Restaurants" action="{!callfuture}"/>
            <apex:pageBlockSection title="Contacts in Map">
                <apex:map width="2000px" height="500px" mapType="roadmap" center="{!bstreet},{!bCity},{!bState}" zoomLevel="{!zoomvar}">
                   <apex:repeat value="{!reslist}" var="res">
                        <apex:mapMarker title="{!res}" position="{!res}"/>
                  </apex:repeat>       /**********************HERE I CANNOT DISPLAY STATIC VARIABLE*************************

                </apex:map>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>


I CANNOT DISPLAY reslit (STATIC LIST) IN VF PAGE.HOW TO DO THIS
Hi Everyone,

This is my Wrapper Class:
---------------------------------

public class Restaurantwrapper
{
    public cls_nearby_restaurants[] nearby_restaurants;
    class cls_nearby_restaurants 
    {
        public cls_restaurant restaurant;
    }
    class cls_restaurant 
    {
        public String name;
    }
    public static Restaurantwrapper parse(String json){
        return (Restaurantwrapper) System.JSON.deserialize(json, Restaurantwrapper.class);
    }
}

This is my Controller:
----------------------

  @future(callout=true)
    public static void futuremethod(Decimal lat,Decimal lng,String S)
    {
        system.debug('future called');
        HttpRequest req = new HttpRequest();
        req.setEndPoint(S);
        req.setMethod('GET');
        req.setHeader('Accept', 'application/json');
        Http http = new Http();
        HttpResponse res;
        if(!Test.isRunningTest())
        {
            res = http.send(req);
            Restaurantwrapper reswrapper = (Restaurantwrapper)JSON.deserialize(res.getBody(), Restaurantwrapper.class);
            for(Integer i=0;i<reswrapper.nearby_restaurants.size();i++)
            {
                //Here I want to assign restaurant name to a string variable
                //EX: String name=reswrapper.nearby_restaurants(i).restaurant.name;

            }
        }
    }
    
    I need to assign restaurant name to string variable,but the above code is not working.Provide me the solution for this.
    
    Thanks in Advance,
    Vignesh.B
Hi Everyone,

I need Rest API (End Point URL) to find hotels using geo-location.Could anyone provide this..

Thanks in advance,
Vignesh.B
Hi Everyone,

Can anyone share vf page and apex code to find hotels within 5kms from given Geolocation in Visualforcepage.
Hi Everyone,

Could anyone explain me that how to make Http callouts in batch class with example.

Note:Need to call the batch class from apex trigger
Hi Everyone,
This is my wrapper class,
public class JSON2Apex2 {
    public class Address_components {
        public String long_name;
        public String short_name;
        public List<String> types;
    }
    
    public class Geometry {
        public Location location;
        public String location_type;
        public Viewport viewport;
    }
    
    public class JSON2Apex {
        public List<Results> results;
        public String status;
    }
    
    public class Results {
        public List<Address_components> address_components;
        public String formatted_address;
        public Geometry geometry;
        public String place_id;
        public List<String> types;
    }
    
    public class Viewport {
        public Location northeast;
        public Location southwest;
    }
    
    public class Location {
        public Double lat{get;set;}
        public Double lng{get;set;}
    }
    public Location loc{get;set;}
    public static JSON2Apex2 parse(String json) {
        return (JSON2Apex2) System.JSON.deserialize(json, JSON2Apex2.class);
    }
}

This is my apex controller,
 
public class latlan_AC 
{
    static  List<Contact> contlist=new List<Contact>();
    String address;
    public  static JSON2Apex2 wrapper {get;set;}
    public latlan_AC(List<Contact> conlist)
    {
        for(Contact cntlist:conlist)
        {
            string jsonString = JSON.serializePretty(cntlist);
            callout(jsonString);
        }
        
        //callout(jsonString);
    }
    @future(callout=true)
    public static void callout(String  cnt1)
    {
        contact cnt =  (contact)JSON.deserializeStrict(cnt1, contact.class);
        String address=cnt.MailingStreet +','+cnt.MailingCity+','+cnt.MailingState+','+cnt.MailingCountry+','+cnt.MailingPostalCode;
        Http http = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint('https://maps.googleapis.com/maps/api/geocode/json?address='+address+'&key=AIzaSyDvf7W2SWXwUPXy8X2PSIGM6NwVusZywx4');
        req.setMethod('GET');
        req.setHeader('Content-Type', 'application/json');
        req.setHeader('Accept','application/json');
        HTTPResponse res = http.send(req);
        if(res.getStatusCode()==200)
        {
            wrapper = (JSON2Apex2) JSON.deserialize(res.getBody(), JSON2Apex2.class);
            system.debug('result'+ wrapper); //Here I got null value only how to display lat and lng values
        }
    }
}
My requiremayent is to display  public Double lat{get;set;} public Double lng{get;set;} values in apex controller

Thanks in Advance,
Vignesh.B
Hi Everyone,

Could you please explain what is DKIM Key.How to use that in salesforce.Kindly provide example to explain the functinalities of this.

Thanks in Advance,
Vignesh.B
Hi Everyone,

This is my Wrapper Class:
---------------------------------

public class Restaurantwrapper
{
    public cls_nearby_restaurants[] nearby_restaurants;
    class cls_nearby_restaurants 
    {
        public cls_restaurant restaurant;
    }
    class cls_restaurant 
    {
        public String name;
    }
    public static Restaurantwrapper parse(String json){
        return (Restaurantwrapper) System.JSON.deserialize(json, Restaurantwrapper.class);
    }
}

This is my Controller:
----------------------

  @future(callout=true)
    public static void futuremethod(Decimal lat,Decimal lng,String S)
    {
        system.debug('future called');
        HttpRequest req = new HttpRequest();
        req.setEndPoint(S);
        req.setMethod('GET');
        req.setHeader('Accept', 'application/json');
        Http http = new Http();
        HttpResponse res;
        if(!Test.isRunningTest())
        {
            res = http.send(req);
            Restaurantwrapper reswrapper = (Restaurantwrapper)JSON.deserialize(res.getBody(), Restaurantwrapper.class);
            for(Integer i=0;i<reswrapper.nearby_restaurants.size();i++)
            {
                //Here I want to assign restaurant name to a string variable
                //EX: String name=reswrapper.nearby_restaurants(i).restaurant.name;

            }
        }
    }
    
    I need to assign restaurant name to string variable,but the above code is not working.Provide me the solution for this.
    
    Thanks in Advance,
    Vignesh.B
Hi Everyone,

Could anyone explain me that how to make Http callouts in batch class with example.

Note:Need to call the batch class from apex trigger