-
ChatterFeed
-
41Best Answers
-
0Likes Received
-
12Likes Given
-
0Questions
-
226Replies
Add an 'end date' when selecting a certain 'status'
- Carrlos Boyd
- March 14, 2018
- Like
- 0
- Continue reading or reply
please help to write test class of this trigger
trigger Stuck_on_Auto_Escalate_Status on Case (before insert, before update ) {
for(Trigger_Control__c tc:Trigger_Control__c.getall().values()){ //this is a custom setting (checkbox field)
if(tc.Action_Auto_Escalation__c==true)
{
for(case cs:trigger.new)
{
if(cs.Status=='Action - Automated Escalation')
{
cs.Stuck_on_Action_Automated_Escalation__c=true;
}
}
}
}
}
- devloper sfdc
- March 12, 2018
- Like
- 0
- Continue reading or reply
Multiplication for Roll-Up Summary Field
I have a custom object called "Line Item", that has a master-detail relationship on Opportunity.
On an opportunity, I can have multiple "Line items". Each line item has a value.
I would like to multiply these values, and get the result in a field on opportunity.
Example:
"My opportunity":
- Line item 1: 2
- Line item 2: 10
- Line item 3: 2
Field "my multiplication" on "My opportunity": 2*10*2=40
What I'm trying to achieve is actually a custom field with a field type "Roll up summary", but Salesforce only allows to calcualte Min, Max, Count, Sum...
Any ideas how I can achieve this?
- Bertrand DB
- March 12, 2018
- Like
- 0
- Continue reading or reply
after delete to uncheck the checkbox
I have to uncheck the checkbox on child object when my parent object record gets deleted.
Parent object : raddes have a some records
Child Object : radparent
I have a check box on radparent. now, my requirement is when i deleted a parent record in raddes the checkbox on child object "radparent" should uncheck which mean we need to check the size of the object and update the child update checkbox.
- Radha Rathinavel Pandian
- March 12, 2018
- Like
- 0
- Continue reading or reply
Record Updation
Here parent is the contact and
Child is duplicate_contact. Please check and help
- Anudeep Daliboyina
- March 09, 2018
- Like
- 0
- Continue reading or reply
can someone please help with the test class of this code please
set<id> setid = new set<id>();
list<contact> lstcon = new list<contact>();
for(task t :trigger.new){
setid.add(t.whatid);
setid.add(t.whoid);
}
for(contact cc :[select id,boolean__C,(select subject from tasks) from contact where id=:setid]){
For(task t1 :trigger.new){
if(t1.subject=='Mass Email'){
Contact cc1 = new contact();
cc1.id=cc.id;
cc1.boolean__c='True';
lstcon.add(cc1);
}
update lstcon;
}
}
}
- Rahul
- March 08, 2018
- Like
- 0
- Continue reading or reply
Trailhead: Surface data from IBM Watson: Unexpected token error
I get this error:
Error: Compile Error: Unexpected token 'list'. at line 2 column 15
Please help?
- Charmaine van der Merwe
- March 08, 2018
- Like
- 0
- Continue reading or reply
Apex code to calculate number of months between two dates
How can i calculat number of months between two dates, in apex ?
Thank you for advice
- Marilyne P
- March 08, 2018
- Like
- 0
- Continue reading or reply
Select id,AccountId,Account_Company_Id__c,JobDiva_ID__c from Opportunity where JobDiva_ID__c!=null AND Stage==Open
- Ajitkumar Pradhan 9
- March 08, 2018
- Like
- 0
- Continue reading or reply
I have a field that I need to have populated if another field is populated with picklist value "Yes". How do I write this validation rule.
Field 2: FAN NUMBER (want to me mandatory if Field 1 is "Yes")
- Malisa Gibbons 9
- March 07, 2018
- Like
- 0
- Continue reading or reply
Validation Rules Nested Ifs
I am having a few issues with populating a Formula Field as I need to run nested IFs on it.
Basically what I am looking to do is to determine a rating based on the Business Type and last bill amount
So if the Business has previous consumption
The Rating for Gyms is A-, Rating For Hotels is B-, Rating For Offices is C-
If there is no consumption
Then The Rating for Gyms is A+, Rating For Hotels is B+, Rating For Offices is C+
Im pretty sure its something small but I keep getting "Error: Syntax error. Missing ')'
- Mark McGrane
- March 06, 2018
- Like
- 0
- Continue reading or reply
need help with trigger bulkification
trigger UpdateOpptyProductText on OpportunityLineItem (after insert, after update) { for (OpportunityLineItem oli : Trigger.New) { Opportunity o = [select id from Opportunity where id =: oli.OpportunityId]; o.Opportunity_Products__c = ''; OpportunityLineItem[] lis = [Select id, name, product2id from opportunitylineitem where opportunityid=:o.Id]; integer count = 0; for (OpportunityLineItem li : lis) { if (count > 0) { o.Opportunity_Products__c += '; '; } Product2 p = [select id,name from Product2 where id =: li.Product2Id]; o.Opportunity_Products__c += p.name; count ++; } update o; } }
- Denise Crosby
- March 03, 2018
- Like
- 0
- Continue reading or reply
Fiel doesn't show up for certain perfil
I've created a field in a Case object named Enviar para Laudo, but when I log on not as administrador my field doesnt show up.
I've already changed the Security level and the Field Acessibility but still cant see the field.
Anyone, can help me?
- Leticia Monteiro Freitas
- February 15, 2018
- Like
- 0
- Continue reading or reply
error message:
Error is in expression '{!save}' in component <apex:commandButton> in page formexample: Class.EnrollmentFormClass.save: line 30, column 1
An unexpected error has occurred. Your development organization has been notified.
visualforcepage :
<apex:page controller="EnrollmentFormClass">
<apex:form >
<apex:pageBlock title="Opportunitiy Zone Enrollment Form">
<apex:pageBlockSection columns="3">
<apex:inputField value="{!con.Student_Name__c}"/>
<apex:inputField value="{!con.School__c}"/>
<apex:inputField value="{!con.Date__c}"/>
</apex:pageBlockSection>
<br/>
<br/>
SPARC programs are funded by United Way of Greater Atlanta. As such, we are required to report demographic, income, educational and health access information on every individual/family we serve. With the United Way belief that serving one family member serves them all, we collect general information on each member of your household. We appreciate your willingness to complete this form in its entirety so that we can continue providing free programs to the community. Thank you!
<br/>
<br/>
<apex:pageBlockSection title="Head of Household Information:">
<apex:inputField value="{!con.FirstName}"/>
<apex:inputField value="{!con.LastName}"/>
<apex:inputField value="{!con.Date_of_Birth__c}"/>
<apex:inputField value="{!con.Gender__c}"/>
<apex:inputField value="{!con.Do_you_have_a_primary_medical_provider__c}"/>
<apex:inputField value="{!con.Do_you_have_a_primary_medical_provider__c}"/>
<apex:inputField value="{!con.Address__c}"/>
<apex:inputField value="{!con.City__c}"/>
<apex:inputField value="{!con.State__c}"/>
<apex:inputField value="{!con.County__c}"/>
<apex:inputField value="{!con.Phone__c}"/>
<apex:inputField value="{!con.Email_Address__c}"/>
<apex:inputField value="{!con.Preferred_Method_of_Contact_Circle_One__c}"/>
</apex:pageBlockSection>
<apex:pageBlocksection title="Demographic Data: (All information is confidential and is used in applying for grants to fund this program.)" columns="3">
<apex:inputField value="{!con.Spanish_translation_Services_Needed__c}"/>
<apex:inputField value="{!con.Race_Check_One__c}"/>
<apex:inputField value="{!con.Marital_Status_check_one__c}"/>
<apex:inputField value="{!con.HIGHEST_LEVEL_OF_EDUCATION_Check_one__c}"/>
<apex:inputField value="{!con.Employment_check_one__c}"/>
</apex:pageBlocksection>
<apex:pageBlocksection title="Income:" columns="3">
<apex:inputField value="{!con.Annual_Income__c}"/>
<apex:inputField value="{!con.Source_of_Income__c}"/>
<apex:inputField value="{!con.Primary_Method_of_Transportation__c}"/>
</apex:pageBlocksection>
<apex:pageBlocksection title="HOUSEHOLD Information:" columns="3">
<apex:inputField value="{!conc.Other_Adult_First_Name__c}"/>
<apex:inputField value="{!conc.LastName}"/>
<apex:inputField value="{!conc.Date_of_Birth__c}"/>
<apex:inputField value="{!conc.Gender__c}"/>
<apex:inputField value="{!conc.Relationship_Primary_Care_Provider__c}"/>
<apex:inputField value="{!conc.Medical_Insurance__c }"/>
</apex:pageBlocksection>
<apex:pageBlockButtons location="bottom" >
<apex:commandButton action="{!save}" value="save"/>
</apex:pageBlockButtons>
<apex:pageBlocksection title="Children (all children currently in your household, INCLUDING those participating in this program):" columns="1">
<apex:pageBlockTable value="{!concAddList}" var="c">
<apex:column headerValue="Name">
<apex:commandButton action="{!AddRow}" value="AddRow"/>
</apex:column>
<apex:column headerValue="Name">
<apex:inputfield value="{!c.LastName}"/>
</apex:column>
<apex:column headerValue="Date of Birth">
<apex:inputfield value="{!c.Date_of_Birth__c}"/>
</apex:column>
<apex:column headerValue="Gender">
<apex:inputfield value="{!c.Gender__c}"/>
</apex:column>
<apex:column headerValue="Relationship Primary Care Provider">
<apex:inputfield value="{!c.Relationship_Primary_Care_Provider__c}"/>
</apex:column>
<apex:column headerValue="Medical Insurance}">
<apex:inputfield value="{!c.Medical_Insurance__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlocksection>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex class :
public with sharing class EnrollmentFormClass {
public Contact con {get;set;}
public Contact conc {get;set;}
public Contact conct {get;set;}
public List<Contact> concAddList{get;set;}
public Account acc {get;set;}
public EnrollmentFormClass() {
con = new Contact();
conc = new Contact();
conct = new Contact();
acc = new Account();
concAddList = new List<Contact>();
concAddList.add(con);
}
public void AddRow(){
concAddList.add(new Contact());
concAddList.add(con);
}
public void save(){
insert con;
acc.name = con.lastName;
insert acc;
con.AccountId = acc.Id;
conc.AccountId = acc.Id;
conct.AccountId = acc.Id;
insert conc;
insert conct;
insert concAddList;
update con;
}
}
- nihar
- February 12, 2018
- Like
- 0
- Continue reading or reply
Trailhead: Developer Beginner -Get started with Apex module- challenge failing
Though i have coded the with the same specification as asked in the challenge but then also challenge failing.
Not sure why this is happening. The issue is actually the code or Trailhead is not working fine.
I am a beginner so facing issue in identifying it.
Need help.
Thanks in advance.
- Disha Saini
- February 11, 2018
- Like
- 0
- Continue reading or reply
Create a row in Custom Object whenever a new contact created
Please help me out from creating a new row in custom object whenever a new contact created in contact object.
1.I have a custom date field in contact object
2.I shouldn't have any relationship with new contact->custom object.
3.Whenever i create new contact with some date it should create a row with "contact name" and "date"
4.Whenever i change Date on an existing contact it should create another row with diff date in custom object.
5.I have a lookup field in custom object with Account Object.
Plesae help how to make this work using triggers
Thanks in Advance.
- KD Teja
- February 11, 2018
- Like
- 0
- Continue reading or reply
CSV file towards two dimensional array
I have a blob object which is a CSV file and I need a method to return all lines from that file in the following data structure:
List<List<String>>where each element of that data structure
(List<String>)is a separate line in the file.
Please advise how this can be achieved and implemented?
- sfadm sfadm
- February 11, 2018
- Like
- 0
- Continue reading or reply
Populate a field automatically from a lookup object.
Can anyone help me? It's by some configure in the field or is it just work by triggers?
- Leticia Monteiro Freitas
- February 10, 2018
- Like
- 0
- Continue reading or reply
how do I make a workflow rule that will send email alert when any of 3 date fields are populated?
I tried the following but I am receiving a syntax error that I'm missing a bracket.
IF(ISBLANK(Fieldone__c) ,
IF IF( ISBLANK( Fieldtwo__c ) ,
IF( ISBLANK( Fieldthree__c ) , false, true) ,
true)
- northcountrygal
- October 29, 2019
- Like
- 0
- Continue reading or reply
Trigger to update the Contact Owner depending on Email field value
For example, I have the Email field value is test@gmail.com then it will try to look for User that has test@gmail.com email then it will update the Contact Owner.
This is what I've done so far:
Set<String> conEmail = new set<String>(); List<String> UsrId = new List<String>(); Map<String, Id> UsrMap = new map<String, Id>(); for(Contact con : trigger.new ){ if(con.Email != null){ conEmail.add(con.Email); } } List<User> userEmail = [SELECT Id, Name, Email FROM User WHERE Email In: conEmail]; for(User u : userEmail){ UsrMap.put(u.Email, u.Id); } for(Contact c : trigger.new){ if(UsrMap.containsKey(c.Email)){ c.OwnerId = UsrMap.get(c.Email); } }Any ideas on why Owner is not being updated when I edit any contact record.
Thank you!
- Naofumi Kun
- October 29, 2019
- Like
- 0
- Continue reading or reply
Trigger syntax error
Unexpected Token '<' on Line 2
I believe my syntax defining my List<AggregateResult> is correct.
trigger CaseHandlerCountAlert on SOBJECT (after insert) { List<AggregateResult> AggregateResultList = [SELECT AccountId, Account.Name name, COUNT(Id) co, Milestone1_Project__c.id, Milestone1_Project__c.Implementation_status__c, Milestone1_Project__c.Client_Advisor_Email__c FROM Case WHERE CreatedDate = LAST_N_DAYS:5 GROUP BY AccountId, Account.Name HAVING COUNT(Id) >= 8 WHERE Id IN :Trigger.New]; for(AggregateResult aggr:AggregateResultList){ system.debug(aggr); Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage(); if(Milestone1_Project__c.Implementation_status__c == 'LIVE - TRANSITION'){ // Set Outgoing Email to Implementation Coordinator //message.toAddresses = new String[] { test@test.com }; } else if (Milestone1_Project__c.Implementation_status__c == 'Live'){ // Private method *** getAddresses() *** retrieves email address from Customer_Success_Managers Public Group //message.toAddresses = new String[] { "test@test.com" }; } message.setSubject = 'Subject Test Message'; message.setPlainTextBody = 'Account name: ' + aggr.get('name') + ' has ' + (Integer)aggr.get('co') + ' cases opened in the last 8 days.'; Messaging.SingleEmailMessage[] messages = new List<Messaging.SingleEmailMessage> {message}; Messaging.SendEmailResult[] results = Messaging.sendEmail(messages); System.debug('Account Name: ' + aggr.get('name')); } private List<String> getAddresses(){ List<User> UserList = [SELECT id, name, email FROM User WHERE id IN (SELECT userorgroupid FROM groupmember WHERE group.name = 'Customer Success Managers')]; Set<String> emailString = new Set<String>(); for(User u: UserList){ emailstring.add(u.email); } return (emailString); } }
- Timothy Smith
- October 29, 2019
- Like
- 0
- Continue reading or reply
When quote status is equal to "ready to price" or "proposed" and quote expiration date is today, move quote status to expired. Need an Apex Scheduler class. Please advice
I want to create a scheduler class. When quote status is equal to "ready to price" or "proposed" and quote expiration date is today, move quote status to expired. Please advice
- Veerendar Aella
- May 01, 2019
- Like
- 0
- Continue reading or reply
InboundEmailHandler toAddress list
I'm creating email to custom object records via the InboundEmailHandler. (sorry if my verbage is wrong on that).
What I have working is the email to custom object, as well as the attachments to the record, but having issues creating a new EmailMessage that is associated with the custom object record.
I have all the fields figured out minus the toAddress since it's inserting via a list to string. I'm not sure how to convert that to a list. Any help would be appreciated. Here is the code:
global class CreateTradeSupport implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope env){ Messaging.InboundEmailResult result = new Messaging.InboundEmailResult(); String myPlainText= ''; Contact c; myPlainText = email.plainTextBody; try{ if([SELECT count() from Contact where email =:email.fromAddress] == 0){ c = new Contact(); c.LastName = email.fromName; c.Email = email.fromAddress; insert c; } else{ c = [SELECT Id from Contact Where email =:email.fromAddress LIMIT 1]; } Trade_Support__c ts = new Trade_Support__c(); ts.Description__c = myPlainText; ts.Status__c = 'New'; ts.Subject__c = email.subject; ts.web_email__c = email.fromAddress; ts.contact__c = c.Id; insert ts; EmailMessage mail = new EmailMessage(); mail.Subject = email.subject; mail.FromAddress = email.fromAddress; mail.HtmlBody = email.htmlBody; mail.TextBody = myPlainText; mail.FromName = email.fromName; mail.RelatedToId = ts.Id; //This is where I'm having issues mail.toAddress = email.toAddresses; mail.CcAddress = email.ccAddresses; mail.Status = 'Read'; insert mail; // Save attachments, if any List<Attachment> attachments = new List<Attachment>(); if(email.textAttachments != null) { for (Messaging.Inboundemail.TextAttachment tAttachment : email.textAttachments) { Attachment attachment = new Attachment(); attachment.Name = tAttachment.fileName; attachment.Body = Blob.valueOf(tAttachment.body); attachment.ParentId = ts.Id; attachments.add(attachment); } } if(email.binaryAttachments != null) { for (Messaging.Inboundemail.BinaryAttachment bAttachment : email.binaryAttachments) { Attachment attachment = new Attachment(); attachment.Name = bAttachment.fileName; attachment.Body = bAttachment.body; attachment.ParentId = ts.Id; attachments.add(attachment); } } if(attachments.size() > 0) { insert attachments; } } catch (QueryException e) { System.debug('Query Issue: ' + e); } result.success = true; return result; } }
- Travis Dvorak
- May 01, 2019
- Like
- 0
- Continue reading or reply
Help with a basic trigger to convert Leads to Opportunities
Hi guys given two fields on the lead object:
FieldA__c
FieldB__c
I need to write a trigger to convert from Lead to opportunity every time a user fill out those two fields. Can anyone help me with the trigger?
Thanks in advance!
- Sebastian Jud
- March 22, 2018
- Like
- 1
- Continue reading or reply
Create a formula for a workflow criteria for lookup field
- Karla Pliego 3
- March 21, 2018
- Like
- 0
- Continue reading or reply
populate lookup via map
I have an object child__c with a lookup to parent__c and a field color__c. The field color__c is also available on the parent__c object with unique values.
How can I query the child__c records and populate the lookup with the parent__c record with the same color in color__c in APEX?
- Frank van Meegen 42
- March 20, 2018
- Like
- 0
- Continue reading or reply
In Trigger how to avoid for loop Inside for loop
My current Code is :
trigger AddConToAcc on Contact (before insert) { list<Account> listAcc = new List<Account>([SELECT Id, Name from Account where name = 'XYZ']); for(Contact con : Trigger.New){ for(Account acc : listAcc){ con.AccountId = acc.Id; } } }I tried to use a Map but its not working Code mentioned below :
trigger ContToAcc on Contact (before insert) { Set<Id> setAccId = New Set<Id>(); List<Account> acc = New List<Account>([SELECT ID FROM Account WHERE Name = 'XYZ']); for(Account acc1 : acc){ setAccId.add(acc1.Id); } Map<Id, Account> mapacc = new Map<Id, Account>([Select Id, Name FROM Account WHERE ID IN :setAccId]); for(Contact con : Trigger.New){ con.Account = mapacc.get(con.Account.Id); } }
- TS21
- March 17, 2018
- Like
- 0
- Continue reading or reply
Add an 'end date' when selecting a certain 'status'
- Carrlos Boyd
- March 14, 2018
- Like
- 0
- Continue reading or reply
Salesforce Questions Tags Users Badges Unanswered Ask Question Creating a trigger that insert and delete a value on a field with a junction relationship object
Book has a field Title, Contact has a field "Number of Loan". Loan is a junction object (Many to Many) from Book and Contact.
The idea is that, whenever a there a Loan is inserted, the value in number_of_loan (of the related contact) get incremented and when we delete it get decremented.
To perform that I decided to create a trigger on the Object Loan.
Here it is:
trigger BorrowedBooksTrigger on Loan__c (after insert, after delete) { Contact c = new Contact(); Set<Id> lretIdsToQuery = new Set<Id>{}; if (Trigger.isInsert) { for(Pret__c l: Trigger.new){ lretIdsToQuery.add(p.Id); } List<Contact> relatedContacts = [SELECT Id, Name, Number_of_loan FROM Contact WHERE Id IN :lretIdsToQuery]; for(Contact c : relatedContacts) { system.debug('Number_of_loan added '+ c.Number_of_loan); c.Number_of_loan = c.Number_of_loan+1; update c; } }else if (Trigger.isDelete) { for(Pret__c l: Trigger.old){ lretIdsToQuery.add(p.Id); } List<Contact> relatedContacts = [SELECT Id, Name, Number_of_loan FROM Contact WHERE Id IN :lretIdsToQuery]; for(Contact c : relatedContacts) { system.debug('Number_of_loan deleted '+ c.Number_of_loan); c.Number_of_loan = c.Number_of_loan-1; update c; } } }
But the code doesn't work at all. I've even have nothing display on the debug console.
Please help :(
- Edgar KAMDEM
- March 14, 2018
- Like
- 0
- Continue reading or reply
Invalid type compile error on trigger
I am getting an error Compile Error: Invalid type: Opp_Top_X_Designation__c on the first two lines.
The field Opp_Top_X_Designation__c is a lookup to Opportunity from another object Top_X_Designation. Now either the setup is not correct of the format of the code line is not right. Please provide inputs.
list<Opp_Top_X_Designation__c> oppidlist = new list<Opp_Top_X_Designation__c>();
list<Opp_Top_Designation__c> updatelist = new list<Opp_Top_Designation__c>();
for(Top_Designation__c tx : trigger.new){
if(trigger.isUpdate || trigger.isInsert){
if(tx.Document_Attached__c == true && tx.Typeof__c == 'Contract'){
// mt.put(tx.Opp_Top_X_Designation__c, tx.Id);
// s.add(tx.Opp_Top_X_Designation__c);
- Deb Halder
- March 13, 2018
- Like
- 0
- Continue reading or reply
non working if statement on custom button
I am trying to create a custom button with an if statement to use on a quote detail page. Sample code as follows;
{!IF
(
TEXT(Quote.Status)<>"Akzeptiert",
URLFOR("/apex/SalesFlowCreateOrderContract"),
'/flow/Quote_to_Order_with_Contract?QuoteID="{!Quote.Id}&"retURL=/"{!Quote.Id}'
)}
On the first option, the code tries to redirect to a VF page which works perfectly. But if statement continues on to the second option either I get encoding errors or non-working if statement depending on the syntax I tried to avoid errors. I tried to use URLENCODE but it did not work too.
Is there anyone who may share ideas on this?
thanks
Alper
- Alper Cekic
- March 13, 2018
- Like
- 0
- Continue reading or reply
trigger validation error
System.ListException: List index out of bounds: 1 Stack Trace: Class.CaseUtility.updateExpiredPoaLinks: line 582, column 1 Class.CaseUtilty_test.testUpdateExpiredPoaLinks: line 192, column
code below:
trigger t1 on Case (before insert, before update) { Group q = [SELECT Id FROM Group WHERE Name ='NCT queue' AND Type = 'Queue']; Contact con = new Contact(); for(Case cas : Trigger.New){ if(cas.Court_Process__c == 'NCT'){ cas.OwnerId = q.Id; } } NCT__c nctNew = new NCT__c(Full_Name__c = con.cm1__Full_Name__c ); insert nctNew; }
need help
- Raymond Mortu
- March 13, 2018
- Like
- 0
- Continue reading or reply
Is there an Apex code that can allow me to create a workflow to send out emails to the related contacts of an account when the account status changes to Wrapped?
I tried making a workflow to do this but it won't allow me to pull info from the acount related section.
I'm told there is possibly an Apex code that could make this happen. Does anyone have any suggestions?
Thanks!
- Kathlene Capobianco
- March 13, 2018
- Like
- 0
- Continue reading or reply
please help to write test class of this trigger
trigger Stuck_on_Auto_Escalate_Status on Case (before insert, before update ) {
for(Trigger_Control__c tc:Trigger_Control__c.getall().values()){ //this is a custom setting (checkbox field)
if(tc.Action_Auto_Escalation__c==true)
{
for(case cs:trigger.new)
{
if(cs.Status=='Action - Automated Escalation')
{
cs.Stuck_on_Action_Automated_Escalation__c=true;
}
}
}
}
}
- devloper sfdc
- March 12, 2018
- Like
- 0
- Continue reading or reply
Multiplication for Roll-Up Summary Field
I have a custom object called "Line Item", that has a master-detail relationship on Opportunity.
On an opportunity, I can have multiple "Line items". Each line item has a value.
I would like to multiply these values, and get the result in a field on opportunity.
Example:
"My opportunity":
- Line item 1: 2
- Line item 2: 10
- Line item 3: 2
Field "my multiplication" on "My opportunity": 2*10*2=40
What I'm trying to achieve is actually a custom field with a field type "Roll up summary", but Salesforce only allows to calcualte Min, Max, Count, Sum...
Any ideas how I can achieve this?
- Bertrand DB
- March 12, 2018
- Like
- 0
- Continue reading or reply
after delete to uncheck the checkbox
I have to uncheck the checkbox on child object when my parent object record gets deleted.
Parent object : raddes have a some records
Child Object : radparent
I have a check box on radparent. now, my requirement is when i deleted a parent record in raddes the checkbox on child object "radparent" should uncheck which mean we need to check the size of the object and update the child update checkbox.
- Radha Rathinavel Pandian
- March 12, 2018
- Like
- 0
- Continue reading or reply
Multiple apex:actionSupport event="onchange"
VF Code:
<apex:page controller="TextApex" >
<apex:form >
<apex:pageBlock >
<apex:selectRadio id="slctRd" dir="ltr" required="true" layout="pageDirection" value="{!selectedValue}" immediate="true">
<apex:actionSupport event="onchange" action="{!MethodOne}" reRender="test"/>
<apex:selectOptions id="selRdOptn" value="{!Options}"/>
</apex:selectRadio>
<apex:selectRadio id="slctRd1" dir="ltr" required="true" layout="pageDirection" value="{!selectedValue1}" immediate="true">
<apex:actionSupport event="onchange" action="{!MethodTwo}" reRender="test1"/>
<apex:selectOptions id="selRdOptn1" value="{!Options1}"/>
</apex:selectRadio>
<apex:outputText id="test" value="{!test}"></apex:outputText><br/>
<apex:outputText id="test1" value="{!test1}"></apex:outputText>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex:
public class TextApex {
public String selectedValue {get; set;}
public List<SelectOption> Options {get; set;}
public String test {get;set;}
public String selectedValue1 {get; set;}
public List<SelectOption> Options1 {get; set;}
public String test1 {get;set;}
public TextApex() {
Options = new List<SelectOption>();
Options.add(new SelectOption('test1', 'test1'));
Options.add(new SelectOption('test2', 'test2'));
Options1 = new List<SelectOption>();
Options1.add(new SelectOption('test3', 'test3'));
Options1.add(new SelectOption('test4', 'test4'));
}
public void MethodOne() { test = 'Hello World' + selectedValue ; }
public void MethodTwo() { test1 = 'Hello World' + selectedValue1 ; }
}
- Robin Barnwell
- March 16, 2018
- Like
- 1
- Continue reading or reply
click Page Layout Assignment (Customize Record Details with Page Layouts)
https://trailhead.salesforce.com/modules/lex_customization/units/lex_customization_page_layouts
" To change page layout assignments, click Page Layout Assignment and then click Edit Assignment. "
Where do I find the Page Layout Assignment ?
Thanks in advance.
- Justin D
- December 16, 2017
- Like
- 1
- Continue reading or reply
asynchronous triggers
Can someone give me detailed references/articles of how triggers work in asynchronous apex.
- Arif 5
- December 10, 2017
- Like
- 1
- Continue reading or reply
Is it possible to provide login credential to user through salesforce app
I am creating an app (through point and click), in which user gets register. Is it possible to give login credential to user through this app so s/he can acces the app or I need to create user only from Standard Admin> User Management to provide login to my salesforce app. Please help.
- SDFC FirstLeveler
- May 29, 2017
- Like
- 1
- Continue reading or reply
- bhanu_prakash
- May 29, 2017
- Like
- 1
- Continue reading or reply
How to Auto Refresh a Standard Visual force page when an Workflow field update will happen
i have a standard opportunity page. also i have a field update on this. so i have to auto refresh my opportunity page when a field update happen. now i need to manully refresh the page. how can i achieve this. i have written a inline visual force page with a 'Reload' button embadded with the satndard page. but i need to manually click this button. i need the auto refresh the page.
Thanks,
- Vasu.P
- May 15, 2017
- Like
- 1
- Continue reading or reply
Business hours : Error: Start time must be earlier than end time
I want to discuss a business hours senario with you. We are using business hours for calculate Plan date of custom Activities. Our shift timing are 06:30 AM(Monday) to 03:30 AM(Tuesday),06:30 AM(Tuesday) to 03:30 AM(Wednesday) and so on. When I am going to set these hours to business hours, it is throwing the error "Error: Start time must be earlier than end time".
Please help me to fix this issue.
Thanks,
Parteek
- Parteek Goyal 3
- May 15, 2017
- Like
- 2
- Continue reading or reply
call apex method on keypress event
I having a custom object C1 with fields like name,email and mobile number.On an visualforce page I will enter the values and save the data.This part is fine with me.
Now my requirement is when I enter email in <apex:inputfield> say on keypress event I should be able to call an server side method in apex controller.
This method will check if the email already exists in object. If it exists then some action needs to be taken.
Please anybody any help will be greatly appreciated
thanks
vandana
- vandana raju
- May 15, 2017
- Like
- 1
- Continue reading or reply
Using Approval process in Trigger
I have a requirement where I need to add validation rule(saying that a field is blank), but that validation should fire if in approval process the stage gets to in review/ or the approver is the Queue of the assigned approver.
I tried using validation rule, but it seems it is not achievable via validation rule.
It seems I need to write a trigger and use StepsAndWorkitems to get the actorId.
Can someone please guide me on how to achive this requirement?
- Sarthak Bajaj 14
- May 13, 2017
- Like
- 1
- Continue reading or reply
create scheduled job for npsp data import
Is it possible to create a scheduled job for npsp data imports. I am able to create data import objects using APEX, but I am not able to process it automatically.
Thanks.
- ahmed kishk 9
- May 13, 2017
- Like
- 1
- Continue reading or reply
Does anyone knows how to get the view that is represented in the Knowledge Demo?
https://youtu.be/d3jD25SNp6g?t=70
- Helmut Granda
- May 13, 2017
- Like
- 1
- Continue reading or reply
How to rate a Document/ContentVersion from a visualforce page or controller?
Thanks in advance,
Marijus
- Marijus Gorinas 13
- May 12, 2017
- Like
- 1
- Continue reading or reply