• Roh
  • NEWBIE
  • 241 Points
  • Member since 2013
  • Salesforce Tech Lead
  • American Express

  • Chatter
    Feed
  • 7
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 65
    Replies
I am creating a VF page where students will choose their school from a dropdown list and then based on the selection, proceed to a registration page specific to that school. I am creating the list, grabbing the Name and ID, in a custom controller. I've the the dropdown working, but I'm stuck on how to get the ID once the school is selected and appending it to a URL so that the students are directed to the right page. Any thoughts?

My code for reference:
VF page:
<apex:page showHeader="false" sideBar="false" standardStylesheets="false" docType="html-5.0" applyBodyTag="false" applyHtmlTag="false" controller="SDPController">
    <script>
    
	</script>
<apex:composition template="{!$Site.Template}">
    <apex:define name="title">{!$Label.LBL_Page_Title}</apex:define>
    <apex:define name="body">
    <div class="container">
        <div align="center" style="font-size:20px;">
        <p>Welcome to the Digital On-Ramps ePortfolio! Please select you school and click "Next."</p>
        <apex:form >
        	<apex:selectList multiselect="false" size="1"  required="false" style="font-size:20px;">
            	<apex:selectOptions value="{!PAIList}" />
            </apex:selectList>
            <div class="modal-footer">
            <apex:commandButton id="register" value="Next" />
        </div>
        </apex:form>
        </div>
        
    </div>
    </apex:define>
</apex:composition>   
</apex:page>

And controller:
public without sharing class SDPController {
    public List<Account> PAISchools = new List<Account>();
    public SDPController(){
        
    }

    public List<SelectOption> PAIList{
        get{
            PAISchools = [Select Account.Name, Account.Id From Account Where Account.ParentId = '0011700000BZkKR'];
            
            PAIList = new List<SelectOption>();
            
            for(Account temp : PAISchools){
                PAIList.add(new SelectOption(temp.id, temp.Name));
            }
            return PAIList;
        }
        set;    
    }
  
        
}

 
Dear Salesforce Developers,

How do I add a customized field to a report? I would like to add a field called account numbers to the report request if you coudl please assist and advise?
Hi, 
  
 I wrote below code to test conditional SOQL based on the value we have 

  In below code when country != null it must return a soql value when zip != null it must return another soql value but its not working and going to a exception clause can you please suggest me what is the mistake in the code. 
 
Try
{       
   
lead ld = [select id,postalcode,state,country from lead where id = '00Q180000029Ujz' limit 1];

      system.debug('Lead ID:' + ld.id);
      system.debug('Postal Code:' + ld.postalcode);
      system.debug('State:' +ld.state);
      system.debug('Country:' + ld.country);
    
    Integer intzip;
    intzip=Integer.valueof(ld.postalcode);
    String lstate;
    lstate = ld.state;
    String lcountry;
    lcountry = ld.country;
    
    system.debug('Updated Zip:' + intzip);
    system.debug('State:' + lstate);
    system.debug('Country:' + lcountry);
    
     if ( lcountry != null )
     {
         Territory_Lookup__c tl = [select Theater__c,Region__c,Area__c,User__c FROM Territory_Lookup__c
                              where  Country__c = :lcountry];   
     system.debug('Theater1 :' + tl.Theater__c);
     system.debug('Region1 :' + tl.Region__c);
     system.debug('Area1 :' + tl.Area__c);
     system.debug('User1 :' + tl.User__c);
     }  
    
    if ( intzip != null )
          
     {
        Territory_Lookup__c tl = [select Theater__c,Region__c,Area__c,User__c FROM Territory_Lookup__c
                              where Zip_Start__c <= :intzip and Zip_End__c >= :intzip];     
     system.debug('Theater2 :' + tl.Theater__c);
     system.debug('Region2 :' + tl.Region__c);
     system.debug('Area2 :' + tl.Area__c);
     system.debug('User2 :' + tl.User__c);    
         }

    
}     
Catch (Exception e)
{
 system.debug('Lookup no found'); 
    }


