-
ChatterFeed
-
5Best Answers
-
0Likes Received
-
0Likes Given
-
10Questions
-
31Replies
Compare records with same field value from different Objects
I've tried doing this in Excel via a VLOOKUP, but the dataset is too large and will not work in Excel. I'm new to SOQL, so I'm wondering if this is possible.
I'd need to retrieve a List of all Person Accounts where the email = Lead.Email with the following fields selected: Account ID, Account Name, Account Owner, Person_ID__pc.
- Joseph Barbato 5
- April 17, 2019
- Like
- 0
- Continue reading or reply
standard controller and extension controller referencing issues
I have a wrapper extension class that's intended to bring back grandchild records for a pageblock table within a Visualforce page. However, I keep getting errors when trying to save the Visualforce page referencing the extension controller. I'm not sure if there's a problem with the extension controller or the Visualforce page? Please see code below, any help is greatly appreciated!
VF Page:
<apex:page standardController="Consolidated_Invoicing__c" extensions="WrapperSarah" renderas="pdf">
Extension Controller:
public class WrapperSarah{
private final Consolidated_Invoicing__c consinvs;
public WrapperSarah(ApexPages.StandardController stdController) {
this.consinvs = (Consolidated_Invoicing__c)stdController.getRecord();
}
Can provide the full code if needed but only getting errors after this has been added in following a salesforce guide.
Thanks!
- SazEast
- April 17, 2019
- Like
- 0
- Continue reading or reply
SelectOption code coverage in test class
I have written below code in Apex Class. But I am not able to cover this code coverage. Please help on this.
public List<SelectOption> RelatedAccounts { get{ system.debug('ACCOUUNTS:' + Accs); List<SelectOption> options = new List<SelectOption>(); options.add(new selectOption('--Select--','')); for(CPF_Relationship__c r : Accs) { options.add(new SelectOption(r.id,r.child_account__r.name)); } return options; } }
- Padmini Sidugonde 6
- April 17, 2019
- Like
- 0
- Continue reading or reply
How do I display only the current record rather than all records using a custom wrapper class and visualforce page with an apex pageblocktable that shows the related records to the current object record?
Parent: Consolidated Invoicing
Child: Invoice
GrandChild: Treatments
I've created a wrapper class:
public class Wrapper{
public List<Consolidated_Invoicing__c> consolidatedInvoiceList { get; set; }
public List<Invoice__c> invoiceList { get; set; }
public Map<Id, List<Invoice__c>> coninvIdinvListMap { get; set; }
Set<Id> invoiceIds = new Set<Id>();
Map<Id, Consolidated_Invoicing__c> memberMap = new Map<Id, Consolidated_Invoicing__c>();
public List<ConsolidatedInvoiceWrapper> consolidatedInvoiceWrapperList { get; set; }
public Wrapper() {
consolidatedInvoiceList = [SELECT Total__c, Name FROM Consolidated_Invoicing__c];
coninvIdinvListMap = new Map<Id, List<Invoice__c>>();
consolidatedInvoiceWrapperList = new List<ConsolidatedInvoiceWrapper>();
if(consolidatedInvoiceList.size() > 0) {
for(Consolidated_Invoicing__c cons: consolidatedInvoiceList) {
invoiceIds.add(cons.Id);
memberMap.put(cons.Id, cons);
}
invoiceList = [SELECT Name, Consolidated_Invoice__c, (SELECT Name, Charge_Description__c FROM Treatments__r) FROM Invoice__c WHERE Consolidated_Invoice__c IN : invoiceIds];
system.debug('Invoice List is ' + invoiceList);
}
if(invoiceList.size() > 0) {
for(Invoice__c intrst : invoiceList) {
if(!coninvIdinvListMap.containsKey(intrst.Consolidated_Invoice__c)){
coninvIdinvListMap.put(intrst.Consolidated_Invoice__c, new List<Invoice__c>());
}
coninvIdinvListMap.get(intrst.Consolidated_Invoice__c).add(intrst);
}
for(Id invoiceId : coninvIdinvListMap.keySet()) {
consolidatedInvoiceWrapperList.add(new ConsolidatedInvoiceWrapper(memberMap.get(invoiceId), coninvIdinvListMap.get(invoiceId)));
}
}
}
public class ConsolidatedInvoiceWrapper{
public Consolidated_Invoicing__c consinv { get; set; }
public List<Invoice__c> invclist { get; set; }
public ConsolidatedInvoiceWrapper(Consolidated_Invoicing__c consinv, List<Invoice__c> invclist) {
this.consinv= consinv;
this.invclist = invclist;
}
}
}
And the the Visualforce page:
<apex:page Controller="Wrapper" renderas="pdf">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!consolidatedInvoiceWrapperList}" var="W">
<apex:column headerValue="Consolidated Invoice Number" value="{!W.consinv.Name}"/>
<apex:column headerValue="Total Amount Due" value="{!W.consinv.Total__c}"/>
<apex:column >
<apex:pageblockTable value="{!W.invclist }" var="I">
<apex:column headerValue= "Invoice Number" value="{!I.Name}"/>
<apex:column >
<apex:pageBlockTable value="{!I.Treatments__r}" var="E">
<apex:column headerValue="Charge Code" value="{!E.Name}"/>
<apex:column headerValue= "Description" value="{!E.Charge_Description__c}"/>
</apex:pageBlockTable>
</apex:column>
</apex:pageblockTable>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Is there something obvious i'm missing?
Thanks
- SazEast
- April 11, 2019
- Like
- 0
- Continue reading or reply
how to convert following class to handler:
List<id> levent = new List<id>();
Set<id> accid = new Set<id>();
List<Event> eventtoupdate = new List<Event>();
public integer inp=0;
if(trigger.isInsert){
for(Event ce:trigger.new){
accid.add(ce.WhatId);
}
}
if(trigger.IsDelete){
for(Event ce: trigger.old){
accid.add(ce.WhatId);
}
}
for(Event ev:[SELECT id FROM event WHERE whatid=:accid]){
levent.add(ev.id);
}
for(Event event :[SELECT id,Distribution_Meetings__c FROM Event WHERE id=:levent]){
event.Distribution_Meetings__c = levent.size();
eventtoupdate.add(event);
}
If(eventtoupdate.size()>0){
update eventtoupdate;
}
}
- Jkk
- April 11, 2019
- Like
- 0
- Continue reading or reply
LWC schema Field
/* eslint-disable no-console */ import { LightningElement, wire, track } from 'lwc'; import { getPicklistValues, getPicklistValuesByRecordType, getObjectInfo } from 'lightning/uiObjectInfoApi'; import ACCOUNT_SOURCE from '@salesforce/schema/Account.AccountSource'; import ACCOUNT_OBJECT from '@salesforce/schema/Account'; export default class PicklistDemo extends LightningElement { @track pickListvaluesByRecordType; @track accountsource; @wire(getPicklistValues, { recordTypeId : '012000000000000AAA', fieldApiName : ACCOUNT_SOURCE }) wiredPickListValue({ data, error }){ if(data){ console.log(` Picklist values are `, data.values); } if(error){ console.log(` Error while fetching Picklist values ${error}`); } } @wire(getPicklistValuesByRecordType, { recordTypeId : '012N0000000x2HE', objectApiName : ACCOUNT_OBJECT }) wiredRecordtypeValues({data, error}){ if(data){ console.log(' Picklist Values ', data.picklistFieldValues.Industry.values); this.pickListvaluesByRecordType = data.picklistFieldValues.Industry.values; this.accountsource = data.picklistFieldValues.AccountSource.values; } if(error){ console.log(error); } } }
I have one question.
When we are sending parameter to getPicklistValues as per field, Then we are importing the field by schema and sending that as a parameter. we are not using directly the field API name.
Like - import ACCOUNT_SOURCE from '@salesforce/schema/Account.AccountSource';
using here - @wire(getPicklistValues, { recordTypeId : '012000000000000AAA', fieldApiName : ACCOUNT_SOURCE })
But when we are fetching a particular field's value from "getPicklistValuesByRecordType", We are using the API name of the field.
We are not importing the field by the schema.
Like this - this.pickListvaluesByRecordType = data.picklistFieldValues.Industry.values;
Here we are using the direct API name of the "Industry" field. We are not importing this field and use it.
Why SO??????
Thanks in Advance,
- Biswojeet Ray 11
- September 09, 2020
- Like
- 0
- Continue reading or reply
Google Map Error
I am using Google Maps in one object. But suddenly it's not working. Getting error "initMap is not a function", name: "InvalidValueError", stack: "Error↵".
Do you guys know about this error?
Thanks,
- Biswojeet Ray 11
- July 27, 2020
- Like
- 0
- Continue reading or reply
community report Issue
I have created a Tab in my community. Then Added Report object in that tab.
But now the user can see every report in that tab.
I need to populate only some reports to users, not every report.
Is there any workaround?
Thanks in Advance,
- Biswojeet Ray 11
- July 27, 2020
- Like
- 0
- Continue reading or reply
Lightning record creation Issue
Hi Team,
I have created a Button on a Lightning page.
In that button added standard logic to create a budget Item object record.
Code
this[NavigationMixin.Navigate]({ type: "standard__objectPage", attributes: { objectApiName: "Budget_Item__c", actionName: "new" }, state: { nooverride: '1', defaultFieldValues: fieldValues } });
Its creating records perfectly. But the Issue is after the creation of record, It's navigating to a newly created record's detail page.
I want to stay on the previous page only(where I have added the button), No need to navigate the newly created record's detail page.
Is there any workaround? Urgently needed.
Thanks in advance,
- Biswojeet Ray 11
- July 26, 2020
- Like
- 0
- Continue reading or reply
Community Report error
Hi Team,
I have created a Tab in my community. Then Added Report object in that tab.
But now the user can see every report in that tab.
I need to populate only some reports to users, not every report.
Is there any workaround?
Thanks in Advance,
- Biswojeet Ray 11
- July 26, 2020
- Like
- 0
- Continue reading or reply
Location map Error
Hi Team,
I am using Google Maps in one object. But suddenly it's not working. Getting error "initMap is not a function", name: "InvalidValueError", stack: "Error↵".
Do you guys know about this error?
Thanks,
- Biswojeet Ray 11
- July 26, 2020
- Like
- 0
- Continue reading or reply
Lightning Email template error
Hi Team,
When a user is trying to approve an approval request, He is getting error.
I have attached the screenshot of the error also.
It's working in Classic.
There is an email alert in the approval process as Final Approval Actions.
The used email template in that email alert is classic.
The subject of the email template ->
{!Opportunity.Name} [{!Opportunity.Opportunity_Number__c}] approved
So please check it and let me know is this the issue with the classic email template or what?
Thanks a lot,
- Biswojeet Ray 11
- June 30, 2020
- Like
- 0
- Continue reading or reply
how to show the scroll bar at the bottom of the page block table on page load or refresh?
<apex:page controller="messageController" lightningStylesheets="true">
<apex:slds />
<style>
.headerRow .TableTitle {
color: #CC0000 !important;
}
.mymsg {
text-align: right;
color: blue;
}
.othermsg {
color: green;
}
</style>
<apex:form id="form">
<apex:pageBlock id="messages" title="{!Friend_Name}" rendered="{!showMessageBox}">
<apex:pageBlockSection >
<apex:outputPanel layout="block" style="overflow:auto;width:500px;height:200px" >
<apex:pageBlockTable value="{!messages}" var="msg">
<apex:column >
<apex:outputText rendered="{!msg.fromId == recordId}">
<!--<h1 style ="color: blue;" >{!msg.fromName}</h1><br/>
<h5>{!msg.msg}</h5><br/>
<h5>{!msg.dateValue}</h5><br/>-->
<p class="mymsg">
{!msg.fromName}<br/>
{!msg.msg}<br/>
{!msg.dateValue}
</p>
</apex:outputText>
<apex:outputText rendered="{!msg.fromId != recordId}" >
<!--<h2 style ="color: green; text-align:right">{!msg.fromName}</h2><br/>
<h5>{!msg.msg}</h5><br/>
<h5>{!msg.dateValue}</h5><br/>-->
<p class="othermsg">
{!msg.fromName}<br/>
{!msg.msg}<br/>
{!msg.dateValue}
</p>
</apex:outputText>
</apex:column>
</apex:pageBlockTable>
</apex:OutputPanel><br/>
<apex:inputTextarea value="{!currentMsg}"/>
<apex:commandButton value="Send" action="{!sendmessage}" reRender="messages"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
- Biswojeet Ray 11
- April 09, 2019
- Like
- 0
- Continue reading or reply
I am just want to create a contact from component by use of apex controller but getting this error.
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="ShowContactForAccount">
<aura:attribute name="newContact" Type="Contact" default="{
sobjectName : 'Contact',
FirstName : '',
LastName : '',
Email : '',
Phone : ''
}"></aura:attribute>
<aura:handler name="init" value="{!this}" action="{!c.showCOntactOnAccountPage}"/>
<!--Create Contact-->
<lightning:input type="text" label="First Name" value="{!v.newContact.FirstName}"/>
<lightning:input type="text" label="Last Name" value="{!v.newContact.LastName}"/>
<lightning:input type="email" label="Email" value="{!v.newContact.Email}"/>
<lightning:input name="phone" label="Phone" value="{!v.newContact.Phone}"/>
<lightning:button variant="success" label="Create Contact" title="Brand" onclick="{! c.createRecord }"/>
</aura:component>
Controller
createRecord : function(component, event, helper) {
alert(component.get('v.newContact'));
var contact = component.get("v.newContact");
var callMethod = component.get('v.createContact');
callMethod.setParams({
"accId" : component.get('v.recordId'),
"con" : contact
});
callMethod.setCallback(this, function(response) {
//var recs = response.getReturnValue();
//component.set('v.contactList', recs);
}, 'SUCCESS');
$A.enqueueAction(callMethod);
}
Apex Controller
public with sharing class ShowContactForAccount{
@auraEnabled
public Static Void createContact(String accId, Contact con){
system.debug(con);
con.AccountId = accId;
Insert con;
}
}
Error - Uncaught Action failed: c:MyShowRecordsComponentOnAccount$controller$createRecord [Cannot read property 'setParams' of undefined]
- Biswojeet Ray 11
- April 09, 2019
- Like
- 0
- Continue reading or reply
CurrencyIsoCode field is not showing in matching rule in sfdc ?
- Biswojeet Ray 11
- November 19, 2018
- Like
- 0
- Continue reading or reply
community report Issue
I have created a Tab in my community. Then Added Report object in that tab.
But now the user can see every report in that tab.
I need to populate only some reports to users, not every report.
Is there any workaround?
Thanks in Advance,
- Biswojeet Ray 11
- July 27, 2020
- Like
- 0
- Continue reading or reply
error code Line: 1, Column: 16 Unexpected token '('
I checked all the parentheses all of the in the code is correct.
public class MyId { public static void show(){ String url='https://drive.google.com/...../'; system.debug(getId(url)); } public static String getId(String gdriveUrl){ String Id = gdriveUrl.remove('https://drive.google.com/.....'); return Id; } }
- Khalfe
- July 26, 2020
- Like
- 0
- Continue reading or reply
Lightning record creation Issue
Hi Team,
I have created a Button on a Lightning page.
In that button added standard logic to create a budget Item object record.
Code
this[NavigationMixin.Navigate]({ type: "standard__objectPage", attributes: { objectApiName: "Budget_Item__c", actionName: "new" }, state: { nooverride: '1', defaultFieldValues: fieldValues } });
Its creating records perfectly. But the Issue is after the creation of record, It's navigating to a newly created record's detail page.
I want to stay on the previous page only(where I have added the button), No need to navigate the newly created record's detail page.
Is there any workaround? Urgently needed.
Thanks in advance,
- Biswojeet Ray 11
- July 26, 2020
- Like
- 0
- Continue reading or reply
Calculate Total Revenue for parent Account with VF page
How to calculate total revenue with all child records sum and display in parent account VF page.
Suppose I'm having Parent Account 'Top-level' with 2 child Accounts 'A' & 'B'.
Account -- Revenue Field
A -- 100$
B -- 100$
Top Level --- A+B ie 200$
I have Tried Aggregate result but it is showing a list of accounts with the amount but not the total amount.
In VF I need to show in this format Top Level Account -- 200$
Please help me I'm new to development.
How can I do like all accounts in one List or Map and add them? and assign to variable and display the variable.I'm not getting how to put this in Code.
- SFDCBEE
- July 26, 2020
- Like
- 0
- Continue reading or reply
help me on this in trigger!!!
update picklist from lookup value..
Example:- If i select india in lookup the picklist has to get updated as india.
whatever the value is selected in lookup needs to get updated in picklist.
I have 248 values needs to be updated.
- shyam sundar 112
- July 26, 2020
- Like
- 0
- Continue reading or reply
- himanshu huske 7
- April 20, 2019
- Like
- 0
- Continue reading or reply
visualforce task
- himanshu huske 7
- April 20, 2019
- Like
- 0
- Continue reading or reply
Urgent: How to cover CreatedDate != LastmodifiedDate in test class for Lead Object
Can anyone help with this URGENT?????
- Prem Chauhan
- April 19, 2019
- Like
- 0
- Continue reading or reply
- SFDC ROCK
- April 19, 2019
- Like
- 0
- Continue reading or reply
Trigger count related records (via lookup) on Contact to update Account
I am trying to write a trigger on Account that is essentially a rollup of related records on the Contact level. Not the most confident with apex so just looking for some guidance..
I have created it from the Event Reg object and have a for soql loop to get all Event Reg records, including the Contact and Contacts AccountId, but am stuck at what to do now.
Any help would be much appreciated!
- Charni Wiggins
- April 18, 2019
- Like
- 0
- Continue reading or reply
Compare records with same field value from different Objects
I've tried doing this in Excel via a VLOOKUP, but the dataset is too large and will not work in Excel. I'm new to SOQL, so I'm wondering if this is possible.
I'd need to retrieve a List of all Person Accounts where the email = Lead.Email with the following fields selected: Account ID, Account Name, Account Owner, Person_ID__pc.
- Joseph Barbato 5
- April 17, 2019
- Like
- 0
- Continue reading or reply
standard controller and extension controller referencing issues
I have a wrapper extension class that's intended to bring back grandchild records for a pageblock table within a Visualforce page. However, I keep getting errors when trying to save the Visualforce page referencing the extension controller. I'm not sure if there's a problem with the extension controller or the Visualforce page? Please see code below, any help is greatly appreciated!
VF Page:
<apex:page standardController="Consolidated_Invoicing__c" extensions="WrapperSarah" renderas="pdf">
Extension Controller:
public class WrapperSarah{
private final Consolidated_Invoicing__c consinvs;
public WrapperSarah(ApexPages.StandardController stdController) {
this.consinvs = (Consolidated_Invoicing__c)stdController.getRecord();
}
Can provide the full code if needed but only getting errors after this has been added in following a salesforce guide.
Thanks!
- SazEast
- April 17, 2019
- Like
- 0
- Continue reading or reply
How can I send object id to Email Template from MassEmailMessage during Apex Trigger
I have a trigger which occurs after the insert of a single record to a custom object I created. After the insert, I would like to send an email to a list of user.
I found examples of how to do this but. . .how do you send the id of the record you would like to use when using the template with assigned object fields.
This is my code:
trigger WriteNotifications on CustomTable__c (After insert) {
//This is not the actual select but gives an idea of how I am getting my data
//Declare variable
ID custom_ID;
for (CustomTable__c C_master : Trigger.new) {
custom_id = C_master.Id;
}
//Get the list of user ids
List<User> lstUsed = [select id, name FROM USER where name =: 'Smith'];
List<String> sendTo = new List<String>();
for (User uses : lstUsed ){
sendTo.add(uses.Id);
}
EmailTemplate et = [Select id from EmailTemplate where name = 'My Template' limit 1];
Messaging.MassEmailMessage mail = new Messaging.MassEmail Message();
mail.setTargetObjectIds(sendTo);
mail.setSenderDisplayName('Sending Person');
mail.setTemplateId(et.id);
Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
}
How can pass the custom_ID value to the Email Temple to reference the record from my custom table?
- Southern gal developer
- April 17, 2019
- Like
- 0
- Continue reading or reply