• fredka
  • NEWBIE
  • 270 Points
  • Member since 2008

  • Chatter
    Feed
  • 9
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 113
    Questions
  • 238
    Replies
I have taken an example to create a PDF from an LWC.  From an LWC component I am calling an Aura enabled class.  That class passes the HTML using a variable to a visualforce page that renders as a PDF.

In my own development org, I am getting the expected results.  However, when I use the exact same code in another sandbox, I am getting a null PDF.  I put a debug in the controller for the visualforce page.  The debug does not post in the code that is not working. Therefore, it seems that my pagereference is not working.

As I mentioned, the exact code is working in my development org, just not in the sandbox that I copy it to.  Any suggestions on why that woudl happen?  thanks!!!
I have been working on this for a while and keep hitting walls.  I would like to create/save/email a list on a lighting web component as a PDF.  I started by trying to use my VF page that renders as PDF but could not pass the data.  I'm told that it will not work.  I moved on to jspdf but found that I could not customize the table as much as I wanted.   The last think I tried was to use jspdf-autotable.  However, I keep getting an error " [t.autoTable is not a function] "   Does anyone have any insight or maybe even an example they could share?  thanks!!
  • April 30, 2021
  • Like
  • 0
I have been working on a cloning process where the user selects a number and then uses a row action to copy a record x number of times from my structures__c custom object. I have the process to copy the record into an array the number of times selected and I pass that array to a child component. I am now trying to figure out the best way to: 1. display the list of records on the page as input fields 2. convert what is not a general array into the correct object and then save the records.
I originally tried to use a for:each around the array with a lightning-record-edit-form inside. However, this displays individual forms with buttons for each form. I would like to display rows with a button to save. Any advise on how to do that and also how I convert this general array to be that of my custom object would be greatly appreciated. thanks!!
 
  • January 14, 2021
  • Like
  • 0
This morning I am getting the followng warning:

[LWC warning]: Property "_def" of [object:vm undefined (0)] is set to a non-trackable object, which means changes into that object cannot be observed.

It pops up no matter where I navigate in my org.  Last night, everything was fine and I was not receiving it.  

I'm a javascript novice and I've had a difficult time understanding the issue.  Any help would be greatly apprecaited!

Thanks!

Fred
  • January 29, 2019
  • Like
  • 0
I am opening a second component and passing an attribute using the pageReference.state.  I can see the attribute is populated when I do a console.log.  However, the following lightning:datatable is not displaying any of the groupstructure attributes values.  Here is my component:
 
<aura:component implements="lightning:isUrlAddressable" access="global" >
    
    <!-- handlers-->
    <aura:handler name="init" value="{! this }" action="{! c.init }"/>

    
	<!-- Main attribute uses to display all of the group structures as PDF -->
    <aura:attribute name="groupstructures" type="Group_Structure__c[]"/>
    <aura:attribute name="columns" type="List"/>
    
    <!--Attributes for Sorting table -->
    <aura:attribute name="sortedBy"
                type="String" />
	<aura:attribute name="sortedDirection"
                type="Boolean"
                default="true" 
                    />

    <!-- Button to print PDF -->
    <ui:button label="Print"  press="{!c.PrintTable}"/>
    <!-- the container element determine the height of the datatable -->
    
    <div style="height: 300px">
        <lightning:datatable aura:id="gstable"
                
                data="{! v.groupstructures }"
                columns="{! v.columns }"
                sortedBy="{!v.sortedBy}"
            	sortedDirection="{!v.sortedDirection}"
            	onsort="{!c.updateColumnSorting}"
            	hideCheckboxColumn="true"            />
    </div>

</aura:component>
Here is my controller:
 
