• William Woodson 3
  • NEWBIE
  • 35 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 8
    Replies
I am building a checkbox dropdown list component and for whatever reason I cannot seem to get the styling correct so that the dropdown list shows above other elements on the page. See screen shot, card items are covering the list. I have tried setting the position and z-index but nothing seems to work. Any ideas on how to solve?

screenshot
Hello,  I have a class that I am inserting a record for unit testing.  The code execute without issue however one of the fields I am setting in the insert is returning as null when retrieving the record in soql.  The code is executing as the system admin user and I have verified the field is visible and editable by that profile.  Any idea on why this might be occurring?  Thanks!

code:
public static T createT(Id contactId) {
        T t = new T__c();
        
        t.T_Type__c = 'Data';
 
        insert t;
        
        T__c t2 = [Select Id, T_Type__c From T__c Where Id = :t.Id];

        system.debug('bw-test: t2.Id = ' + t2.Id);
        // displays same id as was inserted

        system.debug('bw-test: t2.T Type = ' + t2.T_Type__c);
        // displays -> bw-test: t2.T Type = null

        system.debug('bw-test: t.T Type = ' + t.T_Type__c);
        // displays -> bw-test: t.T Type = Data

    }

 
Hello,

I have several lwc components that have been in use for several months now and recently, no changes made to the components they have stopped working.  I have put console log entries into the code to try to figure out the problem and it looks like it is happening in the lightning framework after connectedCallback but before renderedCallback and not my components, I need it resolved since I have several customers depending on this code...

screen shot
For some reason, my Contact object still shows existing contacts inside my unit tests even though I am not using seeAllData=true...
 
@isTest
public class TravelDetailGateway_Tests {
    @isTest
    public static void loadData_Tests() {
        Test.loadData(Account.sobjectType, 'test_data_accounts'); //file contains 10 rows.
        //contact in file is associated to account 9 in the file above.
        Test.loadData(Contact.sobjectType, 'test_data_contacts'); //file coontains 1 row.
        
        integer acctCount = [SELECT count() FROM Account];
        integer ctcCount = [SELECT count() FROM Contact];
        
        system.assertEquals(10, acctCount);
        system.assertEquals(1, ctcCount); //assertion fails and returns 11 records.
    }
}

 
I have a lightning component embedded in a flow, how do I pass the recordId from the flow into the lightning component?

Everything I have found shows the old flow designer.  The new lightning flow designer does not have an option to set input fields on the lightning component.

Thanks.
I can successfully run the mdpai:convert and it does convert many of the mdapi folders to source, however there are several folders that are missing once it is complete.  The one I am most concerned about is the objects folder.  No objects get converted though objectTranslations do.

Anyone have insight on how to resolve this?
Hello,

How do I solve the problem shown in the image?  I am launching a flow from an aura lightning component inside a modal container. I have tried adding a class to the lightning:flow, the container div, no luck.  Thx.

User-added image
I want to generate a consistent number or rows in  a table regardless of how many related objects exists (i.e. I want 7 rows even when there is only 3 related list objects).

I was trying to use a repeat without a value attribute to try to just create a generic looping behavior but that does not work.  I am using a standard controller and didn't want to create an extension just to generate the other rows.  Here is the code...
 
<apex:variable var="rowNum" value="{!1}"/>
			<apex:repeat var="f" value="{!sow__c.Facilities__r}" rows="7">  
                <apex:variable var="rowNum" value="{!rowNum + 1}"/>
            	<div class="row">
                <div class="col-7">
                    <div class="row">
                        <div class="bodycell col-4">
                            <span>{!f.Account__r.Name}</span>
                        </div>
                        
                        <div class="bodycell center col-2">
                            <span>
                                <apex:outputText value="{0, number, 0}">
                                    <apex:Param value="{!f.v1__c}" />
                                </apex:outputText>                                
                            </span>
                        </div>
                        
                        <div class="bodycell center col-2">
                            <span>
                                <apex:outputText value="{0, number, 0}">
                                    <apex:Param value="{!f.v2__c}" />
                                </apex:outputText> 
                            </span>
                        </div>
                        
                        <div class="bodycell col-4">
                            <span>{!f.v3__c}</span>
                        </div>
                    </div>
                </div>
                
                <div class="bodycell col-5">
                    <span>{!f.v4__c}</span>
                </div>
            </div>
            </apex:repeat>
            <apex:repeat var="f" rows="{!(7 - rowNum)}">
            	<div class="row">
                <div class="col-7">
                    <div class="row">
                        <div class="bodycell col-4">
                            <span>&nbsp;</span>
                        </div>
                        
                        <div class="bodycell col-2">
                            <span>&nbsp;</span>
                        </div>
                        
                        <div class="bodycell col-2">
                            <span>&nbsp;</span>
                        </div>
                        
                        <div class="bodycell col-4">
                            <span>&nbsp;</span>
                        </div>
                    </div>
                </div>
                
                <div class="bodycell col-5">
                    <span>&nbsp;</span>
                </div>
            </div>
            </apex:repeat>

