• Carly Probasco 14
  • NEWBIE
  • 45 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 9
    Replies
I have a picklist field that i would like to make read only on a edit screen.
 
<lightning:select name="classroomStatusSelect" label="Status:" value="{!v.SelectedClassroom.Status__c}" required="true" readonly="true">
      <aura:iteration items="{!v.ClassroomStatusOptions}" var="classroomStatus">
		<option text="{!classroomStatus}"></option>
</aura:iteration>
					</lightning:select>
What am i doing wrong?
 
I'm having trouble displaying a picklist value in a ligthning component. See below for methods used. What am I missing?

I have added a new picklist field the query in a controller, and I'm using these methods to return the picklist values used in the Lighting Component:
//Grabs options for all picklists on the page.   @AuraEnabled   public static List<returnFieldOptions> getPicklistOptions(string picklistFieldsJson){     System.debug('Picklist Fields Json: '+picklistFieldsJson);          //Create new list of return options for returning picklists to the page (returnFieldOptions class defined at bottom of this page).     List<returnFieldOptions> allFieldOptions = new List<returnFieldOptions>();     //Turn the JSON received from the page into a list of a custom class (defined at bottom of the page).     List<fieldLookups>picklistFields = (List<fieldLookups>)System.JSON.deserializeStrict(picklistFieldsJson,List<fieldLookups>.Class);     //For each item received, find all the fields and put them into the allFieldOptions list.     for(fieldLookups fieldInfo : picklistFields){       System.debug(fieldInfo);       //Create object for returning picklist fields and instantiate the list where we will be storing the values.       returnFieldOptions targetFieldOptions = new returnFieldOptions();       targetFieldOptions.picklistOptions = new List<String>();       //Add in the attribute name where this will be stored when it goes back to the page. Add "--None--" as the first option.       targetFieldOptions.attributeName = fieldInfo.attributeName;       targetFieldOptions.picklistOptions.add('--None--');       //Retrieve object metadata.       Schema.sObjectType targetObjectType = Schema.getGlobalDescribe().get(fieldInfo.objectName);       Schema.DescribeSObjectResult targetObjectDescribe = targetObjectType.getDescribe();       Map<String, Schema.SObjectField> fieldMap = targetObjectDescribe.fields.getMap();                          system.debug(fieldInfo.fieldName);       //Retrieve picklist options for the specific field.       List<Schema.PicklistEntry> values = fieldMap.get(fieldInfo.fieldName).getDescribe().getPicklistValues();       //Add their name to the return object list as a string.       for(Schema.PicklistEntry a: values){         targetFieldOptions.picklistOptions.add(a.getValue());       }       //Add the return object for this picklist to the overall list that will go back to the page.       allFieldOptions.add(targetFieldOptions);     }     System.debug(allFieldOptions);     return allFieldOptions;   }  }   public class fieldLookups {     Public string attributeName{get;set;}     Public string objectName {get;set;}     Public string fieldName {get;set;}   }   public class returnFieldOptions{     @AuraEnabled     Public string attributeName{get;set;}     @AuraEnabled     Public List<String>picklistOptions{get;set;}   }



Here is the Lighting Component:
<aura:attribute name="RequestChangeOptions" access="private" type="String[]"/> <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"> <lightning:select name="RequestChangeSelect" label="Request Change to Classroom?" value="{!v.SelectedClassroom.Provider_Request_Classroom_Changes__c}" required="true"> <aura:iteration items="{!v.RequestChangeOptions}" var="RequestClassroomChange"> <option text="{!RequestClassroomChange}"></option> </aura:iteration> </lightning:select>

 
I am debugging a visualforce page and receiving an error in the code below. the debug tells me this |USER_DEBUG|[119]|DEBUG|from getter is null, here is the code 119 references. 
public String DymanicRerateButtonText{
        get{
            system.debug('from getter is '+DymanicRerateButtonText);
            
            return DymanicRerateButtonText;
        }
        set;
    
    }
    
    public String DymanicRerateButtonURL{
        get;
        set;
    
    }
    
    public Boolean renderDynamicRerateButton{
        get;
        set;
    
    }

 