({
	init: function (cmp, event, helper) {
        
        //set the groupstructures attribute that is being passed via page reference need the next two lines of code
        var pageReference = cmp.get("v.pageReference");
	    cmp.set("v.groupstructures", pageReference.state.groupstructures);

    cmp.set('v.columns', [
            {label: 'Status', fieldName: 'Status__c', type: 'text', sortable: true},
            {label: 'Funding Type', fieldName: 'Funding_Type__c', type: 'text', sortable: true},
            {label: 'Group Number', fieldName: 'Group_Number__c', type: 'text', sortable: true},
        	{label: 'Section Code', fieldName: 'Section_Code__c', type: 'text', sortable: true},
        	{label: 'Package Code', fieldName: 'Package_Code__c', type: 'text', sortable: true},
            {label: 'Effectve Date', fieldName: 'Effective_Date__c', type: 'text', sortable: true},
        	{label: 'End Date', fieldName: 'End_Date__c', type: 'text', sortable: true},
        	{label: 'Health_Product', fieldName: 'Health_Product__c', type: 'text', sortable: true},
        	{label: 'Prescription?', fieldName: 'Prescription__c', type: 'text', sortable: true},
        	{label: 'Dental?', fieldName: 'Dental__c', type: 'text', sortable: true},
        	{label: 'Vision?', fieldName: 'Vision__c', type: 'text', sortable: true},
        	{label: 'CDH Status', fieldName: 'CDH_Status__c', type: 'text', sortable: true},
        	{label: 'Coverage Categories', fieldName: 'Coverage_Categories__c', type: 'text'},
        	{label: 'Prefix', fieldName: 'Prefix__c', type: 'text', sortable: true},
        	{label: 'Description', fieldName: 'Description__c', type: 'text', sortable: true}

        ]);
		console.log("### here is the groupstructures ???" + JSON.stringify(cmp.get("v.groupstructures")));
    },
        
 updateColumnSorting: function(component, event, helper) {
    var fieldName = event.getParam('fieldName');
    var sortDirection = event.getParam('sortDirection');
     // assign the latest attribute with the sorted column fieldName and sorted direction
    component.set("v.sortedBy", event.getParam("fieldName"));
    component.set("v.sortedDirection", event.getParam("sortDirection"));
    helper.sortData(component, fieldName, sortDirection);
    },
        
    PrintTable : function(component, event, helper) {
    var url = location.origin + '/apex/GroupStructureListPrint'
        ; 
    window.open(url, '_self');
        console.log("### Im in the PrintPageAction");
	},
    
})
Any help would be greatly appreciated!!! thanks!!

Fred
 
  • January 29, 2019
  • Like
  • 0
I  was using e.force:navigateToComponent and had everything working but then realized this is depreciated.  I am attempting to replace the logic by using navigate.  

It seems to be working in that I get redirected to the second component but the attribute that I am passing is not displaying in my data table.  I see that the attribute on the second component is getting populated but its just not displaying in my datatable.  

Any help is greatly appreciated!

Here is the function that calls the second component:

    //New code to replace navigateToComponent
    component.find("nav").navigate({
            type: "standard__component",
            attributes: {
                componentName: "c__GroupStructureListPDF"
            },
            state: {
                groupstructures: component.get("v.groupstructures")
            }
        });

   },

Here is the second component:

    <aura:component implements="lightning:isUrlAddressable" access="global" >
    
    <!-- handlers-->
    <aura:handler name="init" value="{! this }" action="{! c.init }"/>

    <!-- Main attribute uses to display all of the group structures as PDF -->
    <aura:attribute name="groupstructures" type="Group_Structure__c[]"/>
    
    <aura:attribute name="data" type="Object"/>
    <aura:attribute name="columns" type="List"/>
    
    <!--Attributes for Sorting table -->
    <aura:attribute name="sortedBy"
                type="String" />
    <aura:attribute name="sortedDirection"
                type="Boolean"
                default="true" />
    
     <!-- Button to print PDF -->
    <ui:button label="Print"  press="{!c.PrintTable}"/>
  
    <!-- the container element determine the height of the datatable -->
    <div style="height: 300px">
        <lightning:datatable aura:id="lightningTable"
                keyField="id"
                data="{! v.groupstructures }"
                columns="{! v.columns }"
                sortedBy="{!v.sortedBy}"
                sortedDirection="{!v.sortedDirection}"
                onsort="{!c.updateColumnSorting}"
                hideCheckboxColumn="true"/>
    </div>
 
</aura:component>

