• roni shore
  • NEWBIE
  • 90 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 28
    Replies
Hi guys, I am trying to insert community user through but its failing.
Code
====
 @Future  
    public static void createCommunityUser(Set<Id> contactIdSet){
        List<Contact> contactList = [SELECT 
                                           Id,LastName,Email 
                                           FROM Contact 
                                           WHERE Id IN: contactIdSet];
        List<User> userList = new List<User>();
        List<Profile> profileList = [SELECT 
                                            Id 
                                            FROM Profile 
                                            WHERE Name = 'Customer Community User' 
                                            LIMIT 1];
        List<UserRole> roleList = [SELECT 
                                        Id,PortalType
                                        FROM UserRole 
                                        WHERE PortalType = 'None'
                                       ];
                                       
        for(Contact contactObj : contactList){
            User uObj = new User();
            uObj.LastName = contactObj.LastName;
            uObj.ContactId = contactObj.Id;
            uObj.Username = contactObj.Email;
            uObj.Email = contactObj.Email;
            String lstName = contactObj.LastName;
            uObj.ProfileId = profileList[0].Id;
            uObj.UserRoleId = roleList[0].Id;
            uObj.IsActive = true; 
            uObj.TimeZoneSidKey = 'GMT';
            uObj.LanguageLocaleKey = 'en_US';
            uObj.EmailEncodingKey = 'UTF-8';
            uObj.LocaleSidKey = 'en_US';
            uObj.CommunityNickname = contactObj.LastName;
            String identifier = contactObj.Email;
            //uObj.UserType = 'CustomerSuccess';               
            userList.add(uObj);
        }
        try{
            /* Insert the user record */
            Insert userList;  
        }Catch(Exception e){
            System.debug('Error Occured at Community User Creation : '+e.getMessage());
        }   
        System.debug('Community Users ->'+userList);
    }    
   please suggest
Hi guys,
I am using a formula to show an image based on picklist values, its coming correct but if I modify the formula to accommodate one more picklist values the formula saves but doesn't show the image. plz suggest
formula
======
This works fine

CASE(Lost__c,"Old",""&" "&IMAGE((LEFT($Api.Partner_Server_URL_260, FIND('/services',$Api.Partner_Server_URL_260))+"resource/1247929509000/lost"), "False"),NULL)

if one more picklist val added the image doesn't show

CASE(Lost__c,"Old","","Lost-Z6",""&" "&IMAGE((LEFT($Api.Partner_Server_URL_260, FIND('/services',$Api.Partner_Server_URL_260))+"resource/1247929509000/lost"), "False"),NULL)
 
Public Class Customer_Controller{
    
    ApexPages.StandardController controller;
     @TestVisible private final Case thisCase;

    public Customer_Controller(ApexPages.StandardController controller) {
        this.controller = controller;
        this.thisCase = (Case)controller.getRecord();
    }
    public Boolean isTScase {
        get {
            return (((String)thisCase.RecordTypeId).left(15) == Label.Caseod_RecordType);
        }
    }
    public Boolean isCScase {
        get {
            return (((String)thisCase.RecordTypeId).left(15) == Label.Casenew_recordtype);
        }
    }

error : Compile Error: Variable is not visible:
Hi Guys- m trying to write test class for the below controller but getting a null pointer exception. please suggest.
controller
=======
Public Class Customer_Controller{
    
    ApexPages.StandardController controller;
     @TestVisible private final Case thisCase;

    public PB_Contact_Locale_Customer_Controller(ApexPages.StandardController controller) {
        this.controller = controller;
        this.thisCase = (Case)controller.getRecord();
    }
    public Boolean iscasenew {
        get {
            return (((String)thisCase.RecordTypeId).left(15) == Label.Case_RecordType);
        }
    }
    //Save method overriden
    public PageReference save(){
        try{
            controller.save();
            PageReference nextPage = new PageReference('/'+((Case)controller.getRecord()).Id);
            return nextPage;
            
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,e.getMessage()));
        }
        return null;
    }
    //redirect to case create url
    public PageReference saveAndNew(){
        try{
            controller.save();
            return new PageReference(getRedirectURL());
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,e.getMessage()));
        }
        return null;
    }
    
    //Cancel method overriden
    public PageReference cancel(){
        return new PageReference('/'+((Case)controller.getRecord()).Id);
    }
 @TestVisible private String getRedirectURL(){
​..
}}
Hi Guys - I need to fetch the Label of Account from case object i.e. Account Name in VF. Account has a lookup to case
m using  <apex:outputLabel value="{!$ObjectType.Case.fields.Account.Label}"/>