Thanks
Sudhir
I have below these four fileds.
Morning_Sign_In__c
Afternoon_Sign_Off__c
Afternoon_Sign_In__c
Evening_Sign_Off__c

When the employee morning sign in and afternoon sign off for lunch break and after lunch login and evening logout. in between this situation i need calculate the total working hours of the day in 12 hours format
Hello team, 

Can someone tells me what I am doing wrong with my code?
I am trying to call the contacts by clicking a button
 
<apex:sectionHeader title="Contact Duplicates"/>
              <apex:pageBlockSection>
              <!-- SEARCH TAB -->
                <apex:actionRegion >  
                  <apex:outputPanel id="top" layout="block">
                  <!--[Styles CCS]-->
                    <apex:outputLabel for="txtSearch"/>
                    <apex:inputText id="txtSearch" html-placeholder="Search your account" value="{!searchStringCnt}" />
                      <span>
                      <apex:commandButton id="btnGo" value="Search" action="{!SearchCnt}" rerender="searchResults"></apex:commandButton>
                      </span>
                  </apex:outputPanel>
              
                  <apex:outputPanel id="pnlSearchResults" style="margin:10px;height:350px;overflow-Y:auto;" layout="block">
                    <apex:pageBlock id="searchResults"> 
                      <apex:pageBlockTable value="{!resultsCnt}" var="c" id="tblResults">
                      
                      <!--//[Checkbox]-->
                      <apex:column headerValue="Selection">
                            <apex:inputCheckbox id="ckDuplicates"></apex:inputCheckbox>
                        </apex:column>
                      
                        <apex:column>
                          <apex:facet name="header">
                            <apex:outputPanel >Firstname</apex:outputPanel>
                          </apex:facet>
                           <apex:outputLink>{!Contact.FirstName}</apex:outputLink>     
                        </apex:column> 
                          
                        <!--//Column Type-->
                        <apex:column>
                          <apex:facet name="header">
                            <apex:outputPanel >Lastname</apex:outputPanel>
                          </apex:facet>
                           <apex:outputLink>{!Contact.LastName}</apex:outputLink>     
                        </apex:column>
                        
                        <!--//Column Phone Number-->
                        <apex:column >
                          <apex:facet name="header">
                            <apex:outputPanel >Phone Number</apex:outputPanel>
                          </apex:facet>
                           <apex:outputLink>{!Contact.Phone}</apex:outputLink>     
                        </apex:column>
        
                      </apex:pageBlockTable>
                    </apex:pageBlock>
                  </apex:outputPanel>
                </apex:actionRegion>
              </apex:pageBlockSection>
Here is the method
///CONTACT DUPLICATE SERCHING
    //performs the keyword search
    public List<Account> resultsCnt {get;set;}
    //public Contact[] cnt {get;set;}
    public string searchStringCnt{get;set;}
      public PageReference searchCnt() {
        runSearchCnt();
        return null;
    }
    
        // prepare the query and issue the search command
      private void runSearchCnt() {
        //prepare query string for complex serarches & prevent injections
        resultsCnt = performSearchCnt(searchStringCnt);               
      } 

      //run the search and return the records found. 
      private List<Account> performSearchCnt(string searchStringCnt) {
    
        //String will make a callback of contacs
        //cnt = [SELECT id, firstName, lastName, phone FROM Contact];
        String soql = 'SELECT id, firstName, lastName, phone FROM Contact';
        if(searchStringCnt != '' && searchStringCnt != null)
        //soql = soql +  ' where name LIKE \'%' + searchStringCnt +'%\'';
        //soql = soql + ' limit 25';
        System.debug(soql);
        return database.query(soql); 
    
      }
      
      // used by the visualforce page to send the link to the right dom element
      public string getFormTagCnt() {
        return System.currentPageReference().getParameters().get('frm');
      }
    
      // used by the visualforce page to send the link to the right dom element for the text box
      public string getTextBoxCnt() {
        return System.currentPageReference().getParameters().get('txt');
      }