I am trying to add this piece of code into an existing controller. The code is to display either a date field or a string of text depending on the condition. When i debug this, it appears my function is not being called.
//Returns the Rating Release date or the rating pending
        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format();
        } else { 
            RatingRelease = '';
        }
        
        System.debug('Rating Pending is now' + RatingRelease);

Here is the class i need to add the above to:
allExistingPrograms = new List<Program__c>();
        existingPrograms = new List<Program__c>();
        allExistingProviderCases = new List<Provider_Case__c>();
        existingProviderCase = new List<Provider_Case__c>();
        
        Boolean programEnrollmentFlag = false, providerCaseQEFlag = false, providerCaseQRFlag = false;
        programEARTId = [Select ID from RecordType Where SObjectType = 'Program__c' AND DeveloperName = 'Early_Achievers'].Id;
        qualityEnrollmentRTId = [Select ID from RecordType Where SObjectType = 'Provider_Case__c' AND DeveloperName = 'Quality_Enrollment'].Id;
        qualityRatingRTId = [Select ID from RecordType Where SObjectType = 'Provider_Case__c' AND DeveloperName = 'Quality_Rating'].Id;
        
        allExistingProviderCases = [Select Id, 
                                           Quality_Rating_Level__c,
                                           Licensee_Signee_Name__c, 
                                           Licensee_Signature_Date__c, 
                                           RecordTypeId, 
                                           Status__c,
                                           RecordType_Name__c,
                                           Parent_Provider_Case__c,
                                           ERS_Score__c,
                                           CLASS_Score__c,
                                           Rating_Externally_Visible_Date__c,
                                           Provider_Rating_Visible_Date__c,
                                    	   Quality_Rating_Expiration_Date__c,
                                           Approved_By_Supervisor__c,
                                           Quality_Standard_Score__c,
                                           appealed__c, Rating_Due_Date__c,
                                           L2_Activities_Due__c, L2_Application_Submission_Date__c,
                                           Case_Creation_Option__c,
                                           Renewal_Requested__c,
                                           Account__r.Current_EA_Program_Rec_ID__c,
                                           QRIS_Scoring_Mode__c,Rerate_Status__c,
                                           count_appeals__c,
                                          (Select Id From Appeal_Details__r)
                                    FROM Provider_Case__c 
                                    WHERE Account__C = :currentAccId
                                    ORDER BY Completed_Date__c desc];
       Map<Id, ProviderRating> ratingMap =  populateProviderRatingHistorMap(allExistingProviderCases);
        for(Provider_Case__c pCase : allExistingProviderCases) {
            if(pCase.RecordTypeId == qualityEnrollmentRTId && pCase.Status__c == 'In Progress') {
                existingProviderCase.add(pCase);
            }
            else if(pCase.RecordTypeId == qualityEnrollmentRTId && pCase.Status__c == 'Completed') {
                providerCaseQEFlag = true;
            }
            else if(pCase.RecordTypeId == qualityRatingRTId && pCase.Status__c != 'Application Withdrawn') {
                providerCaseQRFlag = true;
            }
            
            system.debug('Record type name is '+pCase.RecordType_Name__c);
            //logic to split providercases based on quality rating and its sub types
            if(pCase.RecordTypeId==qualityRatingRTId){
                
                if(pcase.status__c=='In Progress') {
                    currentQRpCase = pcase;
                    
                    /*commenting this out because this logic is moved under and will only execute of the conditions are met
                    for(Appeal_Detail__c ad : pCase.Appeal_Details__r) {
                        AppealDetailURL = '/apex/VIPFORM__VIP_FormWizard?id='+ad.Id;
                        AppealDetailExists = true;
                        break;
                    }
                    */
                }
                
                system.debug('Appeal detail URL '+AppealDetailURL);
                system.debug('Rating visible date is '+pCase.Provider_Rating_Visible_Date__c);
                system.debug('Provider case status is '+pcase.status__c);
                system.debug('Provider case is '+pcase.id);
                if(pCase.Provider_Rating_Visible_Date__c<=date.today() && pcase.status__c=='Completed'){
                    System.debug('current QR Case is '+currentQRpCase);
                    if(String.isBlank(DymanicRerateButtonText) && String.isNotBlank(pCase.Case_Creation_Option__c)){
                        
                        
                        system.debug('Completed Prov Id is '+pCase.id);
                        DymanicRerateButtonText=pCase.Case_Creation_Option__c;
                        
                        if(DymanicRerateButtonText!='Request a Rerate')
                            DymanicRerateButtonURL = '/PP_DynamicRerateFlow?AccountId='+currentAccountId+'&ProvCaseId='+pCase.id+'&caseCreationType='+pCase.Case_Creation_Option__c;
                        
                        
                        if(DymanicRerateButtonText=='Appeal' ){
                            system.debug('Externally visible date'+pcase.Rating_Externally_Visible_Date__c);
                            system.debug('Count appeals'+pcase.Count_Appeals__c);
                            if(pcase.Rating_Externally_Visible_Date__c>date.today() && (pcase.Count_Appeals__c==null || pcase.Count_Appeals__c == 0)){  
                                currentQRProviderCase=pcase.id;
                                system.debug('Appeal end date in future');
                                //appeal detail code here
                                for(Appeal_Detail__c ad : pCase.Appeal_Details__r) {
                                    system.debug('Appeal details');
                                    AppealDetailURL = '/apex/VIPFORM__VIP_FormWizard?id='+ad.Id;
                                    DymanicRerateButtonURL='/apex/VIPFORM__VIP_FormWizard?id='+ad.Id;
                                    AppealDetailExists = true;
                                    //currentQRProviderCase=pcase.id;
                                    break;
                                }
                                
                            }else{
                               renderDynamicRerateButton=false;
                            }
                        }
                        system.debug('appeal detail URL '+AppealDetailURL);
                        if(dymanicRerateButtonText=='Renewal'){
                            currentQRProviderCase=pcase.id;
                            renderDynamicRerateButton=true;
                        }
                        
                        if(DymanicRerateButtonText=='Renewal' && pcase.Renewal_Requested__c){
                           renderDynamicRerateButton=false;
                        }
                        
                        if(pcase.Rerate_Status__c!=null && pcase.Rerate_Status__c!='' && (pcase.Case_Creation_Option__c == 'Paid Rerate' || pcase.Case_Creation_Option__c == 'Free Rerate')){
                            renderDynamicRerateButton=false;
                        } 
                        
                    }
                
                }else{
                    
                }
                    
                if(pCase.Provider_Rating_Visible_Date__c<=date.today() && pcase.Approved_By_Supervisor__c==true){
                    system.debug('case creation is '+pCase.Case_Creation_Option__c);
                    system.debug('Before assigning is '+DymanicRerateButtonText);
                    system.debug('Prov case QR');
                    ProviderRating pr;
                    if(ratingMap.containsKey(pcase.Id)){
                        pr = ratingMap.get(pcase.Id);                                              
                    } else {
                        pr =new ProviderRating();
                    }
                    pr.prCase = pCase;
                    pr.RatingLevel = pCase.Quality_Rating_Level__c;
                    pr.QRProvCaseId = pCase.Id;
                    pr.RatingReleaseDate = pCase.Provider_Rating_Visible_Date__c; 
                    pr.status = pCase.status__c;  
                    ProviderRatingHistory.add(pr);   
                    
                }
                    
                
            } 
            
        //Returns the Rating Release date or the rating pending
        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format();
        } else { 
            RatingRelease = '';
        }
        
        System.debug('Rating Pending is now' + RatingRelease);
            
        }  
        existingProviderCaseSignatures = new List<Provider_Case_Signature__c>();
        if(!existingProviderCase.isEmpty() && existingProviderCase.size()>0) {
            existingProviderCaseSignatures = [Select Id, Description__c, Sort_Order__c, Status__c, Data_Capture_Option__c, Captured_Value__c From Provider_Case_Signature__c Where Provider_Case__c = :existingProviderCase[0].Id order by Sort_Order__c ASC];
        }
        
        allExistingPrograms = [Select Id, Effective_Datetime__c, EA_Latest_Enrollment_Date__c from Program__c Where Account__c =: currentAccId AND Status__c = 'Active' AND RecordTypeId =: programEARTId];

        for(Program__c prog : allExistingPrograms) {
            if(prog.Effective_Datetime__c < currentDateTime) {
                existingPrograms.add(prog);
            }
            programEnrollmentFlag = true;
            currentEAProgram = prog;
        }
        av = getAgreementValues();
        
        displayContacts = (!existingPrograms.isEmpty() && !existingProviderCase.isEmpty()) ? true : false;
        
        displayEnrollment = (programEnrollmentFlag && providerCaseQEFlag && providerCaseQRFlag) ? false : true;

        System.debug('programEnrollmentFlag*********** ' + programEnrollmentFlag);
        System.debug('providerCaseQEFlag*********** ' + providerCaseQEFlag);
        System.debug('providerCaseQRFlag*********** ' + providerCaseQRFlag);
        //populate EAContactDropDown List
        eaContact1Records = getEAContact1Records();
        eaContact2Records = getEAContact2Records();
  
    ///////////////////////// EA part ///////////////////////////////
        
    }//end Constructor

 