but getting error

Please suggest
 
Hi guys, I have renamed the internal comments standard field on case  object to comments but it still appears on the layout as internal comments.
plz suggest
 
accountLIst = [querying Accounts here] 
 Map<String,Validation__c> mcs = R2_Validation__c.getAll();
            system.debug('mcs====>'+mcs);                              
            for(Account acc : accountList){
                          billingCountry = acc.BillingCountry;
            Validation__c mc = Validation__c.getValues(BillingCountry);
            system.debug('mc====>'+mc); 

Getting value on mc null. Please suggest
Hi guys- I am writing a piece of code that will exclude countries form validation if those are present in custom setting, but m getting  null pointer exception on that.
 Map<String, Map<String, String>> mapCountry = new Map<String, Map<String, String>>();
            for(State__c st : [Select id, Name, Country__r.Name from State__c]) {
                if(!mapCountry.containsKey(st.Country__r.Name)) {
                    Map<String, String> mapST = new Map<String, String>();
                    mapCountry.put(st.Country__r.Name, mapST);
                }
                mapCountry.get(st.Country__r.Name).put(st.Name, st.Name);
            }
            //quering some account here

for(Account acc : accountList){
                billingCountry = acc.BillingCountry;
                // Check Country & State is valid
                if(!mapCountry.containsKey(acc.BillingCountry)) {
                    errorFlag = true;
                    errorMsg = new ApexPages.Message(ApexPages.Severity.ERROR, System.Label.Bad_Country_Value);
                    ApexPages.addMessage(errorMsg);
                } else if(!mapCountry.get(acc.BillingCountry).containsKey(acc.BillingState)) {
                    errorFlag = true;
                    errorMsg = new ApexPages.Message(ApexPages.Severity.ERROR, System.Label.Bad_Value);
                    ApexPages.addMessage(errorMsg);
                }


In this second else if condition i have to check if the countries are in custom setting (bypass_counry__c) in the field (country__c) then bypass validation.

PLease suggest
Hi - can anyone please help me with the test class for below, I have written the test class but it's not covering the else block
class
====
public class Comm_Locale { 
   public  User ur = new User();
   public String redirectUrl {get;set;}
   public Comm_Locale(){
   Map<String,global__c> cSetting_Map = Locale_on_Global__c.getAll();
        ur = [Select id, Contact.Locale__c FROM User where Id =: UserInfo.getUserId()];
        if(String.isNotBlank(ur.Contact.Locale__c)){
            global__c  cSettingList = cSetting_Map.get(ur.Contact.Locale__c);  
            if(String.isNotBlank(cSettingList.Account_URL__c)){
                redirectUrl = cSettingList.Account_URL__c;
            }else{
                redirectUrl = 'https//:www.google.com';
            }
        }else{
            // Need to assign default web link if required
            redirectUrl = 'https//:www.google.com';
        }
    }


test class
======
@isTest
private class Comm_Locale_tetd{
   static testMethod void CheckLocale() {
       Global__c log = new Global__c(name = 'test',Account_URL__c = 'https://www.test.com');
       insert log;
       contact con = new contact(LastName = 'test name',Locale__c = 'en_US');
       insert con;
       Comm_Locale pbc = new Comm_Locale ();
     }
Hi guys- I have two classes, I need to call the 2nd class method in the 1st class. So,as if the url is not present in the Label then it should take the value from the 2nd class method. I tried passing the method but it didnt work

1) public class urlredirector{
 public PageReference router() {
         PageReference pageReference = new PageReference(System.label.your_URL);   
         pageReference.setRedirect(true); 
}
}

2) public class testUrl{
private String getRedURL(){
       
    }
}
Hi Guys- I ran into an issue "Severe Error observed when attempting to attach articles to cases in portals". According to the salesforce success blog it says it's a know issue and is fixed in summer 14 patch

link -  https://success.salesforce.com/issues_view?id=a1p30000000T3zEAAS&title=severe-error-observed-when-attempting-to-attach-articles-to-cases-in-portals 

but I do not see it working in my org. can anyone help me out with this, do I need to install this patch? or any approach.

Thanks,
Hi- guys, I have a controller, Not sure how to call the page in test class, suggstions pls
public with sharing class Address{ 
    
    public String Ser{get;set;}
    
    public Address(){     
        List<Service__c> Records = [SELECT Name 
                                            FROM Service__c
                                            WHERE Billing__c = :ApexPages.currentPage().getParameters().get('Id')];
        
        if(Records.size() > 0){
            for(Service__c a : Records){   
                if(Ser != null && Ser != ''){         
                    Ser = Ser + ';' + a.Name;
                }else{
                    Ser= a.Name;
                } 
            }
        } 
    }
}
Hi Guys - I have written a controller which is being used in an vf component. My issue is I need to display adresses comma seperated.
pls suggest 

controller
------------
public with sharing class DisplayList{ 
    public List<Address__c> Records {get; set;} 
    
    public DisplayList(){ 
    Records = [SELECT Name 
               FROM Address__c
               WHERE Billing_Account__c = :ApexPages.currentPage().getParameters().get('Id')];
    system.debug('record-->'+Records); 
    } 
 }
vf component snippet
=----------------------------
 </apex:repeat>
        <apex:repeat value="{!Records}" var="Record">
         <div><span>Service Addresses:</span><span><apex:outputText value="{!Record.Name}" escape="false"/></span></div>
    </apex:repeat>
 
Hi Guys- I have an custom object "Address__c" related to Account, when passing the account id there I am not getting any records, please suggest

public with sharing class DisplayQueryList{ 
    public List<Address__c> Records {get; set;} 
    public DisplayQueryList(){ 
    Records = [select Id,Name FROM Address__c WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    system.debug('record-->'+Records); 
    } 
     
}
Hi Guys- I have a vf page which is refrencing vf components. I ran into an issue based where if I change the order of vf page it shows the icon else it doesn't.
code
-------
 <div id="mainDiv" class="slds-tabs_default slds-theme_default">
        <ul class="slds-tabs_default__nav" role="tablist">
            <li class="slds-tabs_default__item slds-is-active" title="Events" role="presentation"><a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="0" aria-selected="true" aria-controls="tab-default-1" id="tab-default-1__item">tab1</a></li>
            <li class="slds-tabs_default__item" title="Products" role="presentation"><a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="-1" aria-selected="false" aria-controls="tab-default-2" id="tab-default-2__item">tab2</a></li>
            <li class="slds-tabs_default__item" title="Orders" role="presentation"><a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="-1" aria-selected="false" aria-controls="tab-default-3" id="tab-default-3__item">tab3</a></li>
        </ul>
        <div id="tab-default-1" class="slds-tabs_default__content slds-show" role="tabpanel" aria-labelledby="tab-default-1__item"><c:Activity acctRecord="{!acct}"/></div>
        <div id="tab-default-3" class="slds-tabs_default__content slds-hide" role="tabpanel" aria-labelledby="tab-default-3__item"><c:act2 accountRecord="{!acct}"/></div>
        <div id="tab-default-2" class="slds-tabs_default__content slds-hide" role="tabpanel" aria-labelledby="tab-default-2__item"><c:Activity3 acctRecord="{!acct}"/></div>


------------------------------------
The lines in bold, the first one shows icons while the third one doesn't . If I change the order the third shows and second doesn't
Hi Guys -  I have a issue in a vf component for displaying icons in IE. I have used svg4everybody but it doen't seems to work.

have created multiple vf components and refering them in a vf page.

please suggest.
hi guys can anyone please suggest how to write test class of the controller, I am unable to cover anything
controller
-------------
public with sharing class ConsoleOrderActivityController {
    public Account acct { get; set; }
    public ConsoleOrderActivityController() {}
    public  List<OrderWrapper> orderWrappers{
        get{
            if(orderWrappers == null && (acct != null || acct.Id != null)){
                orderWrappers =new List<OrderWrapper>() ;
                for(Order o : [SELECT Name,Status,EffectiveDate,OrderNumber FROM Order 
                               WHERE AccountId = :acct.Id 
                               ORDER BY EffectiveDate DESC]) {
                    orderWrappers.add(new OrderWrapper(o));
                  }
            }
            return orderWrappers;
        }
        private set;
    }     
    public class OrderWrapper {
        public Order odr { get; set; }
        public String url{ get; set; }
        public OrderWrapper(Order odr) {
            this.odr = odr;
            this.url = '/'+odr.Id+'?nooverride=1';
        }
    }
}
how to wrap all the lightning components together..so that on click of next and previous button next and previous components gets displayed
can anyone please suggest how to create a dependent hirerachy checkbox using salesforce lightning. something like
- ab
  - abc
  -abcd

so if ab is checked so both abc & abcd should be checked and if any of the sub chek box is checked then ab is check....please suggest​
I am trying to make an outbound message using outbound message in workflows but getting this "javax.net.ssl.SSLPeerUnverifiedException: Received fatal alert: unknown_ca" 
 
Hi guys, I am trying to insert community user through but its failing.
Code
====
 @Future  
    public static void createCommunityUser(Set<Id> contactIdSet){
        List<Contact> contactList = [SELECT 
                                           Id,LastName,Email 
                                           FROM Contact 
                                           WHERE Id IN: contactIdSet];
        List<User> userList = new List<User>();
        List<Profile> profileList = [SELECT 
                                            Id 
                                            FROM Profile 
                                            WHERE Name = 'Customer Community User' 
                                            LIMIT 1];
        List<UserRole> roleList = [SELECT 
                                        Id,PortalType
                                        FROM UserRole 
                                        WHERE PortalType = 'None'
                                       ];
                                       
        for(Contact contactObj : contactList){
            User uObj = new User();
            uObj.LastName = contactObj.LastName;
            uObj.ContactId = contactObj.Id;
            uObj.Username = contactObj.Email;
            uObj.Email = contactObj.Email;
            String lstName = contactObj.LastName;
            uObj.ProfileId = profileList[0].Id;
            uObj.UserRoleId = roleList[0].Id;
            uObj.IsActive = true; 
            uObj.TimeZoneSidKey = 'GMT';
            uObj.LanguageLocaleKey = 'en_US';
            uObj.EmailEncodingKey = 'UTF-8';
            uObj.LocaleSidKey = 'en_US';
            uObj.CommunityNickname = contactObj.LastName;
            String identifier = contactObj.Email;
            //uObj.UserType = 'CustomerSuccess';               
            userList.add(uObj);
        }
        try{
            /* Insert the user record */
            Insert userList;  
        }Catch(Exception e){
            System.debug('Error Occured at Community User Creation : '+e.getMessage());
        }   
        System.debug('Community Users ->'+userList);
    }    
   please suggest
Hi guys,
I am using a formula to show an image based on picklist values, its coming correct but if I modify the formula to accommodate one more picklist values the formula saves but doesn't show the image. plz suggest
formula
======
This works fine

CASE(Lost__c,"Old",""&" "&IMAGE((LEFT($Api.Partner_Server_URL_260, FIND('/services',$Api.Partner_Server_URL_260))+"resource/1247929509000/lost"), "False"),NULL)

if one more picklist val added the image doesn't show

CASE(Lost__c,"Old","","Lost-Z6",""&" "&IMAGE((LEFT($Api.Partner_Server_URL_260, FIND('/services',$Api.Partner_Server_URL_260))+"resource/1247929509000/lost"), "False"),NULL)
 
Hi guys, I have renamed the internal comments standard field on case  object to comments but it still appears on the layout as internal comments.
plz suggest
 
Hi - can anyone please help me with the test class for below, I have written the test class but it's not covering the else block
class
====
public class Comm_Locale { 
   public  User ur = new User();
   public String redirectUrl {get;set;}
   public Comm_Locale(){
   Map<String,global__c> cSetting_Map = Locale_on_Global__c.getAll();
        ur = [Select id, Contact.Locale__c FROM User where Id =: UserInfo.getUserId()];
        if(String.isNotBlank(ur.Contact.Locale__c)){
            global__c  cSettingList = cSetting_Map.get(ur.Contact.Locale__c);  
            if(String.isNotBlank(cSettingList.Account_URL__c)){
                redirectUrl = cSettingList.Account_URL__c;
            }else{
                redirectUrl = 'https//:www.google.com';
            }
        }else{
            // Need to assign default web link if required
            redirectUrl = 'https//:www.google.com';
        }
    }


test class
======
@isTest
private class Comm_Locale_tetd{
   static testMethod void CheckLocale() {
       Global__c log = new Global__c(name = 'test',Account_URL__c = 'https://www.test.com');
       insert log;
       contact con = new contact(LastName = 'test name',Locale__c = 'en_US');
       insert con;
       Comm_Locale pbc = new Comm_Locale ();
     }
Hi Guys - I have written a controller which is being used in an vf component. My issue is I need to display adresses comma seperated.
pls suggest 

controller
------------
public with sharing class DisplayList{ 
    public List<Address__c> Records {get; set;} 
    
    public DisplayList(){ 
    Records = [SELECT Name 
               FROM Address__c
               WHERE Billing_Account__c = :ApexPages.currentPage().getParameters().get('Id')];
    system.debug('record-->'+Records); 
    } 
 }
vf component snippet
=----------------------------
 </apex:repeat>
        <apex:repeat value="{!Records}" var="Record">
         <div><span>Service Addresses:</span><span><apex:outputText value="{!Record.Name}" escape="false"/></span></div>
    </apex:repeat>
 
Hi Guys- I have an custom object "Address__c" related to Account, when passing the account id there I am not getting any records, please suggest

public with sharing class DisplayQueryList{ 
    public List<Address__c> Records {get; set;} 
    public DisplayQueryList(){ 
    Records = [select Id,Name FROM Address__c WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    system.debug('record-->'+Records); 
    } 
     
}
Hi Guys- I have a vf page which is refrencing vf components. I ran into an issue based where if I change the order of vf page it shows the icon else it doesn't.
code
-------
 <div id="mainDiv" class="slds-tabs_default slds-theme_default">
        <ul class="slds-tabs_default__nav" role="tablist">
            <li class="slds-tabs_default__item slds-is-active" title="Events" role="presentation"><a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="0" aria-selected="true" aria-controls="tab-default-1" id="tab-default-1__item">tab1</a></li>
            <li class="slds-tabs_default__item" title="Products" role="presentation"><a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="-1" aria-selected="false" aria-controls="tab-default-2" id="tab-default-2__item">tab2</a></li>
            <li class="slds-tabs_default__item" title="Orders" role="presentation"><a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="-1" aria-selected="false" aria-controls="tab-default-3" id="tab-default-3__item">tab3</a></li>
        </ul>
        <div id="tab-default-1" class="slds-tabs_default__content slds-show" role="tabpanel" aria-labelledby="tab-default-1__item"><c:Activity acctRecord="{!acct}"/></div>
        <div id="tab-default-3" class="slds-tabs_default__content slds-hide" role="tabpanel" aria-labelledby="tab-default-3__item"><c:act2 accountRecord="{!acct}"/></div>
        <div id="tab-default-2" class="slds-tabs_default__content slds-hide" role="tabpanel" aria-labelledby="tab-default-2__item"><c:Activity3 acctRecord="{!acct}"/></div>


------------------------------------
The lines in bold, the first one shows icons while the third one doesn't . If I change the order the third shows and second doesn't
Hi Guys -  I have a issue in a vf component for displaying icons in IE. I have used svg4everybody but it doen't seems to work.

have created multiple vf components and refering them in a vf page.

please suggest.
can anyone please suggest how to create a dependent hirerachy checkbox using salesforce lightning. something like
- ab
  - abc
  -abcd

so if ab is checked so both abc & abcd should be checked and if any of the sub chek box is checked then ab is check....please suggest​
I have a requirement like JSON for an external weather forecasting is given ,Based on the website details in lead object the greeting message should be displayed.Please suggest me to solve it(URGENT).
I am trying to make an outbound message using outbound message in workflows but getting this "javax.net.ssl.SSLPeerUnverifiedException: Received fatal alert: unknown_ca" 
 
I tried doing some administrative cleanup, to get rid of some fields that were required and now aren't, and now we can't save changes in opportunities due to a Flow Trigger error ID 301U00000000ha5... now none of my team can update their opportunities
I downloaded a self signed certificate from Salesforce to make a Salesforce-Jira connector but the public key that's included in the .crt file is encrypted with RSA encryption. I was wondering if anyone knows how to retrieve the actual (decrypted) public key from the .crt file or any other method.

Thanks!
Hi All,

Is it possible to change the background of the header (the area above all Tabs) on all pages like? Right now it's blue, we want some other color. Please advise.

When we use standard salesforce logo, the header color is blue.

But when we use custom logo for an app, the header color changes to white?

How can we control on this difference? I want to change the header color, as well as the background color of an app? how to do it??


Thanks and Regards,
Devendra S