Thanks in advance
Hello,

I have a custom controller extension below which pre-populates the Opportunity ID and a Contact Role ID to a Visualforce page for a custom object that has a Master-Detail relationship to the Opportunity object.  I am now trying to create 2 buttons on the VF page that will populate a 3rd custom field, save the custom object record, and re-direct the user to another VF page.  However, when I try to save the code below I get the error:  

Error: VF_CampaignCaseCreateController Compile Error: Initial term of field expression must be a concrete SObject: List<Campaign_Create_Request__c> at line 37 column 9

I'm sure my syntax is incorrect for populating the 3rd field in each method, but I'm not sure how to fix it.
 
public class VF_CampaignCaseCreateController{
    
    public List<Campaign_Create_Request__c> CCR {get; set;}
    
        private final Opportunity opp;
        public VF_CampaignCaseCreateController(ApexPages.StandardController myController){
            CCR = new List<Campaign_Create_Request__c>();
                if (!Test.isRunningTest())
                {
                myController.addFields(new List<String>{'Id', 'OwnerId', 'Owner.Phone'});
                }
            opp=(Opportunity)myController.getrecord();
        }
    
        public Campaign_Create_Request__c CCR2 = new Campaign_Create_Request__c();
            public void CampaignCaseCreate(){
           
                CCR2.Opportunity__c = opp.Id;
    
                Opportunity o = [SELECT (SELECT Id, contactId
                                           FROM OpportunityContactRoles
                                           WHERE role = 'Signatory')
                                FROM Opportunity
                                WHERE id = :opp.id];
                CCR2.Primary_User__c = o.opportunityContactRoles.size() != 0 
                                        ? o.opportunityContactRoles[0].contactId  
                                        : null;
    
                CCR.add(CCR2);
            }
    
    
        public PageReference AdCamp() {
    
            insert CCR;
            CCR.Requested_Action__c = 'Create and Add';
    
               PageReference RetPage = new PageReference('/VF_CampaignCreate_Edit?id=' + CCR[0].id);
            RetPage.setRedirect(true);
            return RetPage; 
        }
    
        public PageReference Camp() {
    
            insert CCR;
            CCR.Requested_Action__c = 'Create Only';
    
               PageReference RetPage = new PageReference('/VF_CampaignCreate_Edit?id=' + CCR[0].id);
            RetPage.setRedirect(true);
            return RetPage; 
        }
    
    }

 
Hi,

We have a multiselect picklist (custField1) in Salesforce that contains emails addresses on a custom object called "custObjA". Whenever custObjA is saved, the custField1 is required and users have the ability to select 1 or more email address values. We have a workflow email alert that was created so that on save of custObjA, an email is sent to user editing the record.

We wanted to know if there was a way through apex triggger or class to update the workflow email alert's "Additional Emails" field. Essentially when the custField1 (multiselect picklist) is updated, we want to use all the selected values to go into the "Additional Emails" field of the workflow. Is this possible?
  • October 05, 2015
  • Like
  • 0
Hello friends,
When i tried navigating from the lightning app page to the record detail page, using the Aura function it fails.
​createRecord : function (component, event, helper) { var navEvt = $A.get("e.force:navigateToSObject"); navEvt.setParams({ "recordId": "00QB0000000ybNX", "slideDevName": "related" }); navEvt.fire(); }

Is there something i am missing here?

Your inputs are appreciated.

Thanks,
Roh
  • January 11, 2017
  • Like
  • 0
Hello friends,
I have a scenario where i do have a lightning component embedded inside the record page.
This record page also has an approval process related list, now during the approval process stage when the user clicks on approve the record page updates with the new status but the lightning component is not rendering to show/hide certain elements.

