• Sonali_takke
  • NEWBIE
  • 55 Points
  • Member since 2017

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 21
    Replies
Hi i need to deserialize the json data into the selectlist , can any one please solve this issue..please .. 

Apex Class is :
public class test10 {

     public List<SelectOption> options {get;set;}

 public  test10(){
 
  check();
  }
  
  //wrapperclass1
   public class ContactWrapper {
   
        public string stateName{ get; set; }
        public string rating{get;set;}
        }
        
        
      public class overalldata
    {
        public List<ContactWrapper> overalldata;
    }  
  
    public void check(){
    
       overalldata conList = new overalldata();
    
     string  jsonstring='{ "sucess":1, "overalldata": [ {"stateName": "Andrapradesh",  "rating": "5.0" , "active": "yes" }, { "stateName": "Telangana",  "rating": "4.0" ,"active": "no" }, {"stateName": "Banglore",  "rating": "5.0" ,"active": "no"} , {"stateName": "Maharastra",  "rating": "4.5" ,"active": "no" }  ] } ';
     
     conList = (overalldata)System.JSON.deserialize(jsonstring, overalldata.class);
     
      System.debug('Respone- ' + conList);
     
    //getting data as this 
   //10:25:35:007 USER_DEBUG [31]|DEBUG|Respone- overalldata:[overalldata=(ContactWrapper:[rating=5.0, stateName=Andrapradesh], ContactWrapper:[rating=4.0, stateName=Telangana], ContactWrapper:[rating=5.0, stateName=Banglore], ContactWrapper:[rating=4.5, stateName=Maharastra])]
   
    }

  }

Visualforce page is:
 
<apex:page controller="test10">
 
  <apex:form >
        <apex:selectList >
            <apex:selectOptions value="{!options}"/>
            
             
        </apex:selectList>
        
      
       
    </apex:form>
 
 
</apex:page>

in the above selecoptions, the itemlabel  wil be stateName and itemvalue is rating.. please help to solve this issue..

thanks and regards

deepika

 
I currently have apex class in lightning component that is getting a specific Queue Id to assign as owner of the record the component is launched from.

This is the current  way I'm getting the id, but I'm guessing there is a better way to do this, any ideas?
Group marketingQueue = [SELECT id,Name FROM Group WHERE Type = 'Queue' and DeveloperNAME = 'MarketingProspectLeads'];
         	ID marketingQueueId = marketingQueue.id;
            //l.OwnerId = UserInfo.getUserId();
            system.debug('marketingQueue');
            l.OwnerId = marketingQueueId;

I just need to make sure this can't break so I'm assuming I should add some error checking or be doing this a different way.  Thanks in advance.  

Hi Developers,

  • I have created Bypass_Validation checkbox with default value as FALSE.
  • I updated Validation Rule Formula to include the line Bypass_Validation = FALSE 
  •  I am setting it to TRUE to bypass validation rule through apex\
  • Now I need to Set Bypass_Validation back to False so that Validation rule will fire when user creates records through UI.
  • I have created new process builder on that object to set it FALSE but when process builder sets it to FALSE it again trigges validation rules.
Can anyone guide me on this issue?

 

Hello All,

I have implemented live agent with prechat form.
i tried to find contact with matched prechat details it always return single record.
Even multiple records are availble in orgs. I want a list of records which match details in prechat form.
Any help would be appreciated.

Thank You.
Hi All,
I need you help. I am trying to create a New Button or Link on opportunity ( under Lightning UX).
I would like this button (URL button) to replace the standard "New" Button on opportunity list view and opportunity related list on account.

I would like to create a new opportunity with predefined values for stage and close date fields.
When creating a new opportunity I would like stage = "New" and close date = TODAY()+30.
I read several articles and tried to do it by myself without any success.

Can you please help me ?
Thanks in advance
Best Regards

Sabrina
Hi i need to deserialize the json data into the selectlist , can any one please solve this issue..please .. 

Apex Class is :
public class test10 {

     public List<SelectOption> options {get;set;}

 public  test10(){
 
  check();
  }
  
  //wrapperclass1
   public class ContactWrapper {
   
        public string stateName{ get; set; }
        public string rating{get;set;}
        }
        
        
      public class overalldata
    {
        public List<ContactWrapper> overalldata;
    }  
  
    public void check(){
    
       overalldata conList = new overalldata();
    
     string  jsonstring='{ "sucess":1, "overalldata": [ {"stateName": "Andrapradesh",  "rating": "5.0" , "active": "yes" }, { "stateName": "Telangana",  "rating": "4.0" ,"active": "no" }, {"stateName": "Banglore",  "rating": "5.0" ,"active": "no"} , {"stateName": "Maharastra",  "rating": "4.5" ,"active": "no" }  ] } ';
     
     conList = (overalldata)System.JSON.deserialize(jsonstring, overalldata.class);
     
      System.debug('Respone- ' + conList);
     
    //getting data as this 
   //10:25:35:007 USER_DEBUG [31]|DEBUG|Respone- overalldata:[overalldata=(ContactWrapper:[rating=5.0, stateName=Andrapradesh], ContactWrapper:[rating=4.0, stateName=Telangana], ContactWrapper:[rating=5.0, stateName=Banglore], ContactWrapper:[rating=4.5, stateName=Maharastra])]
   
    }

  }