I am getting the above error from this piece of code.
public Set<String> RatingRelease {get;set;}

//Returns the Rating Release date or the rating pending
        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
           String RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
           String RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format();
        } else {
           String RatingRelease = '';
        }

 
I'm trying to return either a string of text or a date field to display on a visualforce page.  When i compile it i get the error above. If i take out RatingRelease = new Set<String>(); i get an error System.NullPointerException: Attempt to de-reference a null object.  I'm not sure if i have initialized RatingRelease properly. 
public String RatingRelease {get;set;}

//Returns the Rating Release date or the 'rating pending'
        RatingRelease = new Set<String>();

        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format();
        } else {
            RatingRelease = '';
        }
|FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object

I'm getting the above error in this piece of code
//Returns the Rating Release date or the 'rating pending'
        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format();
        } else {
            RatingRelease = '';
        }

On my test record, Rating_Externally_Visible_Date__c is not null.
 
Help troubleshooting!
I am trying to return either a string or a date field using the following apex, but i'm getting an error 'illegal assignment from date to string'.

public String RatingRelease {get;set;}
public Date Today {get;set;}
Today = System.today();

        //Returns the Rating Release date or the 'rating pending'
        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c;
        } else {
            RatingRelease = '';
        }


 
I have a picklist field that i would like to make read only on a edit screen.
 
