-
ChatterFeed
-
9Best Answers
-
1Likes Received
-
0Likes Given
-
113Questions
-
238Replies
Create PDF displaying null page
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!!!
-
- fredka
- May 10, 2021
- Like
- 0
- Continue reading or reply
Create/Save/Email pdf from Lightning Web Component
-
- fredka
- April 30, 2021
- Like
- 0
- Continue reading or reply
LWC Copy a record multiple times
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!!
-
- fredka
- January 14, 2021
- Like
- 0
- Continue reading or reply
New Lighting Warning Today ??
[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
-
- fredka
- January 29, 2019
- Like
- 0
- Continue reading or reply
Setting Attribute using pageReference State
<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
-
- fredka
- January 29, 2019
- Like
- 0
- Continue reading or reply
Navigate Between Components 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},
]);
},
-
- fredka
- January 16, 2019
- Like
- 0
- Continue reading or reply
Update Attribute on Parent from Chile
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); },
-
- fredka
- January 03, 2019
- Like
- 0
- Continue reading or reply
Using Second Component to Iterate
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
-
- fredka
- November 28, 2018
- Like
- 0
- Continue reading or reply
Problem finishing Lightning Component Basics
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>
-
- fredka
- September 22, 2017
- Like
- 0
- Continue reading or reply
Restricted Picklists while testing
I'm hoping there is just something I'm missing here?
thanks!!
Fred
-
- fredka
- March 22, 2017
- Like
- 0
- Continue reading or reply
Can you order your field updates in Workflow
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
-
- fredka
- November 30, 2016
- Like
- 0
- Continue reading or reply
Assign Queue as Case Owner using Trigger
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
-
- fredka
- October 12, 2016
- Like
- 1
- Continue reading or reply
Rerender Question
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>
-
- fredka
- October 06, 2016
- Like
- 0
- Continue reading or reply
Using updated value from SelectList
<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
-
- fredka
- October 05, 2016
- Like
- 0
- Continue reading or reply
VF page with Custom Controller - error = 'Attachments' is not a valid child relationship name for entity Case
<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
-
- fredka
- August 25, 2016
- Like
- 0
- Continue reading or reply
Freeze Column Headers
Fred
-
- fredka
- September 22, 2015
- Like
- 0
- Continue reading or reply
Eclipse - connect to refreshed sandbox
-
- fredka
- February 27, 2015
- Like
- 0
- Continue reading or reply
Looking for an Advanced Admin For FT position in Southern NJ
-
- fredka
- January 06, 2015
- Like
- 0
- Continue reading or reply
DataTable - multiple rows for one record?
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
-
- fredka
- December 10, 2014
- Like
- 0
- Continue reading or reply
Calendar Javascript not showing for some users
Does anyone have any information on what could be wrong?
Thanks!
Fred
-
- fredka
- November 19, 2014
- Like
- 0
- Continue reading or reply
Assign Queue as Case Owner using Trigger
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
-
- fredka
- October 12, 2016
- Like
- 1
- Continue reading or reply
Create PDF displaying null page
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!!!
- fredka
- May 10, 2021
- Like
- 0
- Continue reading or reply
Create/Save/Email pdf from Lightning Web Component
- fredka
- April 30, 2021
- Like
- 0
- Continue reading or reply
New Lighting Warning Today ??
[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
- fredka
- January 29, 2019
- Like
- 0
- Continue reading or reply
Setting Attribute using pageReference State
<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
- fredka
- January 29, 2019
- Like
- 0
- Continue reading or reply
Problem finishing Lightning Component Basics
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>
- fredka
- September 22, 2017
- Like
- 0
- Continue reading or reply
ERROR running force:auth:web:login
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].
- Prakash Rai 7
- August 24, 2017
- Like
- 0
- Continue reading or reply
Can you order your field updates in Workflow
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
- fredka
- November 30, 2016
- Like
- 0
- Continue reading or reply
Assign Queue as Case Owner using Trigger
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
- fredka
- October 12, 2016
- Like
- 1
- Continue reading or reply
Using updated value from SelectList
<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
- fredka
- October 05, 2016
- Like
- 0
- Continue reading or reply
Lightning Components Basics - Input Data Using Forms
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.
- Yashita Goyal 17
- June 14, 2016
- Like
- 0
- Continue reading or reply
can't get the apex:param to pass value to controller?
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?
- nlsnyder
- May 02, 2012
- Like
- 0
- Continue reading or reply