Question is : How do i refresh the component alone on an Out of the Box Approval click ?

Your inputs are appreciated.

Thanks,
Roh
  • January 11, 2017
  • Like
  • 0
HELLO ALL,
THIS IS THE CUSTOM CODE WRITTEN TO FETCH THE HISTORY FOR ANY OBJECT IN SALESFORCE.
MODIFY IT AS PER NEED

public class yourClassForHistories
{
    public Id caseId {get; set;}
    public List<HistoryDetailClass> histories;
    // Variables
    public Static final Map<String, Schema.SObjectField> CaseFieldmap = Schema.SObjectType.Request__c.fields.getMap();
    public Static final List<Schema.PicklistEntry> fieldPicklistValues = Request__History.Field.getDescribe().getPicklistValues();

    public List<HistoryDetailClass> getHistories()
    {
        histories = new List<HistoryDetailClass>();
        List<Request__c> // Your Query
        
        list<Request__History>  // Your Query

        
        for(Request__History nowHistory : your List){
            GenericHistoryClass cHistory = new GenericHistoryClass();
            cHistory.createdById = nowHistory.CreatedBy.Id;
            cHistory.createdByName = nowHistory.CreatedBy.Name;
            cHistory.createdDate = nowHistory.CreatedDate;
            cHistory.field = nowHistory.Field;
            cHistory.id = nowHistory.Id;
            cHistory.newValue = String.valueOf(nowHistory.newValue);
            cHistory.oldValue = String.valueOf(nowHistory.oldValue);
            cHistory.parentId = nowHistory.ParentID;

            HistoryDetailClass tempHistory = new HistoryDetailClass();
            tempHistory = createHistoryEntry(cHistory);

            // Add to the list
            if(tempHistory != null){
                histories.add(tempHistory);
            }
        }

        histories.sort();
        return histories;
    }

    //Function to populate a temporary history record
    public HistoryDetailClass createHistoryEntry(GenericHistoryClass cHistory){
        HistoryDetailClass tempHistory = new HistoryDetailClass();
        String prevDate = '';

        if((cHistory.newValue == null && cHistory.oldValue == null)
                || (cHistory.newValue != null && !(string.valueOf(cHistory.newValue).startsWith('a0t') || string.valueOf(cHistory.newValue).startsWith('00G') ||
                    string.valueOf(cHistory.newValue).startsWith('005f') || string.valueOf(cHistory.newValue).startsWith('005e') ||
                    string.valueOf(cHistory.newValue).startsWith('005a')))
                || (cHistory.oldValue != null && !(string.valueOf(cHistory.oldValue).startsWith('a0t') || string.valueOf(cHistory.oldValue).startsWith('00G') ||
                    string.valueOf(cHistory.oldValue).startsWith('005f') || string.valueOf(cHistory.oldValue).startsWith('005e') ||
                    string.valueOf(cHistory.oldValue).startsWith('005a'))))
            {
                // Set the Date and who performed the action
                if(String.valueOf(cHistory.createdDate) != prevDate)
                {
                    tempHistory.theDate = String.valueOf(cHistory.createdDate);
                    tempHistory.who = cHistory.createdByName;
                    tempHistory.userId = cHistory.createdById;
                }
                else
                {
                    tempHistory.theDate = '';
                    tempHistory.who = '';
                    tempHistory.userId = cHistory.createdById;
                }
                prevDate = String.valueOf(cHistory.createdDate);

                // Get the field label
                String fieldLabel = YouClassForHistories.returnFieldLabel(cHistory.field);

                // Set the Action value
                if (String.valueOf(cHistory.field) == 'created')
                {
                    // on Creation
                    tempHistory.action = 'Created.';
                }
                else if(cHistory.oldValue != null && cHistory.newValue == null)
                {
                    // when deleting a value from a field
                    // Format the Date and if there's an error, catch it and re
                    try {
                        tempHistory.action = 'Deleted ' + Date.valueOf(cHistory.oldValue).format() + ' in <b>' + fieldLabel + '</b>.';
                    }
                    catch (Exception e)
                    {
                        tempHistory.action = 'Deleted ' + String.valueOf(cHistory.oldValue) + ' in <b>' + fieldLabel + '</b>.';
                    }
                }
                else
                {
                    // all other scenarios
                    String fromText = '';
                    if (cHistory.oldValue != null)
                    {
                        try {
                            fromText = ' from ' + Date.valueOf(cHistory.oldValue).format();
                        }
                        catch (Exception e)
                        {
                            fromText = ' from ' + String.valueOf(cHistory.oldValue);
                        }
                    }

                    String toText = '';
                    if (cHistory.NewValue != null)
                    {
                        try {
                            toText = Date.valueOf(cHistory.newValue).format();
                        }
                        catch (Exception e)
                        {
                            toText = String.valueOf(cHistory.newValue);
                        }
                    }

                    if(toText != '')
                        tempHistory.action = 'Changed <b>' + fieldLabel + '</b>' + fromText + ' to <b>' + toText + '</b>.';
                    else
                        tempHistory.action = 'Changed <b>' + fieldLabel;

                }

                String fieldValue=cHistory.field.replaceAll('__c','');
                fieldValue=fieldValue.replaceAll('_',' ');
                tempHistory.field=fieldValue;

            }

            return tempHistory;

    }