<lightning:select name="classroomStatusSelect" label="Status:" value="{!v.SelectedClassroom.Status__c}" required="true" readonly="true">
      <aura:iteration items="{!v.ClassroomStatusOptions}" var="classroomStatus">
		<option text="{!classroomStatus}"></option>
</aura:iteration>
					</lightning:select>
What am i doing wrong?
 
I'm having trouble displaying a picklist value in a ligthning component. See below for methods used. What am I missing?

I have added a new picklist field the query in a controller, and I'm using these methods to return the picklist values used in the Lighting Component:
//Grabs options for all picklists on the page.   @AuraEnabled   public static List<returnFieldOptions> getPicklistOptions(string picklistFieldsJson){     System.debug('Picklist Fields Json: '+picklistFieldsJson);          //Create new list of return options for returning picklists to the page (returnFieldOptions class defined at bottom of this page).     List<returnFieldOptions> allFieldOptions = new List<returnFieldOptions>();     //Turn the JSON received from the page into a list of a custom class (defined at bottom of the page).     List<fieldLookups>picklistFields = (List<fieldLookups>)System.JSON.deserializeStrict(picklistFieldsJson,List<fieldLookups>.Class);     //For each item received, find all the fields and put them into the allFieldOptions list.     for(fieldLookups fieldInfo : picklistFields){       System.debug(fieldInfo);       //Create object for returning picklist fields and instantiate the list where we will be storing the values.       returnFieldOptions targetFieldOptions = new returnFieldOptions();       targetFieldOptions.picklistOptions = new List<String>();       //Add in the attribute name where this will be stored when it goes back to the page. Add "--None--" as the first option.       targetFieldOptions.attributeName = fieldInfo.attributeName;       targetFieldOptions.picklistOptions.add('--None--');       //Retrieve object metadata.       Schema.sObjectType targetObjectType = Schema.getGlobalDescribe().get(fieldInfo.objectName);       Schema.DescribeSObjectResult targetObjectDescribe = targetObjectType.getDescribe();       Map<String, Schema.SObjectField> fieldMap = targetObjectDescribe.fields.getMap();                          system.debug(fieldInfo.fieldName);       //Retrieve picklist options for the specific field.       List<Schema.PicklistEntry> values = fieldMap.get(fieldInfo.fieldName).getDescribe().getPicklistValues();       //Add their name to the return object list as a string.       for(Schema.PicklistEntry a: values){         targetFieldOptions.picklistOptions.add(a.getValue());       }       //Add the return object for this picklist to the overall list that will go back to the page.       allFieldOptions.add(targetFieldOptions);     }     System.debug(allFieldOptions);     return allFieldOptions;   }  }   public class fieldLookups {     Public string attributeName{get;set;}     Public string objectName {get;set;}     Public string fieldName {get;set;}   }   public class returnFieldOptions{     @AuraEnabled     Public string attributeName{get;set;}     @AuraEnabled     Public List<String>picklistOptions{get;set;}   }