This does't work and I have scowered google with not resolution, any help would be greatly appreciated.
I cannot figure out why this code is throwing the following error...
System.FinalException: Record is read-only

This code is in a helper method that receives a single object from the Trigger.New value and will alway be a single object not bulk.  Error line appears to be this bit of code "hr.Date_Interviewed__c = date.today();"  The trigger fired is a before update...

if (Trigger.isBefore && Trigger.isUpdate) {
Hiring_Audit__c hr = (Hiring_Audit__c) so;
if(hr.Stage__c == 'Submittal') {
hr.Date_Submitted__c = date.today();
}
else if(hr.Stage__c == 'Interview') {
hr.Date_Interviewed__c = date.today();
}
else if(hr.Stage__c == 'Offered') {
hr.Date_Offered__c = date.today();
}
else {
hr.Date_Applied__c = date.today();
}
update hr;
}


 
The unit provides the following link...

https://login.salesforce.com/packaging/installPackage.apexp?p0=04tj0000001mMYP

The component at that url is  the Opp Alert component which installs fine, however,  the challenge is looking for a ContactsToday component which is not installed.

How do I complete this unit?
I have a lightning component embedded in a flow, how do I pass the recordId from the flow into the lightning component?

Everything I have found shows the old flow designer.  The new lightning flow designer does not have an option to set input fields on the lightning component.

Thanks.
Hello,

I have several lwc components that have been in use for several months now and recently, no changes made to the components they have stopped working.  I have put console log entries into the code to try to figure out the problem and it looks like it is happening in the lightning framework after connectedCallback but before renderedCallback and not my components, I need it resolved since I have several customers depending on this code...

screen shot
For some reason, my Contact object still shows existing contacts inside my unit tests even though I am not using seeAllData=true...
 