    // Function to return Field Label of a Case field given a Field API name
    public Static String returnFieldLabel(String fieldName)
    {
        if(yourClassForHistories.CaseFieldmap.containsKey(fieldName))
        return yourClassForHistories.CaseFieldmap.get(fieldName).getDescribe().getLabel();
        else
        {
            for(Schema.PicklistEntry pickList : fieldPicklistValues)
            {
                if(pickList.getValue() == fieldName)
                {
                    if(pickList.getLabel() != null){
                        return pickList.getLabel();
                    }
                    else{
                        return pickList.getValue();
                    }
                }
            }
        }
        return '';
    }


    // Inner Class to store the detail of the case history
    public class HistoryDetailClass implements Comparable{
        public String theDate {get; set;}
        public String who {get; set;}
        public Id userId {get; set;}
        public String action {get; set;}
        public String field{get; set;}
        public String OfferName{get; set;}

        public Integer compareTo(Object compareTo) {
            HistoryDetailClass compareToHistory = (HistoryDetailClass)compareTo;
            if (theDate == compareToHistory.theDate){
                return 0;
            }
            if (theDate > compareToHistory.theDate){
                return -1;
            }
            return 1;        
        }       
    }

    //Generic Inner Class that replecates the History Object
    public class GenericHistoryClass{
        public Id createdById {get;set;}
        public String createdByName {get;set;}
        public Datetime createdDate {get;set;}
        public String field {get;set;}
        public Id id {get;set;}
        public boolean isDeleted {get;set;}
        public String newValue {get;set;}
        public String oldValue {get;set;}
        public Id parentId {get;set;}
        public String offerName {get;set;}
    }

Thanks,
Rohit Alladi.

Please choose as best answer if you liked it !
  • July 20, 2015
  • Like
  • 2

How to restrict the access for a user of a xyz profile so that he can see the object and records in it and edit the records but he should not be able to create a new record.
Advices very much appreciated

  • November 25, 2013
  • Like
  • 0
HELLO ALL,
THIS IS THE CUSTOM CODE WRITTEN TO FETCH THE HISTORY FOR ANY OBJECT IN SALESFORCE.
MODIFY IT AS PER NEED

public class yourClassForHistories
{
    public Id caseId {get; set;}
    public List<HistoryDetailClass> histories;
    // Variables
    public Static final Map<String, Schema.SObjectField> CaseFieldmap = Schema.SObjectType.Request__c.fields.getMap();
    public Static final List<Schema.PicklistEntry> fieldPicklistValues = Request__History.Field.getDescribe().getPicklistValues();