Here is the Lighting Component:
<aura:attribute name="RequestChangeOptions" access="private" type="String[]"/> <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"> <lightning:select name="RequestChangeSelect" label="Request Change to Classroom?" value="{!v.SelectedClassroom.Provider_Request_Classroom_Changes__c}" required="true"> <aura:iteration items="{!v.RequestChangeOptions}" var="RequestClassroomChange"> <option text="{!RequestClassroomChange}"></option> </aura:iteration> </lightning:select>

 
I am debugging a visualforce page and receiving an error in the code below. the debug tells me this |USER_DEBUG|[119]|DEBUG|from getter is null, here is the code 119 references. 
public String DymanicRerateButtonText{
        get{
            system.debug('from getter is '+DymanicRerateButtonText);
            
            return DymanicRerateButtonText;
        }
        set;
    
    }
    
    public String DymanicRerateButtonURL{
        get;
        set;
    
    }
    
    public Boolean renderDynamicRerateButton{
        get;
        set;
    
    }

 
I'm trying to return either a string of text or a date field to display on a visualforce page.  When i compile it i get the error above. If i take out RatingRelease = new Set<String>(); i get an error System.NullPointerException: Attempt to de-reference a null object.  I'm not sure if i have initialized RatingRelease properly. 
public String RatingRelease {get;set;}

//Returns the Rating Release date or the 'rating pending'
        RatingRelease = new Set<String>();

        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format();
        } else {
            RatingRelease = '';
        }
|FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object

I'm getting the above error in this piece of code
//Returns the Rating Release date or the 'rating pending'
        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format();
        } else {
            RatingRelease = '';
        }

On my test record, Rating_Externally_Visible_Date__c is not null.
 
Help troubleshooting!
I am trying to return either a string or a date field using the following apex, but i'm getting an error 'illegal assignment from date to string'.

public String RatingRelease {get;set;}
public Date Today {get;set;}
Today = System.today();

        //Returns the Rating Release date or the 'rating pending'
        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c;
        } else {
            RatingRelease = '';
        }


 
I tried integrating Salesforce with VS code.. I installed Salesforce CLI and when I tried creating a project in VS code but it says that Salesforce CLI is not installed.
 The exact error is

"14:48:25.402 sfdx force:project:create --projectname TestProject --outputdir d:\ --manifest
'sfdx' is not recognized as an internal or external command,
operable program or batch file.
14:48:25.492 sfdx force:project:create --projectname TestProject --outputdir d:\ --manifest ended with error spawn sfdx ENOENT
Salesforce CLI is not installed. Install it from https://developer.salesforce.com/tools/sfdxcli"