Visualforce page is:
 
<apex:page controller="test10">
 
  <apex:form >
        <apex:selectList >
            <apex:selectOptions value="{!options}"/>
            
             
        </apex:selectList>
        
      
       
    </apex:form>
 
 
</apex:page>

in the above selecoptions, the itemlabel  wil be stateName and itemvalue is rating.. please help to solve this issue..

thanks and regards

deepika

 
I currently have apex class in lightning component that is getting a specific Queue Id to assign as owner of the record the component is launched from.

This is the current  way I'm getting the id, but I'm guessing there is a better way to do this, any ideas?
Group marketingQueue = [SELECT id,Name FROM Group WHERE Type = 'Queue' and DeveloperNAME = 'MarketingProspectLeads'];
         	ID marketingQueueId = marketingQueue.id;
            //l.OwnerId = UserInfo.getUserId();
            system.debug('marketingQueue');
            l.OwnerId = marketingQueueId;

I just need to make sure this can't break so I'm assuming I should add some error checking or be doing this a different way.  Thanks in advance.  

BASEURL/lightning/o/Opportunity__c/new?count=2&nooverride=1&uid=1569246940067&backgroundContext=...

What is uid paramter in salesforce URL?

When I creating record of custom object from Account Related list it generates above URL .What is UID ?

Thanks and Regards
Pratik Raut

Hi,
Is it possible to Create the customize link in salesforce  lead detail page for an task , when i click the link, lead activity's data send to my own site and store there for my customize work.

Thanks,
Durai
I have a record in account with billing city pune. Now I want to create a record with billing city pune but account information section values should be updated with previous record values whose billing city is pune. how I can achieve it
 
I need to convert my trigger into isInsert and isUpdate.
Trigger :

trigger GenerateTimeZone on Lead (before insert,before update) {
    List<Timezone_Setup_Data__mdt> TimezoneSetupList = [SELECT State__c,TimeZone__c FROM Timezone_Setup_Data__mdt];
    if ( TimezoneSetupList != null && !TimezoneSetupList.isEmpty() ){
        Map<String, String> timeZoneMap = new Map<String, String>();
        for(Timezone_Setup_Data__mdt convertToMap : TimezoneSetupList){
            timeZoneMap.put(convertToMap.State__c,convertToMap.TimeZone__c);
        }
        for(Lead leadRec:Trigger.New){
            if(leadRec.Borrower_AddressState__c != NULL){
                if(timeZoneMap.containsKey(leadRec.Borrower_AddressState__c)){
                    leadRec.Lead_Timezone__c = timeZoneMap.get(leadRec.Borrower_AddressState__c);
                }
            }
            else if(leadRec.Property_State__c != NULL){
                if(timeZoneMap.containsKey(leadRec.Property_State__c)){
                    leadRec.Lead_Timezone__c = timeZoneMap.get(leadRec.Property_State__c);
                }
            }
            else{
                   leadRec.Lead_Timezone__c='PST';
            }
        }
    } 

}
Hi All,
I have a requirement stating when I send an email using Send Email button in Activity history and open it by clicking subject, I want to place Resend button. When I click Resend that particular mail should go again. How can we do this? please sugest me which approach i can follow.

Thanks.
  • November 21, 2018
  • Like
  • 0
Here is my code
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint('http://api.geonames.org/countryCode?lat=52.42452&lng=10.7815&username=***');
        req.setHeader('Content-Type', 'text/html');
        req.setMethod('GET');
HttpResponse res = h.send(req);
 System.debug('country' + res.getBody()); ( return 'DE' as result)
 String Country = (String)res.getBody();
System.debug('the return value is'+Country); ( 'DE' as result )

ISOContry__c cs = ISOContry__c.getInstance(Country);
System.debug(cs); ( return null as result)
System.debug (' the A3 '+ cs.A3__c); ( Attempt to de-reference a null object)



      But when I try just to give the value as String  it is working so that's mean that the custom setting has the name 'DE' ! so really I don't understand what could be the problem

ISOContry__c cs2= ISOContry__c.getInstance('DE');
System.debug(cs2.A3__c); (it is working as expected)

 
  • September 19, 2018
  • Like
  • 0
Hello All,

I need an urgent help, how can I directly show the record to the sales rep in Edit mode instead of showing record detail page after Pre Chat form creates the case and contact record.
Can it be done use pre-chat API?
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