    public List<HistoryDetailClass> getHistories()
    {
        histories = new List<HistoryDetailClass>();
        List<Request__c> // Your Query
        
        list<Request__History>  // Your Query

        
        for(Request__History nowHistory : your List){
            GenericHistoryClass cHistory = new GenericHistoryClass();
            cHistory.createdById = nowHistory.CreatedBy.Id;
            cHistory.createdByName = nowHistory.CreatedBy.Name;
            cHistory.createdDate = nowHistory.CreatedDate;
            cHistory.field = nowHistory.Field;
            cHistory.id = nowHistory.Id;
            cHistory.newValue = String.valueOf(nowHistory.newValue);
            cHistory.oldValue = String.valueOf(nowHistory.oldValue);
            cHistory.parentId = nowHistory.ParentID;

            HistoryDetailClass tempHistory = new HistoryDetailClass();
            tempHistory = createHistoryEntry(cHistory);

            // Add to the list
            if(tempHistory != null){
                histories.add(tempHistory);
            }
        }

        histories.sort();
        return histories;
    }

    //Function to populate a temporary history record
    public HistoryDetailClass createHistoryEntry(GenericHistoryClass cHistory){
        HistoryDetailClass tempHistory = new HistoryDetailClass();
        String prevDate = '';

        if((cHistory.newValue == null && cHistory.oldValue == null)
                || (cHistory.newValue != null && !(string.valueOf(cHistory.newValue).startsWith('a0t') || string.valueOf(cHistory.newValue).startsWith('00G') ||
                    string.valueOf(cHistory.newValue).startsWith('005f') || string.valueOf(cHistory.newValue).startsWith('005e') ||
                    string.valueOf(cHistory.newValue).startsWith('005a')))
                || (cHistory.oldValue != null && !(string.valueOf(cHistory.oldValue).startsWith('a0t') || string.valueOf(cHistory.oldValue).startsWith('00G') ||
                    string.valueOf(cHistory.oldValue).startsWith('005f') || string.valueOf(cHistory.oldValue).startsWith('005e') ||
                    string.valueOf(cHistory.oldValue).startsWith('005a'))))
            {
                // Set the Date and who performed the action
                if(String.valueOf(cHistory.createdDate) != prevDate)
                {
                    tempHistory.theDate = String.valueOf(cHistory.createdDate);
                    tempHistory.who = cHistory.createdByName;
                    tempHistory.userId = cHistory.createdById;
                }
                else
                {
                    tempHistory.theDate = '';
                    tempHistory.who = '';
                    tempHistory.userId = cHistory.createdById;
                }
                prevDate = String.valueOf(cHistory.createdDate);

                // Get the field label
                String fieldLabel = YouClassForHistories.returnFieldLabel(cHistory.field);

                // Set the Action value
                if (String.valueOf(cHistory.field) == 'created')
                {
                    // on Creation
                    tempHistory.action = 'Created.';
                }
                else if(cHistory.oldValue != null && cHistory.newValue == null)
                {
                    // when deleting a value from a field
                    // Format the Date and if there's an error, catch it and re
                    try {
                        tempHistory.action = 'Deleted ' + Date.valueOf(cHistory.oldValue).format() + ' in <b>' + fieldLabel + '</b>.';
                    }
                    catch (Exception e)
                    {
                        tempHistory.action = 'Deleted ' + String.valueOf(cHistory.oldValue) + ' in <b>' + fieldLabel + '</b>.';
                    }
                }
                else
                {
                    // all other scenarios
                    String fromText = '';
                    if (cHistory.oldValue != null)
                    {
                        try {
                            fromText = ' from ' + Date.valueOf(cHistory.oldValue).format();
                        }
                        catch (Exception e)
                        {
                            fromText = ' from ' + String.valueOf(cHistory.oldValue);
                        }
                    }

                    String toText = '';
                    if (cHistory.NewValue != null)
                    {
                        try {
                            toText = Date.valueOf(cHistory.newValue).format();
                        }
                        catch (Exception e)
                        {
                            toText = String.valueOf(cHistory.newValue);
                        }
                    }

                    if(toText != '')
                        tempHistory.action = 'Changed <b>' + fieldLabel + '</b>' + fromText + ' to <b>' + toText + '</b>.';
                    else
                        tempHistory.action = 'Changed <b>' + fieldLabel;

                }

                String fieldValue=cHistory.field.replaceAll('__c','');
                fieldValue=fieldValue.replaceAll('_',' ');
                tempHistory.field=fieldValue;

            }

            return tempHistory;

    }

