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

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 36
    Questions
  • 35
    Replies
I have a scenario. Unable to assign value to dummy variable. pls suggest
           
             String dummyVal;
             dummyVal = object1.Group_Member__c;
             String dummy;
             dummy = dummyVal.SVM__c;// unable to assign value here
             system.debug('dummy'+dummy);
            
Hi Guys,
I am trying to populate a 2 level record (child) but somehow it is not updating. pls suggest
code
------
inTrans = new Service_Order_Line__c(
                         Service_Order__c = wo.Id,
                         Work_Detail_Auto_Created__c = true,
                         Expense_Type__c = 'TRAVEL',
                         Start_Latitude__c = wo.Group_Member__r.SVC_Latitude__c, // field not populating
                         Start_Longitude__c = wo.Group_Member__r.SVC__Longitude__c // field not populating

                     );
Hi Guys,
getting variable does not exist when checking the old value is null or not. please suggest

 public static Boolean HasAccess(List<AccountContactRelation> lstNew) {
               for (AccountContactRelation acr : lstNew) {
                system.debug('trigOld-->'+trigger.oldMap.get(acr.Id));
                
                    if(string.isNotBlank(acr.Entity__c) || string.isNotBlank(trigger.oldMap.get(acr.Id).External_Entity__c)  ){// getting  error on this line checking oldmap
                    
                        if(acr.External_Entity__c != 'Customer-facing')
                            throw new acrException(System.Label.Cimited);
                    }
                }
                  return bReturn;
            }
       
can we use AccountContactRelation refrencing Account object like below
If I use like this I get Error: Compile Error: Variable does not exist: AccountContactRelation

For(AccountContactRelation acr : acc.AccountContactRelation){  // here acc is account var

}

pls suggest

 
If i am using List of ACR object it throwing compoile error
List<AccountContactRelation> acrlist = new List<AccountContactRelation>();

pls suggest
 
 Compile Error: Invalid type: AccountContactRelation
when adding record in list in last line, it throws error, pls suggest

List<AccountContactRelation> lstACR = new List<AccountContactRelation>();// error here
for(AccountContactRelation ACR : [Select Id, AccountId, ContactId, Roles from AccountContactRelation where ContactId =: sConId and 
                                                      AccountId in : accIds and Roles in : mapConRole.values()]) {
                                                          if(ACR.AccountId == opp.Ship__c)  
                                                              bShip = true;
                                                          if(ACR.AccountId == opp.Bill__c) 
                                                              bBill = true;
                                                        
                        }
 if(!bFoundShip)
                            lstACR.add(new AccountContactRelation(AccountId = opp.Ship__c, ContactId = sConId, Roles = sConRole));
Hi Guys - How to Display sections of same VF Component, one on top and other at bottom of page
For eg:
<apex:component>
1st Div- to be positioned top of page
<div>
</div>
2nd Div- to be positoned on bottom of page
<div>
</div>
</apex:component>
Hi - I have created 3 vf component, now I have to render it based on User's Locale

Pls suggest a solution
Hi Guys - can we translate a custom field in Article type to other languages
Hi Guys- I am unable to figure out where these fields are coming from, these aren't in layout too pls suggest

User-added image
Hi guys -  I am using a custom field called custom_dt__c (data type date/time) to calculate the age of record but the formula is showing an incorrect value

FLOOR(NOW()-custom_dt__c)

PLEASE SUGGEST
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,
getting variable does not exist when checking the old value is null or not. please suggest

 public static Boolean HasAccess(List<AccountContactRelation> lstNew) {
               for (AccountContactRelation acr : lstNew) {
                system.debug('trigOld-->'+trigger.oldMap.get(acr.Id));
                
                    if(string.isNotBlank(acr.Entity__c) || string.isNotBlank(trigger.oldMap.get(acr.Id).External_Entity__c)  ){// getting  error on this line checking oldmap
                    
                        if(acr.External_Entity__c != 'Customer-facing')
                            throw new acrException(System.Label.Cimited);
                    }
                }
                  return bReturn;
            }
       
can we use AccountContactRelation refrencing Account object like below
If I use like this I get Error: Compile Error: Variable does not exist: AccountContactRelation

For(AccountContactRelation acr : acc.AccountContactRelation){  // here acc is account var

}

pls suggest

 
If i am using List of ACR object it throwing compoile error
List<AccountContactRelation> acrlist = new List<AccountContactRelation>();

pls suggest
 
 Compile Error: Invalid type: AccountContactRelation
when adding record in list in last line, it throws error, pls suggest

List<AccountContactRelation> lstACR = new List<AccountContactRelation>();// error here
for(AccountContactRelation ACR : [Select Id, AccountId, ContactId, Roles from AccountContactRelation where ContactId =: sConId and 
                                                      AccountId in : accIds and Roles in : mapConRole.values()]) {
                                                          if(ACR.AccountId == opp.Ship__c)  
                                                              bShip = true;
                                                          if(ACR.AccountId == opp.Bill__c) 
                                                              bBill = true;
                                                        
                        }
 if(!bFoundShip)
                            lstACR.add(new AccountContactRelation(AccountId = opp.Ship__c, ContactId = sConId, Roles = sConRole));
Hi Guys- I am unable to figure out where these fields are coming from, these aren't in layout too pls suggest

User-added image
Hi guys -  I am using a custom field called custom_dt__c (data type date/time) to calculate the age of record but the formula is showing an incorrect value

FLOOR(NOW()-custom_dt__c)

PLEASE SUGGEST
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.
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