Here is the init function for the second component

    ({
    init: function (cmp, event, helper) {
        
        //set the groupstructures attribute that is being passed via page reference need the next two lines of code
        var pageReference = cmp.get("v.pageReference");
        cmp.set("v.groupstructures", pageReference.state.groupstructures);
        
        console.log("### here are the group structures!!! " + JSON.stringify(cmp.get("v.groupstructures")));
    cmp.set('v.columns', [
            {label: 'Status', fieldName: 'Status__c', type: 'text', sortable: true},
            {label: 'Funding Type', fieldName: 'Funding_Type__c', type: 'text', sortable: true},
            {label: 'Group Number', fieldName: 'Group_Number__c', type: 'text', sortable: true},
            {label: 'Section Code', fieldName: 'Section_Code__c', type: 'text', sortable: true},
            {label: 'Package Code', fieldName: 'Package_Code__c', type: 'text', sortable: true},
            {label: 'Effectve Date', fieldName: 'Effective_Date__c', type: 'text', sortable: true},
            {label: 'End Date', fieldName: 'End_Date__c', type: 'text', sortable: true},
            {label: 'Health_Product', fieldName: 'Health_Product__c', type: 'text', sortable: true},
            {label: 'Prescription?', fieldName: 'Prescription__c', type: 'text', sortable: true},
            {label: 'Dental?', fieldName: 'Dental__c', type: 'text', sortable: true},
            {label: 'Vision?', fieldName: 'Vision__c', type: 'text', sortable: true},
            {label: 'CDH Status', fieldName: 'CDH_Status__c', type: 'text', sortable: true},
            {label: 'Coverage Categories', fieldName: 'Coverage_Categories__c', type: 'text'},
            {label: 'Prefix', fieldName: 'Prefix__c', type: 'text', sortable: true},
            {label: 'Description', fieldName: 'Description__c', type: 'text', sortable: true},

        ]);

    },
  • January 16, 2019
  • Like
  • 0
I have a parent component that itterates using a child attribute.  I have passed the value to the child and in the child code I want to update the parents attribute.  I thought the attribute would update based on what I have but its not.  Any help would be greatly appreciated!  Here is what I have.  Its the cloning attribute I want to update.   (I stripped out the code that was not relevant)
Parent component:
 
<!-- attribute used to Toggle when Cloning  -->
    <aura:attribute name="cloning" type="boolean" default="false"/>
<aura:if isTrue="{!v.cloning}">       
      <lightning:layout>
         <lightning:layoutItem padding="horizontal-medium" size="12">  
            <!-- Iterate over the list of Group Structures and display them -->
            <aura:iteration var="NGS" items="{!v.newGroupsStructures}">
                  <c:GroupStructures newGroupStructures="{!NGS}" cloning="{!v.cloning}" groupstructure="{!v.groupstructures}"/>
            </aura:iteration>
        </lightning:layoutItem>
    </lightning:layout>
  </aura:if>

Here is the sub component:
NavigatetoGSClone:function(component,event,helper){
     
        //set the variable to cloning to update the page 
        var cloneTrue = "True"; 
          component.set("v.cloning", cloneTrue);
       
  	
    },

 
  • January 03, 2019
  • Like
  • 0
I am having an issue updating data in a list attribute.  I confirmed that I have two records in the newGroupStructures component.  Please refer to the following main component.  This component gets passed a record from another component and populates the 'existinggroupstructure' attribute with the data from that record. I am trying to use that record as a starting point to allow users to make changes and then create a new record.  The attribute named CloneNumber also gets populated with a value from the component that calls it.  So if the value is two, there are two new records created and populated with the data of the record that was passed.
  Here is the main component...


<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride" controller="GSClone">
    
 
    
    <!-- here is the variable to hold the group structure that gets passed from the GroupStructures Component (that was clicked) -->
	<aura:attribute name="existinggroupstructure" type="Group_Structure__c[]" />
    <aura:attribute name="CloneNumber" type="Integer"/>
    <aura:attribute name="newGroupStructures" type="Group_Structure__c[]"/>
	<!-- button to save or cancel -->
    <lightning:button variant="brand" label="Save Clones" onclick="{!c.SaveCloneGS}" />
    <lightning:button variant="brand" label="newGroupStructures values" onclick="{!c.CheckGS}" />
    <!-- Handle component initialization in a client-side controller -->
	<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
	
    	<!-- iterate over the newGroupStructures -->
 		<!-- <aura:iteration var="groupstructure" items="{!v.newGroupStructures}">   -->
    <lightning:layout>
       <lightning:layoutItem padding="horizontal-medium" size="12">
    <!-- Iterate over the list of Group Structures and display them -->
           <aura:iteration var="groupstructure" items="{!v.newGroupStructures}">
                  <c:GSCloneRecord groupstructure="{!groupstructure}"/>
            </aura:iteration>
       </lightning:layoutItem>
    </lightning:layout>
</aura:component>

Here is the GSCloneRecord component that is iterated on the main component.  I had a editrecordform here but could not get it to work so I switched to a card.  Still need to do work on the fields, etc.
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId,lightning:isUrlAddressable" controller="GSController">
    <aura:attribute name="groupstructure" type="Group_Structure__c" />
	<!-- Handle component initialization in a client-side controller -->
	<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

     <!-- Display the new contact form -->
    <div class="Create Contact">
        <lightning:card iconName="action:new_contact" title="Create Contact">
            <div class="slds-p-horizontal--small">
                <lightning:button variant="brand" label="groupstructure values" onclick="{!c.CheckGS}" />
                <lightning:input aura:id="contactField" label="Section" value="{!v.groupstructure.Section_Code__c}"/>
                <lightning:input aura:id="contactField" label="Package" value="{!v.groupstructure.Package_Code__c}"/>
                <lightning:input aura:id="contactField" label="Group Num" value="{!v.groupstructure.Group_Number__c}"/>
                <br/>
         
            </div>
        </lightning:card>
    </div>

</aura:component>
This component display properly.. the problem is that when there are two records, each record in the newgroupstructures attribute gets populated with teh same value.  If I enter a value in the section code field (for example)  whatever value I enter last gets populated to both records.

even before I save the record.. immediately after I enter a value, both records get updated with that value.  Any help would be greatly appreciated!! thanks!!!

Fred

 
  • November 28, 2018
  • Like
  • 0
I am trying to complete the last segment of this trail.  I'm getting the following error: Challenge Not yet complete... here's what's wrong: 
The campingList component doesn't appear to have a Quantity input field in the form using a Lightning Base component.

On my camping list component I refer to two other components.  c:campingListForm and c: campingListItem   I do have the Quanity field on each of those components.  I assume it is the campingListItem that I am having issue with but not sure why.  This code was not a problem for the all of the other segments of the trail.  Any help would be greatly appreciated.  Here is the code for my camplinglistitem component:
​<aura:component >

 <aura:attribute name="item" type="Camping_Item__c" />
  
    <p>Name:
        <ui:outputText value="{!v.item.Name}"/>
    </p>
    
    <p>Price:
        <ui:outputCurrency value="{!v.item.Price__c}"/>
    </p>
    
    <p>Quantity:
                <ui:outputNumber value="{!v.item.Quantity__c}"/>
    </p>
    
    <p>Packed:
        <ui:outputCheckbox value="{!v.item.Packed__c}"/>
    </p>
    
    <ui:button label="Packed!"
            press="{!c.packItem}"/>
    
</aura:component>
  • September 22, 2017
  • Like
  • 0
Just last week I started getting issues with picklists that have restricted values.  I am creating records in a test and I have copied the value right from the picklist when I recreate it in my test.. however, the test is failing due to, "System.DmlException: Insert failed. First exception on row 1; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field: Inter-Plan Preparing: [Cede_Status__c]"

I'm hoping there is just something I'm missing here?  

thanks!!

Fred
  • March 22, 2017
  • Like
  • 0
Hi.. Everything that I have found on this topic has been dated.  I have two field updates and I need one to fire before the other.  I strated by trying to build a formula field butthe formula ended up too big so I moved on to workflow field updates.

I know there is the checkbox to re-evaluate the rules if a specific field update changes the field but I wnat to be sure that will work.  My seond field update uses the field in the first field update so I really need them to be ordered properly.

Thank you!!!

Fred
  • November 30, 2016
  • Like
  • 0
Hi.  I am trying to assign a queue as the case owner.. In a Case Before Trigger, I am have the following.  The case owner is getting updated if the abm__c field is populated.. however, it does not get updated with the queue if that field is null.

Account_Team__c at = aMap.get(c.AccountId);
                // Only change the owner if the Account Team has
                // an ABM and the ABM is an active user. Once assigned
                // set the flag Assigned to ABM
            if (string.isNotBlank(at.abm__c)) {
                if (at.abm__r.IsActive) {
                    c.ownerid = at.abm__c;
                    c.Assigned_To_ABM__c = true;                    
                }
             }
              else {
                c.ownerid = abmQueue[0].Id;
                }

Any help woudl be greatly appreciated!!

Fred
  • October 12, 2016
  • Like
  • 1
I have a few rerenders on a page that work fine.  I was refreshing the entire page for the others.. however, I don't want to null out the fields that were previously populated if a required field has not yet been populated.

I'm trying to only display the 'Special Accommodation Instructions' pageblock if there is a value in the multi select list on the page named 'Special_Accommodations__c'   Any help would be greatly appreciated!!!!


 <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Special Accommodations"/>
                    <apex:actionregion >                    
                        <apex:inputfield value="{!case1.Special_Accommodations__c}" > 
                            <apex:actionSupport event="onchange" rerender="SAI, abc"  status="overlayStatus" />  
                        </apex:inputfield>
                    </apex:actionregion>
                </apex:pageblocksectionItem>
            </apex:pageBlockSection>
             <apex:outputPanel id="SAI">
           <apex:pageBlockSection title="Special Accommodation Instructions" columns="1" rendered="{!case1.Special_Accommodations__c <> null}" >
             <apex:pageBlockSectionItem >
                    <apex:outputPanel >
                        <div class="requiredInput">
                            <div class="requiredBlock"></div>                            
                            <apex:inputtextarea value="{!case1.Special_Accommodation_Instructions__c}" 
                                cols="100" rows="5"/>                              
                        </div>
                    </apex:outputPanel>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            </apex:outputpanel>
  • October 06, 2016
  • Like
  • 0
I have a select list where the user selects a number from 1 to 10:
<apex:outputText >New Laser Count?  </apex:outputText>
                                                    <apex:selectList label="new Count?" value="{!newLaserCount}" size="1" >
                                                    <apex:selectOptions value="{!newLaserCounts}" />
                                                    </apex:selectList>

I then want to loop through, using that number to create the same number of new records for the user to popualate.  Here is the part of the code where I am using the 'newLaserCount':

    Integer LaserCount = integer.valueOf(newLaserCount);  

         for (Integer i = 0; i < LaserCount; i++) {
            SLLNewList.add(new Laser__c());
        } 

If I hardcode the LaserCount field it gives me the correct number.. however, this does not work.  The default value of teh seleclist is 1.. it always creates one record recardless of the value populated in the selectlist.

I've done this before without issue but for some reason, this is just not getting updated.  Any help would be greatly appreciated!!!

​Fred
  • October 05, 2016
  • Like
  • 0
I have a cuastom controller that pulls in a specific record type of case.  I'm trying to add a realted list for attachments.  I added, 

<apex:relatedList list="Attachments" title="Attachments" subject="{!Case1}"/>

but I get the following error when I save the case record, " 'Attachments' is not a valid child relationship name for entity Case "

I can't figure out how to get the related listing of attachments.  All of the posts I find talking about this topic are old and do not fix my issue.

Any help would be greatly appreciated!!

Fred
  • August 25, 2016
  • Like
  • 0
I am trying to freeze the column heading in a pageblock table.  I have seen quite a few examples out there... most do not work or are missing pieces.  Does anyone have a working, complete example of how to implement this?  Thanks so much!!!!

Fred
  • September 22, 2015
  • Like
  • 0
I refreshed my sandbox and immediately after was not able to connect using the data loader or using ecliplse.  I did find out that by changing test.salesforce.com to cs30.salesforce.com in the data loader, I could connect.. I am just not sure how to make this change in eclipse.  Any help would be greatly appreciated!!  Thanks!!
  • February 27, 2015
  • Like
  • 0
I am looking for a seasoned administrator for a full time position in Southern NJ.  I would prefer someone with Health carrier experience.  This is a full time job and not remote.  If interested, please forward your resume and salary requirements to fred_kampf@horizonblue.com (mailto:fred_kampf@horizonblue.com)   Thanks!!!
  • January 06, 2015
  • Like
  • 0
Hi - I have a visualforce page.. within the page, I have a pageblock, pageblocksection, dataTable and then I have 10 columns (I know that is a lot)  The problem is the data is all crowded together.

It there any way to wrap the data so that perhaps it takes up two rows for each record? 

Any suggestions would be greatly appreciated!!

thanks!!
Fred
  • December 10, 2014
  • Like
  • 0
I have a calendar that displays on a VF page.  For some reason, certain users cannot see the calendar.  I believe it must be a setting on their computer but I can't figure it out.  If I sign is as any of those users, I can see the calendar.

Does anyone have any information on what could be wrong?

Thanks!

Fred
  • November 19, 2014
  • Like
  • 0
Hi.  I am trying to assign a queue as the case owner.. In a Case Before Trigger, I am have the following.  The case owner is getting updated if the abm__c field is populated.. however, it does not get updated with the queue if that field is null.

Account_Team__c at = aMap.get(c.AccountId);
                // Only change the owner if the Account Team has
                // an ABM and the ABM is an active user. Once assigned
                // set the flag Assigned to ABM
            if (string.isNotBlank(at.abm__c)) {
                if (at.abm__r.IsActive) {
                    c.ownerid = at.abm__c;
                    c.Assigned_To_ABM__c = true;                    
                }
             }
              else {
                c.ownerid = abmQueue[0].Id;
                }

Any help woudl be greatly appreciated!!

Fred
  • October 12, 2016
  • Like
  • 1
I have taken an example to create a PDF from an LWC.  From an LWC component I am calling an Aura enabled class.  That class passes the HTML using a variable to a visualforce page that renders as a PDF.

In my own development org, I am getting the expected results.  However, when I use the exact same code in another sandbox, I am getting a null PDF.  I put a debug in the controller for the visualforce page.  The debug does not post in the code that is not working. Therefore, it seems that my pagereference is not working.

As I mentioned, the exact code is working in my development org, just not in the sandbox that I copy it to.  Any suggestions on why that woudl happen?  thanks!!!
I have been working on this for a while and keep hitting walls.  I would like to create/save/email a list on a lighting web component as a PDF.  I started by trying to use my VF page that renders as PDF but could not pass the data.  I'm told that it will not work.  I moved on to jspdf but found that I could not customize the table as much as I wanted.   The last think I tried was to use jspdf-autotable.  However, I keep getting an error " [t.autoTable is not a function] "   Does anyone have any insight or maybe even an example they could share?  thanks!!
  • April 30, 2021
  • Like
  • 0
This morning I am getting the followng warning:

[LWC warning]: Property "_def" of [object:vm undefined (0)] is set to a non-trackable object, which means changes into that object cannot be observed.

It pops up no matter where I navigate in my org.  Last night, everything was fine and I was not receiving it.  

I'm a javascript novice and I've had a difficult time understanding the issue.  Any help would be greatly apprecaited!

Thanks!

Fred
  • January 29, 2019
  • Like
  • 0
I am opening a second component and passing an attribute using the pageReference.state.  I can see the attribute is populated when I do a console.log.  However, the following lightning:datatable is not displaying any of the groupstructure attributes values.  Here is my component:
 
<aura:component implements="lightning:isUrlAddressable" access="global" >
    
    <!-- handlers-->
    <aura:handler name="init" value="{! this }" action="{! c.init }"/>

    
	<!-- Main attribute uses to display all of the group structures as PDF -->
    <aura:attribute name="groupstructures" type="Group_Structure__c[]"/>
    <aura:attribute name="columns" type="List"/>
    
    <!--Attributes for Sorting table -->
    <aura:attribute name="sortedBy"
                type="String" />
	<aura:attribute name="sortedDirection"
                type="Boolean"
                default="true" 
                    />

    <!-- Button to print PDF -->
    <ui:button label="Print"  press="{!c.PrintTable}"/>
    <!-- the container element determine the height of the datatable -->
    
    <div style="height: 300px">
        <lightning:datatable aura:id="gstable"
                
                data="{! v.groupstructures }"
                columns="{! v.columns }"
                sortedBy="{!v.sortedBy}"
            	sortedDirection="{!v.sortedDirection}"
            	onsort="{!c.updateColumnSorting}"
            	hideCheckboxColumn="true"            />
    </div>

</aura:component>
Here is my controller:
 
({
	init: function (cmp, event, helper) {
        
        //set the groupstructures attribute that is being passed via page reference need the next two lines of code
        var pageReference = cmp.get("v.pageReference");
	    cmp.set("v.groupstructures", pageReference.state.groupstructures);

    cmp.set('v.columns', [
            {label: 'Status', fieldName: 'Status__c', type: 'text', sortable: true},
            {label: 'Funding Type', fieldName: 'Funding_Type__c', type: 'text', sortable: true},
            {label: 'Group Number', fieldName: 'Group_Number__c', type: 'text', sortable: true},
        	{label: 'Section Code', fieldName: 'Section_Code__c', type: 'text', sortable: true},
        	{label: 'Package Code', fieldName: 'Package_Code__c', type: 'text', sortable: true},
            {label: 'Effectve Date', fieldName: 'Effective_Date__c', type: 'text', sortable: true},
        	{label: 'End Date', fieldName: 'End_Date__c', type: 'text', sortable: true},
        	{label: 'Health_Product', fieldName: 'Health_Product__c', type: 'text', sortable: true},
        	{label: 'Prescription?', fieldName: 'Prescription__c', type: 'text', sortable: true},
        	{label: 'Dental?', fieldName: 'Dental__c', type: 'text', sortable: true},
        	{label: 'Vision?', fieldName: 'Vision__c', type: 'text', sortable: true},
        	{label: 'CDH Status', fieldName: 'CDH_Status__c', type: 'text', sortable: true},
        	{label: 'Coverage Categories', fieldName: 'Coverage_Categories__c', type: 'text'},
        	{label: 'Prefix', fieldName: 'Prefix__c', type: 'text', sortable: true},
        	{label: 'Description', fieldName: 'Description__c', type: 'text', sortable: true}

        ]);
		console.log("### here is the groupstructures ???" + JSON.stringify(cmp.get("v.groupstructures")));
    },
        
 updateColumnSorting: function(component, event, helper) {
    var fieldName = event.getParam('fieldName');
    var sortDirection = event.getParam('sortDirection');
     // assign the latest attribute with the sorted column fieldName and sorted direction
    component.set("v.sortedBy", event.getParam("fieldName"));
    component.set("v.sortedDirection", event.getParam("sortDirection"));
    helper.sortData(component, fieldName, sortDirection);
    },
        
    PrintTable : function(component, event, helper) {
    var url = location.origin + '/apex/GroupStructureListPrint'
        ; 
    window.open(url, '_self');
        console.log("### Im in the PrintPageAction");
	},
    
})
Any help would be greatly appreciated!!! thanks!!

Fred
 
  • January 29, 2019
  • Like
  • 0
I am trying to complete the last segment of this trail.  I'm getting the following error: Challenge Not yet complete... here's what's wrong: 
The campingList component doesn't appear to have a Quantity input field in the form using a Lightning Base component.

On my camping list component I refer to two other components.  c:campingListForm and c: campingListItem   I do have the Quanity field on each of those components.  I assume it is the campingListItem that I am having issue with but not sure why.  This code was not a problem for the all of the other segments of the trail.  Any help would be greatly appreciated.  Here is the code for my camplinglistitem component:
​<aura:component >

 <aura:attribute name="item" type="Camping_Item__c" />
  
    <p>Name:
        <ui:outputText value="{!v.item.Name}"/>
    </p>
    
    <p>Price:
        <ui:outputCurrency value="{!v.item.Price__c}"/>
    </p>
    
    <p>Quantity:
                <ui:outputNumber value="{!v.item.Quantity__c}"/>
    </p>
    
    <p>Packed:
        <ui:outputCheckbox value="{!v.item.Packed__c}"/>
    </p>
    
    <ui:button label="Packed!"
            press="{!c.packItem}"/>
    
</aura:component>
  • September 22, 2017
  • Like
  • 0
Hello sfdx gurus,
In Windows 7, I get the following error when I attampt to authorize the developer hub org. The login windows to DevHub opens up that lead to next error after I put my DevHub credential.
It works fine in Mac. 

Appreciate any input.


C:\Users\raip\sfdx\sfdx-dreamhouse>sfdx force:auth:web:login -d -a DevHub
ERROR running force:auth:web:login:  Command failed with response.
 - CylancePROTECT Script Control has blocked access to this PowerShell script.
.
Try this:
Determine why this command failed to get an encryption key for user raip: [C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -File C:\Users\raip\AppData\Local\sfdx\plug
ins\node_modules\salesforce-alm\CredMan.ps1 -GetCred -Target sfdx -User local].
 
Hi.. Everything that I have found on this topic has been dated.  I have two field updates and I need one to fire before the other.  I strated by trying to build a formula field butthe formula ended up too big so I moved on to workflow field updates.

I know there is the checkbox to re-evaluate the rules if a specific field update changes the field but I wnat to be sure that will work.  My seond field update uses the field in the first field update so I really need them to be ordered properly.

Thank you!!!

Fred
  • November 30, 2016
  • Like
  • 0
Hi.  I am trying to assign a queue as the case owner.. In a Case Before Trigger, I am have the following.  The case owner is getting updated if the abm__c field is populated.. however, it does not get updated with the queue if that field is null.

Account_Team__c at = aMap.get(c.AccountId);
                // Only change the owner if the Account Team has
                // an ABM and the ABM is an active user. Once assigned
                // set the flag Assigned to ABM
            if (string.isNotBlank(at.abm__c)) {
                if (at.abm__r.IsActive) {
                    c.ownerid = at.abm__c;
                    c.Assigned_To_ABM__c = true;                    
                }
             }
              else {
                c.ownerid = abmQueue[0].Id;
                }

Any help woudl be greatly appreciated!!

Fred
  • October 12, 2016
  • Like
  • 1
I have a select list where the user selects a number from 1 to 10:
<apex:outputText >New Laser Count?  </apex:outputText>
                                                    <apex:selectList label="new Count?" value="{!newLaserCount}" size="1" >
                                                    <apex:selectOptions value="{!newLaserCounts}" />
                                                    </apex:selectList>

I then want to loop through, using that number to create the same number of new records for the user to popualate.  Here is the part of the code where I am using the 'newLaserCount':

    Integer LaserCount = integer.valueOf(newLaserCount);  

         for (Integer i = 0; i < LaserCount; i++) {
            SLLNewList.add(new Laser__c());
        } 

If I hardcode the LaserCount field it gives me the correct number.. however, this does not work.  The default value of teh seleclist is 1.. it always creates one record recardless of the value populated in the selectlist.

I've done this before without issue but for some reason, this is just not getting updated.  Any help would be greatly appreciated!!!

​Fred
  • October 05, 2016
  • Like
  • 0
Problem Statement:

Create a form to enter new items and display the list of items entered. To make our camping list look more appealing, change the campingHeader component to use the SLDS. Similar to the unit, style the Camping List H1 inside the slds-page-header. Modify the campingList component to contain an input form and an iteration of campingListItem components for displaying the items entered.
  • The component requires an attribute named items with the type of an array of camping item custom objects.
  • The component requires an attribute named newItem of type Camping_Item__c with default quantity and price values of 0.
  • The component displays the Name, Quantity, Price, and Packed form fields with the appropriate input component types and values from the newItem attribute.
  • The JavaScript controller checks to ensure that the Name, Quantity and Price values submitted are not null.
  • If the form is valid, the JavaScript controller pushes the newItem onto the array of existing items, triggers the notification that the items value provider has changed, and resets the newItem value provider with a blank sObjectType of Camping_Item__c.

My Code:

CampingList.cmp

 
<aura:component >
	<ol>
        <li>Bug Spray</li>
        <li>Bear Repellant</li>
        <li>Goat Food</li>
    </ol>
 <aura:attribute name="items" type="Camping_Item__c[]"/>
 <aura:attribute name="newItem" type="Camping_Item__c"
     default="{'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Price__c': 0,
                    'Quantity__c': 0,
                    'Packed__c': false }"/>    
    <div style = "slds">
    <div class="slds-col slds-col--padded slds-p-top--large">
		<div aria-labelledby="newform">
			<fieldset class="slds-box slds-theme--default slds-container--small">
				<legend id="newform" class="slds-text-heading--small slds-p-vertical--medium">New Form</legend>
				<form class="slds-form--stacked">
					<div class="slds-form-element slds-is-required">
						<div class="slds-form-element__control">
							<ui:inputText aura:id="formname" label="Name" class="slds-input" labelClass="slds-form-element__label" value="{!v.newItem.Name}" required="true"/>
						</div>
					</div>
					<div class="slds-form-element slds-is-required">
						<div class="slds-form-element__control">
							<ui:inputCurrency aura:id="formprice" label="Price" class="slds-input" labelClass="slds-form-element__label" value="{!v.newItem.Price__c}" placeholder="0"/>
						</div>
					</div>
					<div class="slds-form-element">
						<div class="slds-form-element__control">
							<ui:inputNumber aura:id="formquantity" label="Quantity" class="slds-input" labelClass="slds-form-element__label" value="{!v.newItem.Quantity__c}" required="true" placeholder="0"/>
						</div>
					</div>
					<div class="slds-form-element">
						<ui:inputCheckbox aura:id="formpacked" label="Packed?" class="slds-checkbox" labelClass="slds-form-element__label" value="{!v.newItem.Packed__c}"/>
					</div>
					<div class="slds-form-element">
						<ui:button label="Create Form" class="slds-button slds-button--brand" press="{!c.clickCreateFormData}"/>
					</div>
				</form>
			</fieldset>
		</div>
    </div>

    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Camping</h3>
        </header>
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="items">
                    <c:campingListItem item="{!items}"/>
                </aura:iteration>
            </div>
        </section>
    </div>    
	</div>
</aura:component>
CampingListController.js:
 
({
    clickCreateFormData: function(component, event, helper) {

        var validitem = true;
        
        var nameField = component.find("formname");
        var expname = nameField.get("v.value");
		if ($A.util.isEmpty(expname)){
            validitem = false;
            nameField.set("v.errors", [{message:"Expense name can't be blank."}]);
        }
        else {
            nameField.set("v.errors",null);
        }
        
        var priceField = component.find("formprice");
        var expprice = nameField.get("v.value");
            if ($A.util.isEmpty(expprice)){
            validitem = false;
            priceField.set("v.errors", [{message:"Expense price can't be blank."}]);
        }
        else{
            priceField.set("v.errors",null);
        }
        
        var quantityField = component.find("formquantity");
        var expquantity = nameField.get("v.value");
        if ($A.util.isEmpty(expquantity)){
            validitem = false;
            quantityField.set("v.errors", [{message:"Expense quantity can't be blank."}]);
        }
        else{
            quantityField.set("v.errors",null);
        } 
        
      /*  if(validExpense){
            var newItem = component.get("v.newItem");
            console.log("Create item: " + JSON.stringify(newItem));
            helper.createExpense(component, newItem);
        } */
         if(validitem){
            var newItem = component.get("v.newItem");
            console.log("Create item: " + JSON.stringify(newItem));
        	var theItem = component.get("v.items");
            var newItem = JSON.parse(JSON.stringify(newItem));
            theItem.push(newItem);
            component.set("v.newItem",newItem);
        }
        component.set("v.newItem",{'sobjectType': 'Camping_Item__c',
                    'Name': '',
					'Price__c': 0,                                   
                    'Quantity__c': 0,
                    'Packed__c': false });
    }
})
CampingListItem.cmp:
 
<aura:component implements="force:appHostable">
   <aura:attribute name="item" type="Camping_Item__c"/>
     <p>The Item is: 
         <ui:outputText value="{!v.item}" />
    </p> 
    <p>Name:
        <ui:outputText value="{!v.item.Name}"/>
    </p>
    <p>Price:
    	<ui:outputCurrency value="{!v.item.Price__c}"/>
    </p>
    <p>Quantity:
		<ui:outputNumber value="{!v.item.Quantity__c}"/>
    </p>
    <p>Packed?:
    	<ui:outputCheckbox value="{!v.item.Packed__c}"/>
    </p>
    
  <!--  <p>
    	<ui:button label="Packed!" press="{!c.packItem}"/>
    </p> -->
</aura:component>

Could anyone help pass and run the challenge.

Thanks.

I am trying to use apex:actionFunction that has one parameter in my apex:page javascript but the parameter is always null and I cannot figure out WHY?

 

I created a simple test page to test what I am doing:

--------------------------------------------------------------------------

<apex:page standardController="Quote" extensions="QuoteLineItems_ControllerExtension">

<apex:pagemessages />
<apex:pageBlock mode="edit">
    <apex:form id="testPage_Form">
        <script language="JavaScript" type="text/javascript">  
            function test1() {
                alert('>> init TEST_PAGE <<');   
                updateTest('this is my test data');
            }
        </script>
        
        <apex:actionFunction name="updateTest" action="{!updateTestData}">
           <apex:param name="test_param1" value="TEST_DUMMY" />
        </apex:actionFunction>
        
        <input type='button' value='TEST 1' onclick='test1();'/>
    </apex:form>
</apex:pageBlock>
</apex:page>

 

Here is a method in my the controller:

--------------------------------------------------

    public PageReference updateTestData() {
        System.Debug('>>> updateTest <<<');
        String test_param1 = ApexPages.CurrentPage().getParameters().get('test_param1');
        System.Debug('>>> test_param1 = '+ test_param1 + ' <<<');
        return null;
    }

 

Debug Log returns:

    >>> updateTest <<<

    >>> test_param1 = null <<<         ?? WHY NULL, expecting 'this is my test data'

 

WHAT am I doing wrong?