@isTest
public class TravelDetailGateway_Tests {
    @isTest
    public static void loadData_Tests() {
        Test.loadData(Account.sobjectType, 'test_data_accounts'); //file contains 10 rows.
        //contact in file is associated to account 9 in the file above.
        Test.loadData(Contact.sobjectType, 'test_data_contacts'); //file coontains 1 row.
        
        integer acctCount = [SELECT count() FROM Account];
        integer ctcCount = [SELECT count() FROM Contact];
        
        system.assertEquals(10, acctCount);
        system.assertEquals(1, ctcCount); //assertion fails and returns 11 records.
    }
}

 
Hello all,
I'm getting the error in subject when I try to run this code:
@auraEnabled(cacheable=true)
public static void Equalize(string campaignsStr){
    string[] campaigns = (string[])JSON.deserialize(campaignsStr, list<String>.class);

    //Will hold the opportunities to update
    list<opportunity> updates = new list<opportunity>();

    //Will keep track of user ids and opp counts
    map<string, integer> owners = new map<string, integer>();	//String = OwnerID	Integer = opp count

    list<opportunity> opps = [SELECT Id, OwnerId FROM Opportunity WHERE Primary_Campaign_Filter__c IN :campaigns LIMIT 9999];
    System.debug('opps size: ' + opps.size());

    //Initializing the values of the owners map
    for(opportunity o: opps){
        if(owners.containsKey(o.ownerID)){
            owners.put(o.ownerID, owners.get(o.ownerID) + 1);
        }
        else{
            owners.put(o.ownerID, 1);
            System.debug('Adding owner ' + o.ownerId);
        }
    }

    //For each opportunity, if that owner already has more than the average,
    //give it to the person with the lowest opportunity count.
    integer threshold = opps.size()/owners.size() + 2;
    for(opportunity o: opps){
        if(owners.get(o.OwnerID) > threshold){
            string lowest = GetLowest(owners);
            owners.put(o.OwnerID, owners.get(o.OwnerID) - 1);
            owners.put(lowest, owners.get(lowest) + 1);
            o.OwnerID = lowest;
            updates.add(o);
        }
    }

    //PULL MY DEVIL TRIGGER
    System.debug('updates size: ' + updates.size());
    try{update updates;}
    catch(exception e){
        System.debug('exception: ' + e);
    }
}
I have seen solutions for Lightning Components (like https://developer.salesforce.com/forums/?id=906F0000000917DIAQ), but none that apply to Lightning Web Components. This is part of a component that has multiple other apex methods being called, and they all update fine.

Can anyone help me identify where the problem is?

Thanks!
 
I want to generate a consistent number or rows in  a table regardless of how many related objects exists (i.e. I want 7 rows even when there is only 3 related list objects).

I was trying to use a repeat without a value attribute to try to just create a generic looping behavior but that does not work.  I am using a standard controller and didn't want to create an extension just to generate the other rows.  Here is the code...
 
<apex:variable var="rowNum" value="{!1}"/>
			<apex:repeat var="f" value="{!sow__c.Facilities__r}" rows="7">  
                <apex:variable var="rowNum" value="{!rowNum + 1}"/>
            	<div class="row">
                <div class="col-7">
                    <div class="row">
                        <div class="bodycell col-4">
                            <span>{!f.Account__r.Name}</span>
                        </div>
                        
                        <div class="bodycell center col-2">
                            <span>
                                <apex:outputText value="{0, number, 0}">
                                    <apex:Param value="{!f.v1__c}" />
                                </apex:outputText>                                
                            </span>
                        </div>
                        
                        <div class="bodycell center col-2">
                            <span>
                                <apex:outputText value="{0, number, 0}">
                                    <apex:Param value="{!f.v2__c}" />
                                </apex:outputText> 
                            </span>
                        </div>
                        
                        <div class="bodycell col-4">
                            <span>{!f.v3__c}</span>
                        </div>
                    </div>
                </div>
                
                <div class="bodycell col-5">
                    <span>{!f.v4__c}</span>
                </div>
            </div>
            </apex:repeat>
            <apex:repeat var="f" rows="{!(7 - rowNum)}">
            	<div class="row">
                <div class="col-7">
                    <div class="row">
                        <div class="bodycell col-4">
                            <span>&nbsp;</span>
                        </div>
                        
                        <div class="bodycell col-2">
                            <span>&nbsp;</span>
                        </div>
                        
                        <div class="bodycell col-2">
                            <span>&nbsp;</span>
                        </div>
                        
                        <div class="bodycell col-4">
                            <span>&nbsp;</span>
                        </div>
                    </div>
                </div>
                
                <div class="bodycell col-5">
                    <span>&nbsp;</span>
                </div>
            </div>
            </apex:repeat>

This does't work and I have scowered google with not resolution, any help would be greatly appreciated.
I cannot figure out why this code is throwing the following error...
System.FinalException: Record is read-only

This code is in a helper method that receives a single object from the Trigger.New value and will alway be a single object not bulk.  Error line appears to be this bit of code "hr.Date_Interviewed__c = date.today();"  The trigger fired is a before update...

if (Trigger.isBefore && Trigger.isUpdate) {
Hiring_Audit__c hr = (Hiring_Audit__c) so;
if(hr.Stage__c == 'Submittal') {
hr.Date_Submitted__c = date.today();
}
else if(hr.Stage__c == 'Interview') {
hr.Date_Interviewed__c = date.today();
}
else if(hr.Stage__c == 'Offered') {
hr.Date_Offered__c = date.today();
}
else {
hr.Date_Applied__c = date.today();
}
update hr;
}