-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
4Questions
-
4Replies
Apex based sharing
I am salesforce administrator getting my hand dirty with development
In apex class, I am not able to set Accountshare.ContactAcessLevel to edit.
Error: Field is not writeable: AccountShare.ContactAccessLevel
OWD setting on account object is public read-only and contact is controlled by the parent.
-
- Mounica M 10
- October 12, 2018
- Like
- 0
- Continue reading or reply
how to close a pop up on hitting escape button in lightning?
Hello,
I have a lightning component in which a window pops up on certain command. now i need to close the pop up on clicking ouside of the window or hitting esc button on key pad any ideas? Thank in advance
-
- Mounica M 10
- January 29, 2018
- Like
- 0
- Continue reading or reply
how to redirect to the detail record page when you click a button on a lightning component
I have calendar component(component-1) . when ever we click on a date, it pops a table with list of recordspresent in a day(component 2).now when we select a record by checking the check box beside it and click submit button it should be redirected to the record detail page.
Note: all the above is being implemented in a community built for the internal users.
component-2
<aura:component controller="EventDataTableServerCtrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
<aura:attribute name="StartTest" type="Date"/>
<aura:attribute name="StartDate" type="string" default="0"/>
<aura:attribute name="EndDate" type="String" default="2018-01-02T12:00:00-05:00"/>
<aura:attribute name="mydata" type="Object"/>
<aura:attribute name="mycolumns" type="List"/>
<aura:attribute name="SelectedRecord" type="String[]" default="0"/>
<!-- <aura:attribute name="isOpen" type="boolean" default="false"/> -->
<aura:handler name="change" value="{!v.StartTest}" action="{!c.handleValueChange}"/>
<aura:handler name="init" value="{! this }" action="{! c.init }"/>
<div style="height: 300px;">
<lightning:datatable data="{! v.mydata }"
columns="{! v.mycolumns }"
keyField="Id"
resizeColumnDisabled="True"
onrowselection="{!c.getSelectedName}"/>
</div>
<lightning:button variant="brand" label="Submit" onclick="{! c.closeModel }" />
</aura:component>
controller
({
init: function (cmp, event, helper) {
//console.log(new Date(cmp.get('v.StartDate')).getMilliseconds());
cmp.set('v.mycolumns', [
{label: 'Event Name', fieldName: 'Name', type: 'text'},
{label: 'Start Date & Time', fieldName: 'Event_Start_date_and_time__c', type: 'Date/Time'},
{label: 'End Date & Time', fieldName: 'Event_End_Date__c', type: 'Date/Time'}
]);
//helper.getData(cmp);
},
handleValueChange : function (component, event, helper) {
component.set('v.mycolumns', [
{label: 'Event Name', fieldName: 'Name', type: 'text'},
{label: 'Start Date & Time', fieldName: 'Event_Start_date_and_time__c', type: 'Date/Time'},
{label: 'End Date & Time', fieldName: 'Event_End_Date__c', type: 'Date/Time'}
]);
// handle value change
var date = event.getParam("value");
component.set('v.StartDate',date);
//component.set('v.StartDate',event.getParam("value"));
console.log("old value: " + event.getParam("oldValue"));
console.log("current value: " + event.getParam("value"));
helper.getData(component);
},
getSelectedName: function (cmp, event) {
var selectedRows = event.getParam('selectedRows');
for (var i = 0; i < selectedRows.length; i++){
console.log(selectedRows[i].Id);
cmp.set('v.SelectedRecord',selectedRows[i].Id);
}
},
},
gotoURL : function (cmp, event, helper) {
var eventId = cmp.get('v.SelectedRecord');
var navEvt = $A.get("e.force:navigateToSObject");
navEvt.setParams({
"recordId": eventId,
});
navEvt.fire();
}
})
-
- Mounica M 10
- January 11, 2018
- Like
- 1
- Continue reading or reply
how to redirect to the detail record page when you click a button on a lightning component
I have calendar component(component-1) . when ever we click on a date, it pops a table with list of recordspresent in a day(component 2).now when we select a record by checking the check box beside it and click submit button it should be redirected to the record detail page.
Note: all the above is being implemented in a community built for the internal users.
component-2
<aura:component controller="EventDataTableServerCtrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
<aura:attribute name="StartTest" type="Date"/>
<aura:attribute name="StartDate" type="string" default="0"/>
<aura:attribute name="EndDate" type="String" default="2018-01-02T12:00:00-05:00"/>
<aura:attribute name="mydata" type="Object"/>
<aura:attribute name="mycolumns" type="List"/>
<aura:attribute name="SelectedRecord" type="String[]" default="0"/>
<!-- <aura:attribute name="isOpen" type="boolean" default="false"/> -->
<aura:handler name="change" value="{!v.StartTest}" action="{!c.handleValueChange}"/>
<aura:handler name="init" value="{! this }" action="{! c.init }"/>
<div style="height: 300px;">
<lightning:datatable data="{! v.mydata }"
columns="{! v.mycolumns }"
keyField="Id"
resizeColumnDisabled="True"
onrowselection="{!c.getSelectedName}"/>
</div>
<lightning:button variant="brand" label="Submit" onclick="{! c.closeModel }" />
</aura:component>
controller
({
init: function (cmp, event, helper) {
//console.log(new Date(cmp.get('v.StartDate')).getMilliseconds());
cmp.set('v.mycolumns', [
{label: 'Event Name', fieldName: 'Name', type: 'text'},
{label: 'Start Date & Time', fieldName: 'Event_Start_date_and_time__c', type: 'Date/Time'},
{label: 'End Date & Time', fieldName: 'Event_End_Date__c', type: 'Date/Time'}
]);
//helper.getData(cmp);
},
handleValueChange : function (component, event, helper) {
component.set('v.mycolumns', [
{label: 'Event Name', fieldName: 'Name', type: 'text'},
{label: 'Start Date & Time', fieldName: 'Event_Start_date_and_time__c', type: 'Date/Time'},
{label: 'End Date & Time', fieldName: 'Event_End_Date__c', type: 'Date/Time'}
]);
// handle value change
var date = event.getParam("value");
component.set('v.StartDate',date);
//component.set('v.StartDate',event.getParam("value"));
console.log("old value: " + event.getParam("oldValue"));
console.log("current value: " + event.getParam("value"));
helper.getData(component);
},
getSelectedName: function (cmp, event) {
var selectedRows = event.getParam('selectedRows');
for (var i = 0; i < selectedRows.length; i++){
console.log(selectedRows[i].Id);
cmp.set('v.SelectedRecord',selectedRows[i].Id);
}
},
},
gotoURL : function (cmp, event, helper) {
var eventId = cmp.get('v.SelectedRecord');
var navEvt = $A.get("e.force:navigateToSObject");
navEvt.setParams({
"recordId": eventId,
});
navEvt.fire();
}
})
-
- Mounica M 10
- January 11, 2018
- Like
- 1
- Continue reading or reply
Apex based sharing
I am salesforce administrator getting my hand dirty with development
In apex class, I am not able to set Accountshare.ContactAcessLevel to edit.
Error: Field is not writeable: AccountShare.ContactAccessLevel
OWD setting on account object is public read-only and contact is controlled by the parent.
- Mounica M 10
- October 12, 2018
- Like
- 0
- Continue reading or reply
100% code coverage in development but 0% in change set
I wrote a simple Trigger to not allow deletion of a specific record. Also, I wrote a Test Class with 100% code coverage in dev. When attempting change set I am receiving a Code Coverage Failure, with 0% code coverage. What is happening? I have tried the Change Set as both Default, and only run the Test related to my Trigger. I am deploying both in the same Change Set. All suggestions appreciated!
Thanks, Ryan
Trigger:
trigger callapplyTrigger on Lead (before update, before insert,before delete){ if(Trigger.isDelete){ for (Lead l : [SELECT Id,Email FROM Lead WHERE Email = 'testingtrigger1@test.com' AND Id IN :Trigger.old]){ Trigger.oldMap.get(l.Id).addError( 'Cannot delete this Lead.'); } } }Test Class:
@isTest public class Test_callApply { @isTest static void TestDelete(){ Lead lead = new Lead(Segment__c='Small Group',Email='testingtrigger1@test.com', FirstName='testRyan',LastName='testGreene',Status='New', Company='testCompany',City='Orlando',State='FL',LeadSource='Event'); insert lead; Test.startTest(); Database.DeleteResult result = Database.delete(lead,false); Test.stopTest(); System.assert(!result.isSuccess()); System.assert(result.getErrors().size() > 0); System.assertEquals('Cannot delete this Lead.',result.getErrors()[0].getMessage()); } }
- Ryan Greene
- January 30, 2018
- Like
- 0
- Continue reading or reply
how to redirect to the detail record page when you click a button on a lightning component
I have calendar component(component-1) . when ever we click on a date, it pops a table with list of recordspresent in a day(component 2).now when we select a record by checking the check box beside it and click submit button it should be redirected to the record detail page.
Note: all the above is being implemented in a community built for the internal users.
component-2
<aura:component controller="EventDataTableServerCtrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
<aura:attribute name="StartTest" type="Date"/>
<aura:attribute name="StartDate" type="string" default="0"/>
<aura:attribute name="EndDate" type="String" default="2018-01-02T12:00:00-05:00"/>
<aura:attribute name="mydata" type="Object"/>
<aura:attribute name="mycolumns" type="List"/>
<aura:attribute name="SelectedRecord" type="String[]" default="0"/>
<!-- <aura:attribute name="isOpen" type="boolean" default="false"/> -->
<aura:handler name="change" value="{!v.StartTest}" action="{!c.handleValueChange}"/>
<aura:handler name="init" value="{! this }" action="{! c.init }"/>
<div style="height: 300px;">
<lightning:datatable data="{! v.mydata }"
columns="{! v.mycolumns }"
keyField="Id"
resizeColumnDisabled="True"
onrowselection="{!c.getSelectedName}"/>
</div>
<lightning:button variant="brand" label="Submit" onclick="{! c.closeModel }" />
</aura:component>
controller
({
init: function (cmp, event, helper) {
//console.log(new Date(cmp.get('v.StartDate')).getMilliseconds());
cmp.set('v.mycolumns', [
{label: 'Event Name', fieldName: 'Name', type: 'text'},
{label: 'Start Date & Time', fieldName: 'Event_Start_date_and_time__c', type: 'Date/Time'},
{label: 'End Date & Time', fieldName: 'Event_End_Date__c', type: 'Date/Time'}
]);
//helper.getData(cmp);
},
handleValueChange : function (component, event, helper) {
component.set('v.mycolumns', [
{label: 'Event Name', fieldName: 'Name', type: 'text'},
{label: 'Start Date & Time', fieldName: 'Event_Start_date_and_time__c', type: 'Date/Time'},
{label: 'End Date & Time', fieldName: 'Event_End_Date__c', type: 'Date/Time'}
]);
// handle value change
var date = event.getParam("value");
component.set('v.StartDate',date);
//component.set('v.StartDate',event.getParam("value"));
console.log("old value: " + event.getParam("oldValue"));
console.log("current value: " + event.getParam("value"));
helper.getData(component);
},
getSelectedName: function (cmp, event) {
var selectedRows = event.getParam('selectedRows');
for (var i = 0; i < selectedRows.length; i++){
console.log(selectedRows[i].Id);
cmp.set('v.SelectedRecord',selectedRows[i].Id);
}
},
},
gotoURL : function (cmp, event, helper) {
var eventId = cmp.get('v.SelectedRecord');
var navEvt = $A.get("e.force:navigateToSObject");
navEvt.setParams({
"recordId": eventId,
});
navEvt.fire();
}
})
- Mounica M 10
- January 11, 2018
- Like
- 1
- Continue reading or reply
Lightning Components Basics: Attributes & Expressions Trail
<aura:component>
<aura:attribute name="item" type="Camping_Item__c" required="true"/>
<ui:outputText value="{!v.item.Name}"/>
<ui:outputCheckbox value="{!v.item.Packed__c}"/>
<ui:outputCurrency value="{!v.item.Price__c}"/>
<ui:outputNumber value="{!v.item.Quantity}"/>
</aura:component>
- Jonathan Bruce
- June 28, 2016
- Like
- 1
- Continue reading or reply