    // Function to return Field Label of a Case field given a Field API name
    public Static String returnFieldLabel(String fieldName)
    {
        if(yourClassForHistories.CaseFieldmap.containsKey(fieldName))
        return yourClassForHistories.CaseFieldmap.get(fieldName).getDescribe().getLabel();
        else
        {
            for(Schema.PicklistEntry pickList : fieldPicklistValues)
            {
                if(pickList.getValue() == fieldName)
                {
                    if(pickList.getLabel() != null){
                        return pickList.getLabel();
                    }
                    else{
                        return pickList.getValue();
                    }
                }
            }
        }
        return '';
    }


    // Inner Class to store the detail of the case history
    public class HistoryDetailClass implements Comparable{
        public String theDate {get; set;}
        public String who {get; set;}
        public Id userId {get; set;}
        public String action {get; set;}
        public String field{get; set;}
        public String OfferName{get; set;}

        public Integer compareTo(Object compareTo) {
            HistoryDetailClass compareToHistory = (HistoryDetailClass)compareTo;
            if (theDate == compareToHistory.theDate){
                return 0;
            }
            if (theDate > compareToHistory.theDate){
                return -1;
            }
            return 1;        
        }       
    }

    //Generic Inner Class that replecates the History Object
    public class GenericHistoryClass{
        public Id createdById {get;set;}
        public String createdByName {get;set;}
        public Datetime createdDate {get;set;}
        public String field {get;set;}
        public Id id {get;set;}
        public boolean isDeleted {get;set;}
        public String newValue {get;set;}
        public String oldValue {get;set;}
        public Id parentId {get;set;}
        public String offerName {get;set;}
    }

Thanks,
Rohit Alladi.

Please choose as best answer if you liked it !
  • July 20, 2015
  • Like
  • 2
According to the documention (https://www.lightningdesignsystem.com/components/icons/ ) we can chnage the icon color by suing the CSS. I am not able to do it. It always overides with the Salesforce style.
<lightning:icon class="icn"  iconName="utility:favorite" size="small" />
 
.THIS .icn{
 fill: white; 
}

Other css property like baground color are applying but fill is always getting overirdder by salesfroce defult color ( grey). Any one have any idea on how to fix this ?
I want to update a datetime field from a date field and a time pick list.  The SF system has users in a fixed time zone with a twice yearly daylight saving adjustment which I think means I cannot use a formula and therefore require an Apex Trigger on BeforeInsert and BeforeUpdate.  It's more than 12 months since I wrote any Apex so I hope someone can get me started on this !   Thanks.
Hi.

I am having a Map
Map<String,Set<Id>> testmap= new map<String,Set<Id>>();
and values which i am giving to map are as below.
 if(testmap.containsKey(text)){
        
        testmap.get(text).add(u.id);
        }else{
          testmap.put(text,new Set<Id>{u.id})
}
Now i want to collect id value and assign it to a field on account and update it.But When i use values from map method,i am getting below error.

Illegal assignment from List<Set<Id>> to Id

for(account acc:trigger.new){
acc.customtextfield__c =testmap.values();
}
I understand my mistake that i am assigning Map value to list.Could you please guide how can i solve this?
 
I would to like to push the visual flow from dev to prod sandbox. In dev dandbox  I deactivated it and created change set. Dev sandbox has a flow which has 6 versions .All 6 versions are inactive.
Please suggest me do i need to make inactive and create change set or the flow latest version should be active and make change set.

thanks
soma

Hi ,

How to get the user field details from the lead object .
 

Thanks
lokesh

Hi Experts,

i wana to update account field value by batch class. But facing a error in attached images.

Please suggest.

User-added image

Thanks
Mukesh
Hello Folks,

In Apex Class i'm using dynamic SOQL, below is my code:
 string soql='select id,name,Area__c,City__c,Address__c from User_Detail__c where name!=null';
        if(usr.Area__c!=null){
            soql+=' and Area__c=:\''+usr.Area__c+'\'';
        }
System.Debug('Query '+soql);
        List<User_Detail__c> userDetailRecords=Database.query(soql);

Debug is: 
DEBUG|Query select id,name,Area__c,City__c,Address__c from User_Detail__c where name!=null and City__c=VIJ

Error Message: 
System.QueryException: expecting a colon, found 'VIJ'

I thought everything i have given correctly, but missed something somwhere. Will you correct me where i'm supposed to change.
Please update me your thoughts ASAP
I am creating a VF page where students will choose their school from a dropdown list and then based on the selection, proceed to a registration page specific to that school. I am creating the list, grabbing the Name and ID, in a custom controller. I've the the dropdown working, but I'm stuck on how to get the ID once the school is selected and appending it to a URL so that the students are directed to the right page. Any thoughts?

My code for reference:
VF page:
<apex:page showHeader="false" sideBar="false" standardStylesheets="false" docType="html-5.0" applyBodyTag="false" applyHtmlTag="false" controller="SDPController">
    <script>
    
	</script>
<apex:composition template="{!$Site.Template}">
    <apex:define name="title">{!$Label.LBL_Page_Title}</apex:define>
    <apex:define name="body">
    <div class="container">
        <div align="center" style="font-size:20px;">
        <p>Welcome to the Digital On-Ramps ePortfolio! Please select you school and click "Next."</p>
        <apex:form >
        	<apex:selectList multiselect="false" size="1"  required="false" style="font-size:20px;">
            	<apex:selectOptions value="{!PAIList}" />
            </apex:selectList>
            <div class="modal-footer">
            <apex:commandButton id="register" value="Next" />
        </div>
        </apex:form>
        </div>
        
    </div>
    </apex:define>
</apex:composition>   
</apex:page>

And controller:
public without sharing class SDPController {
    public List<Account> PAISchools = new List<Account>();
    public SDPController(){
        
    }

    public List<SelectOption> PAIList{
        get{
            PAISchools = [Select Account.Name, Account.Id From Account Where Account.ParentId = '0011700000BZkKR'];
            
            PAIList = new List<SelectOption>();
            
            for(Account temp : PAISchools){
                PAIList.add(new SelectOption(temp.id, temp.Name));
            }
            return PAIList;
        }
        set;    
    }
  
        
}

 
I have below these four fileds.
Morning_Sign_In__c
Afternoon_Sign_Off__c
Afternoon_Sign_In__c
Evening_Sign_Off__c

When the employee morning sign in and afternoon sign off for lunch break and after lunch login and evening logout. in between this situation i need calculate the total working hours of the day in 12 hours format
Hi,

I'm currenty trying to master this use case:
Lets say we have an object and on the page we have the option to delete this object. Now the delete button gets clicked and a bootstrap modal pops up asking if this object really should be deleted. By clicking yes the object gets deleted.

My problem is to remember this clicked object so I know which one has to be deleted by clicking the modal yes button. 
So in a nutshell ... how can I pass the object id to a component parameter when the delete button gets clicked?

Thank you!

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.