Raghav Chaturvedi
IndividualForum Replies Created
-
Raghav Chaturvedi
MemberApril 26, 2018 at 11:23 am in reply to: How to return and show the list of all Account Names using a Custom Controller in Salesforce?thanks
-
Raghav Chaturvedi
MemberApril 24, 2018 at 6:20 am in reply to: Test is not going inside "trigger.new" while testing Salesforce Triggerthanks
-
Raghav Chaturvedi
MemberApril 24, 2018 at 6:19 am in reply to: How to display names of Contact & Opportunity related to an Account in a Visualforce Page?<apex:page controller="AccountContactOpportunity">
<apex:form >
<apex:pageBlock title="Account Name">
<apex:selectList value="{!AccId}" size="1">
<apex:selectOptions value="{!AccountNames}"/>
<apex:actionSupport event="onchange" action="{!showContact}" reRender="co,co1"/>
</apex:selectList>
<apex:pageBlock title="Opportunity list" id="co" >
<apex:pageBlockTable value="{!opplist}" var="opp">
<apex:column value="{!opp.Name}"/>
<apex:column value="{!opp.StageName}"/>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock title="Contact list" id="co1">
<apex:pageBlockTable value="{!conlist}" var="con">
<apex:column value="{!con.Name}"/>
<apex:column value="{!con.Email}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:pageBlock>
</apex:form>
</apex:page>public class AccountContactOpportunity
{
public String AccId{get;set;}
public list<contact> conlist{get;set;}
public list<Opportunity> opplist{get;set;}public List<SelectOption> getAccountNames()
{
List<SelectOption> accOptions= new List<SelectOption>();
accOptions.add( new SelectOption('','--Select--'));
for( Account acc : [select Id,name from Account where name like 'a%'] )
{
accOptions.add( new SelectOption(acc.Id,acc.name));
}
return accOptions;
}
public pageReference showContact()
{
conlist=[select Name,Email from contact where accountid =:AccId];
system.debug('----->'+conlist);
opplist=[select Name,stageName from opportunity where accountid=:AccId];
system.debug('====>'+opplist);
return null;
}
} -
Raghav Chaturvedi
MemberApril 24, 2018 at 4:14 am in reply to: Test is not going inside "trigger.new" while testing Salesforce TriggerI have studied that using (SeeAlldata=true) is not a best practice
-
Raghav Chaturvedi
MemberApril 23, 2018 at 12:45 pm in reply to: Test is not going inside "trigger.new" while testing Salesforce TriggerI tried with inserting standard pricebook but there is no effect.
can you reply with code
-
Raghav Chaturvedi
MemberJuly 27, 2017 at 4:27 am in reply to: How to prevent user to delete an account with an Opportunity in Salesforce?trigger DeleteAccountOpportunity1 on Account (before delete)
{
List Opp = [Select accountID from opportunity where accountid in :TRIGGER.OLD];
for(Account a : Trigger.OLD)
{
for(Opportunity o : Opp)
{
if(a.id == o.accountId)
{
a.addError('Account have Opportunity ,so you can not delete this Account');
}
}
}
} -
Raghav Chaturvedi
MemberJuly 17, 2017 at 2:57 pm in reply to: What are difference between lookup and fast lookup data elements in flow?Hello Saloni
Lookup record will return only first matching record. If you want to get all matching record, you should use Fast Lookup. In the fast lookup it will show all the record with given prefix
-
Raghav Chaturvedi
MemberJuly 17, 2017 at 2:54 pm in reply to: Salesforce - What is Starting Number in Auto Number DataType?It's given in the data type.first u define the data type (Ex-001 for account A-001).if you understand give the comment
-
Raghav Chaturvedi
MemberJuly 17, 2017 at 12:47 pm in reply to: How to add last name of contact to its related account's name, when any contact field is updated using triggers?you serach this question on my profile
-
Raghav Chaturvedi
MemberJuly 13, 2017 at 2:40 pm in reply to: How to write a Salesforce trigger for below given scenario?trigger concatinat on Contact (after insert,after update)
{
List accList = new List();
set S = new Set();
for(contact con : Trigger.new)
{
S.add(con.accountid);
}
Map mv = new Map([SELECT id,name
FROM account WHERE Id IN : S]);for(contact cont : Trigger.new)
{
Account acct = new Account();
acct.id = mv.get(cont.accountid).id;
acct.name = mv.get(cont.accountid).name + '-' +cont.lastname;
accList.add(acct);}
update accList;
} -
Raghav Chaturvedi
MemberJuly 13, 2017 at 1:10 pm in reply to: How can we count number of contacts associated with accounts?trigger london1 on Contact (after insert,after delete) {
list li=new list();
if(trigger.isInsert)
{
for(contact c:trigger.new)
{
li.add(c.AccountId);
}list con=[select name,(select id from contacts) from account where id in:li];
for(account acc:con)
{
list c=acc.contacts;
system.debug('account:'+acc.name+'Count_of_contact'+c.size());
acc.count_of_contacts__c=c.size();
update acc;
}
}
}this will help you
-
Raghav Chaturvedi
MemberJuly 12, 2017 at 8:31 am in reply to: What is difference between Lightning button () and ui button()If you go thru the Lightning base components release notes, you will notice that the Base components are more of an extended implementation of the existing UI components.
here's an extract of the related section
You can find base Lightning components in the lightning namespace to complement the existing ui namespace components. In instances where there are matching ui and lightning namespace components, we recommend that you use the lightning namespace component. The lightning namespace components are optimized for common use cases. Beyond being equipped with the Lightning Design System styling, they handle accessibility, real-time interaction, and enhanced error messages.
-
Raghav Chaturvedi
MemberJuly 12, 2017 at 8:28 am in reply to: As a beginner ,which are should we focus to get a job (either as an admin or as a developer)?In India all company wants a rajnikant so go for developer part bc companies know if you know the developer part then you also know the the admin part
-
Raghav Chaturvedi
MemberJuly 6, 2017 at 8:27 am in reply to: count number of unique email addresses on child records(contact) in Salesforceno its a issue
-
Raghav Chaturvedi
MemberJune 23, 2017 at 12:28 pm in reply to: Write a Salesforce Trigger for account name should be a combination of lastnames of all its related contactsyes and thanks
-
Raghav Chaturvedi
MemberJune 23, 2017 at 8:48 am in reply to: Write a Salesforce Trigger for account name should be a combination of lastnames of all its related contactsyes in a account(Raghav),if we have 1 contact(lastNamme=kumar) then account name should we updated by(Raghav Kumar) and again we add a contact(lastnam=sharma)then account nae should we raghav kumar sharma and so on.
this is my question
-
Raghav Chaturvedi
MemberJune 23, 2017 at 3:27 am in reply to: Is certification mandatory to get an entry in Salesforce job?No, Certification is not mandatory to got a job in Salesforce. But it is good to have certification.
-
Raghav Chaturvedi
MemberJune 23, 2017 at 2:38 am in reply to: Write a Salesforce Trigger for account name should be a combination of lastnames of all its related contactstrigger contactlastName on Contact (after insert,after update)
{
list lst=new list();
for(contact c:Trigger.new)
{
lst.add(c.accountId);
}
list lac=new list();
list lacc=[select Id,Name,(select Id,lastName from contacts) from account where Id in:lst];
for(account a:lacc)
{
for(contact con: a.contacts)
{
a.Name=a.Name+' '+ con.lastName;
lac.add(a);
}
}
update lac;
}this trigger works only one time,after run this trigger second related contact is not created,plz help
-
Raghav Chaturvedi
MemberJune 23, 2017 at 1:33 am in reply to: Write a Salesforce Trigger for account name should be a combination of lastnames of all its related contactssir in your trigger account name is updated by contact last name but i want the combination of both account name and contact last name
-
Raghav Chaturvedi
MemberJune 16, 2017 at 2:23 pm in reply to: How can i write a Salesforce trigger to count number of completed task in a single contact?I have completed this question till creating a task related with account.and count function is not completed,how can i do this.code is here
trigger copleteTask on Account (after insert)
{
List lst= new List();
for (account acc : trigger.new)
{
Task t = new Task();
t.status = 'complited';
t.WhatId = acc.id;lst.add(t);
}if (lst.size() > 0) {
insert lst;
}
}