-
ChatterFeed
-
28Best Answers
-
0Likes Received
-
0Likes Given
-
19Questions
-
273Replies
Can't Create a VisualForce Page
Hi All,
I'm having a bit of trouble with my vf page and wondering if anyone has experienced the same. My page worked yesterday just find and today when I wanted to make a slight modification to it in my production database I can't even do it.
Normally I would just open it up and make my change but now when I try it just says "Processing...." at the top. I don't even have the save button anymore.
Is anyone else having the same issue? I have Enterprise Edition.
Any feedback would be great.
Chris
- CBradley1985
- June 13, 2013
- Like
- 0
- Continue reading or reply
dispaly list of contacts with out Custom controller or extentions
Hi
Please help me out
1) How to dispaly list of contacts of account on Visual force page with out Custom controller or extentions?
2)How to display accounts contacts and contact details(lookup to contact) on one visual force page?
3) On one object 3 triggers are there, i need to execute triggers one after the other. Is it possible, if yes how, no why?
- narensfdc
- March 21, 2013
- Like
- 0
- Continue reading or reply
sending email to sales rep
Hi,
I've requirement that automatically send an email alert to salesrep which contains all the leads assigned to him. How can we achieve this. can anyone help me out from this.
- ram_dev
- March 20, 2013
- Like
- 0
- Continue reading or reply
help on custom objects using trigger....
- SFDC_2706
- February 20, 2013
- Like
- 0
- Continue reading or reply
Small Clarifications
1. Id =: decAccount.id
Question: What '=:' represents?? what does it mean???
2. decAccount = [Select Id, Distributor__c FROM Account WHERE Id =:decAccount.id];
Question : what will insert in to the decAccount ??
I understood llike we are selecting the id, custom object from account then..????
- suneel.patchipulusu@gmail.com
- January 23, 2013
- Like
- 0
- Continue reading or reply
Wrapper Class Example List Seleciton
I am completeley new to apex and coding in general so I was hoping I could get some help with a question. I'm attempting to teach myself as much as I can by manipulating examples Wrapper Example so here we go. I'm looking to do what I believe should be fairly simple: Take a list of accounts, from a wrapper class, that are selectable and then simply relist those selected in another column.
public class WrapperclassController { //Our collection of the class/wrapper objects cContact public List<aAccount> AccountList {get; set;} //This method uses a simple SOQL query to return a List of Contacts public List<aAccount> getAccounts() { if(AccountList == null) { AccountList = new List<aAccount>(); for(Account a: [select Id, Name, Phone from Account Order by Name]) { // As each contact is processed we create a new cContact object and add it to the contactList AccountList.add(new aAccount(a)); } } return AccountList; } public PageReference processSelected() { //We create a new list of Contacts that we be populated only with Contacts if they are selected List<Account> selectedAccounts = new List<Account>(); //We will cycle through our list of cContacts and will check to see if the selected property is set to true, if it is we add the Contact to the selectedContacts list for(aAccount aAcc: getAccounts()) { if(aAcc.selected == true) { selectedAccounts.add(aAcc.acc); } } // Now we have our list of selected contacts and can perform any type of logic we want, sending emails, updating a field on the Contact, etc System.debug('These are the selected Contacts...'); for(Account acc: selectedAccounts) { system.debug(acc); } return null; } // This is our wrapper/container class. A container class is a class, a data structure, or an abstract data type whose instances are collections of other objects. In this example a wrapper class contains both the standard salesforce object Contact and a Boolean value public class aAccount { public Account acc {get; set;} public Boolean selected {get; set;} //This is the contructor method. When we create a new cContact object we pass a Contact that is set to the con property. We also set the selected value to false public aAccount(Account a) { acc = a; selected = false; } } }
<apex:page controller="WrapperclassController">
<apex:sectionHeader title="Interview Three"/>
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Show Selected Accounts" action="{!processSelected}" rerender="table"/>
</apex:pageBlockButtons>
<!-- In our table we are displaying the cContact records -->
<apex:pageBlockSection title="All Accounts">
<apex:pageBlockTable value="{!Accounts}" var="a" id="table">
<apex:column >
<!-- This is our selected Boolean property in our wrapper class -->
<apex:inputCheckbox value="{!a.selected}"/>
</apex:column>
<!-- This is how we access the contact values within our cContact container/wrapper -->
<apex:column value="{!a.acc.Name}" />
<apex:column value="{!a.acc.Phone}" />
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:pageBlockSection title="Selected Accounts">
</apex:pageblocksection>
</apex:pageBlock>
</apex:form>
</apex:page>
So what I believe still needs to be done is possibly an action statement that takes the selected accounts withing the wrapper list and relists them in a new column on the visual force page but I am having trouble putting it together without errors. I'd like the seleced accounts to be beside not below all accounts as well.
Any help would be appreciated as I am literally just getting into apex and coding as of about 3 weeks ago.
- bdbagley
- January 23, 2013
- Like
- 0
- Continue reading or reply
LOOKUP + OUTPUTLINK !!!
- Achilles21
- December 26, 2012
- Like
- 0
- Continue reading or reply
Image to next page with id passing
I want to display images from a static resource on visual force page. By clicking on the image the page need to redirect to another page with id passing on url and image should representing the record of leads
how to do this with coding
- raki
- December 05, 2012
- Like
- 0
- Continue reading or reply
Multiple Formula field calculation
I have a question regarding the formula field:
Can I calculate (for example) the total of more field of different custom objects? and how can I do that?
thanks in advance.
- Dan_try_zero
- November 19, 2012
- Like
- 0
- Continue reading or reply
How to write code coverage for if statements in test method
Please guide me for getting full code coverage for the following class by using best practices,
public class sendemail_torelated_contacts
{
list<string>emailids;
public PageReference sendemail()
{
emailids=new list<string>();
for(contact c:conlst)
{
if(c.email!=null)
{
emailids.add(c.email);
}
}
system.debug('-----------------------------------------------'+emailids.size());
if(emailids.size()>0)
{
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(emailids);
mail.setSubject('Test Mail');
mail.setUseSignature(false);
mail.setHtmlBody('This is a test mail');
// Send the email
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO, 'Mail sent successfully');
apexpages.addmessage(myMsg);
}else
{
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.warning, 'NO Destination found');
apexpages.addmessage(myMsg);
}
return null;
}
public PageReference find_contacts()
{
//system.debug('=================================='+accid);
conlst=new contact[]{};
if(accid!='')
{
conlst=[select id,accountid,name,email,phone from contact where accountid=:accid];
}
if(conlst.size()>0)
{
showbtn=true;
}else
{
showbtn=false;
}
return null;
}
public String accid { get; set; }
public boolean showbtn{get;set;}
account[]acclst;
public contact[]conlst{get;set;}
public account[] getaccounts()
{
acclst=new account[]{};
acclst=[select id,name,phone from account where name in('appshark','ibm','infosys')];
return acclst;
}
//Test method for code coverage-----------------------
Private static testmethod void test()
{
account a=new account(name='test',phone='09030182818');
insert a;
contact con=new contact(lastname='testcon',email='vasu.takasi@test.com',accountid=a.id);
insert con;
sendemail_torelated_contacts obj=new sendemail_torelated_contacts();
obj.showbtn=true;
obj.conlst=new contact[]{};
obj.conlst.add(con);
obj.getaccounts();
obj.find_contacts();
obj.sendemail();
}
}
- vasu takasi
- October 29, 2012
- Like
- 0
- Continue reading or reply
How to check for an existing relationship between two Contact records
In our org we have some piece of apex code which allows users to create a related contact to an existing contact. It can be done by clicking a button on the custom related list situated at the bottom of the contact record.
The problem I am facing is, users are able to create multiple relationships with same contact. And also a contact can be linked to itself as well. I solved the second part saying if the Ids of two records are same, dont create the relation.
But the tricky one is the first part. There is a junction object called Contact_connector in between them. which is inserted everytime the relation is created. If there is a way to put in both the existing record Id and duplicated record and tranverse through the Contact_connectorID and check if thats existing then I can say dont create.
But am not finding a way to check whether the Contact_connectorId exists between them.
Would be a great help if any one can come up with a solution..
- Venkat Nithin
- October 26, 2012
- Like
- 0
- Continue reading or reply
roll-up on formula field
Hi,
I have detail object with formula field RokNow (Number) =YEAR( TODAY() )
I want to use RokNow field on roll-up sum but RokNow field does not appear on the list of field to aggergate on master object.
did anybody faced similar problem ?
- jacek2jacek
- October 26, 2012
- Like
- 0
- Continue reading or reply
Need Help ..
Hi All,
My Requirement is
Account Is Record Type="Master Account Layout' and parent account is Null then HQ field set to True
I have Created a trigger for achieving above reqt
1 2 3 4 5 6 7 8 9 10 11 | trigger accountTypeChange on Account (before Insert) {
But as I want to insert the record on Account Object I am getting the error msg
"Error: Invalid Data.
Plz Help me in rectifying the Issue.. |
- Ajay0105
- October 11, 2012
- Like
- 0
- Continue reading or reply
material for salesforce developer certification
Hi,Iam planning to prepare for salesforce developer certification.
can any one help me and send the complete materials.
could anyone give me suggestions and guidance for how to prepare for this exam.
- saimadhu
- October 08, 2012
- Like
- 0
- Continue reading or reply
finding domain name from website
On the Account object I have created a formula field called Domain_Name__c . The formula I have used is this,
SUBSTITUTE(Website, LEFT(Website, FIND("www.", Website)), NULL)
Where website is a standard field on Account.
If Website is www.xyzdomain.com or https://www.xyzdomain.com
In Domain_Name__c I expected result as xyzdomain.com
Instead i am getting the result either as
.xyzdomain.com or ww.xyzdomain.com depending on whether the Email entered was 'www.xyzdomain.com' or 'https://www.xyzdomain.com'
Any thoughts how I can only get the text after the .
e.g If, in the field Website I enter www.salesforce.com or https://www.salesforce.com the result in the Domain_Name__c should be salesforce.com
- Sabrent
- October 07, 2012
- Like
- 0
- Continue reading or reply
how to store data in cookies
how to store value in cookies and how to use in another apex class
- sreenu92t
- September 13, 2012
- Like
- 0
- Continue reading or reply
trigger on opportunity(updating a field in account)
Hi Every one,
In my account object "Total Amount" field is there,
and in opportunity "amount" field is there,
I want to dispaly sum of amount of all child opportunities in the total amount field in the parent account.
So please help me, how to write trigger for that.
- Kiran Kumar Gottula
- September 12, 2012
- Like
- 0
- Continue reading or reply
Can we replace Salesforce home page with our custom Visualforce page?
Hi,
Can we replace the standard salesforce home page with our own custom Visualforce page? can anybody answer for me please..
Regards,
Sujan
- Sujan Kumar Reddy
- September 10, 2012
- Like
- 0
- Continue reading or reply
calendar look up
In my vf page i have a date filed
date: input text
i have to place calendar lookup for this date field
how to do this.
please give me sample code.
- saimadhu
- September 06, 2012
- Like
- 0
- Continue reading or reply
SOQL Document
Hi,
I am studying Salesforce SOQL, when in open the SOQL document from http://wiki.developerforce.com/page/Documentation, In Getting Started - it opens document which shows first page as Introduction to SOAP API.
I want to confirm that Am i refrerring right document? If yes then can any one brief what is the main topics that wanted to cover in SOQL study?
Thanks.
- yoginimane89
- September 03, 2012
- Like
- 0
- Continue reading or reply
Unlock the Record using trigger
I need small favor from you, help me on below issue please.
Requirement à In Approval Process quote(Object) records gets Locked Automatically, when the user approves . We want to unlock the record using Trigger.
Salesforce newly implemented method called unlock(recordsToUnlock), but it’s not working as expected.
Ref: https://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_apex_approval_locks_unlocks.htm
- I am updating the status field in Quote when user approves, from approval Process.
- In debug logs it’s coming into the trigger, I guess record is locking after the trigger fires.
- May be the problem with Order of execution.
Could you please help me, Is there any way to resolve this issue.
Thanks
Prem
- Premanath
- May 19, 2016
- Like
- 0
- Continue reading or reply
Date text field using Pattern
Date text field should Accept only dd/mm/yyyy
String RE_date= '(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/((19|20)\\d\\d)';
Pattern MyPattern = Pattern.compile(RE_date);
Matcher MyMatcher = MyPattern.matcher(myDate);
The above code is working
if we enter 5/6/1988 also it is Accepting... so i need it should accept only dd/mm/yyyy (05/06/1988)... other wise it should give error..
how can i achive this.
- Premanath
- February 26, 2014
- Like
- 0
- Continue reading or reply
Creation of PDF file
Hi Guys,
I want to create a pdf of my vf page ,
we can create like this way
pdfPage = page.product_delivery;//new PageReference('/apex/product_delivery1');
pdfPage.getParameters().put('id',oppid);
pdfPage.setRedirect(false);
Blob b=pdfPage.getContentAsPDF();
In my vf i am displaying some records with checkbox. When i click on Selected Button , It is displaying Selected Records.
I want to Create PDF for Selected Records only.
But it is Generating PDF for my intial VF page..
please suggest me..
prem
- Premanath
- November 22, 2013
- Like
- 0
- Continue reading or reply
Is This Possible?
Hi Guys,
I have Requirement, In opportunity object we have field Stage,
Where Stage='Prospecting' those records only visible to the perticuler profile(Custom Profile) Users.
other records(Stage not equel to Prospecting) should not visible to that Profile Users .
Please let me know Guys.
Thanks
- Premanath
- June 11, 2013
- Like
- 0
- Continue reading or reply
How to get Edit mode on VF page
Hi guys,
I have a problem to get Edit mode in VF page.
Here by using apex:Detail we will get inline Edit mode of the Total page.Like this
<apex:page standardController="Event">
<apex:form >
<apex:pageBlock >
<apex:detail inlineEdit="True" relatedList="true"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Now i want Edit mode with out using apex:inputfield , Is there any way to do it.
Please let me know.
Thaks
Prem
- Premanath
- November 20, 2012
- Like
- 0
- Continue reading or reply
How to Divide a vF page into 6 differene page
Hi guys
Plz help in this requirement
How to divide a vf page into diffrent frames
- Premanath
- August 24, 2012
- Like
- 0
- Continue reading or reply
strucked in javascript popup window with fade effect
Hi,
I want to create a javascript button. Like setup-->contact-->Buttons and links --->Execute javascript ----- Right...
Next when we click on a button in contact record one popup window should be came.
But the popup outside window should be Fade Effect (Dark color)..
Please help me guys
- Premanath
- August 09, 2012
- Like
- 0
- Continue reading or reply
strucked in javascript popup window with fade effect
I want to create a javascript button. Like setup-->contact-->Buttons and links --->Execute javascript ----- Right...
Next when we click on a button in contact record one popup window should be came.
But the popup outside window should be Fade Effect (Dark color)..
Please help me guys
- Premanath
- August 09, 2012
- Like
- 0
- Continue reading or reply
strucked in javascript popup window with fade effect
I want to create a javascript button. Like setup-->contact-->Buttons and links --->Execute javascript ----- Right...
Next when we click on a button in contact record one popup window should be came.
But the popup outside window should be Fade Effect (Dark color)..
Please help me guys
- Premanath
- August 09, 2012
- Like
- 0
- Continue reading or reply
How to write code for save & close operation done in one button click
Hi ,
I have one javascript button , Go with the any record and when we click on button one popup window came
i.e VF page window..
Add one field and click on save button on that widow it should be save and close...
Javascript button code is this,
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
var url="/apex/commentspage?&id= {!Contact.Id}";
newWin=window.open(url, 'Popup','height=500,width=600,left=150,top=150,resizable=yes,scrollbars=no,toolbar=no,status=no');
if (newWin.focus())
{
newWin.focus();
}
After creation of button.
Go with contact record, there is one button available right,
Then click on that button one VF page popup window came.
The VF page is..
<apex:page controller="commentspage" showHeader="false" sidebar="false" showChat="false" standardStylesheets="false" >
<script type="text/javascript">
function closeWin(){
self.close();
}
</script>
<apex:form > <br/><br/>
<div align="center">
<apex:inputTextarea value="{!CommentText}"/><br/><br/>
<apex:commandButton oncomplete="closeWin" action="{!save}" value="Save" id="theButton"/>
</div>
</apex:form>
</apex:page>
The Action performed on controller...
Please solve my problm...
- Premanath
- August 01, 2012
- Like
- 0
- Continue reading or reply
How To write code for save & Cancel operation done in one button
Hi guys,
When we click on button it should save some functionality and then close that window.
How to write code for this functionality.
At least tell me cancel functionality using controller.
Thanks a lot,
- Premanath
- July 31, 2012
- Like
- 0
- Continue reading or reply
close popup window when we click on outside popup window(urgent please)
Hi All,
Create one javascript button on contact , when we click on that button the popupwindow should be come.
And when we click on outside window popup window should be close.
I got some problm with my code , it doesn't work properly , plz cheak it...
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
var url="/apex/commentspage?&id=" +" {!Contact.Id}";
newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=yes,scrollbars=no,toolbar=no,status=no');
if (newWin.focus())
{
self.focus();
}
window.onblur=function()
{
newWin.close();
};
please solve my problm i can appriciate very much........
Thank you
- Premanath
- July 26, 2012
- Like
- 0
- Continue reading or reply
Problm with javascript
Hi All,
Please Help me in my issue.from last two days it's not came.
I wnat to open a new window when we click on a button.So popwindow came now.
But whenever we click on outside the popup window it should be close.
It can work on VF page. But i want to create javascript Button for this same issue .
My VF page code is:
<apex:page >
<script type="text/javascript">
function openLookup(){
var url="/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
if (window.focus)
{
newWin.focus();
}
return false;
}
<!-- openPopup("apex/dfsdfs","350, 480,height=480,toolbar=no,status=no,directories=no,menubar=no,resizable=yes,scrollable=no",true); -->
}
</script>
<apex:form >
<apex:commandButton onclick="openLookup();return false;" value="Show Popup"/>
</apex:form>
</apex:page>
---
The same thing should be done on Javascript button also.
Please help me guys,
- Premanath
- July 26, 2012
- Like
- 0
- Continue reading or reply
How to write same code for update operation
Hi all,
I have a requirement , Add all opportunity Amount fields , display total amount in Account object.
i have code it's working for inserting a record in opportunity.
But update and delete operation does not work.
i know through Roll-up summary we can but i want it from trigger only please help me ...........
trigger AmountTask on Opportunity (after insert,after update){
if(Trigger.isinsert){
Map<id,decimal> acctotal = new Map<id,decimal>();
for(opportunity opp :trigger.new){
if(opp.amount!=null){
if(acctotal.get(opp.accountid)==null){
acctotal.put(opp.accountid,opp.amount);
System.Debug('++++++opp.accountid--------Null--->'+acctotal.get(opp.accountid));
}
else
{
decimal amt = 0;
amt = acctotal.get(opp.accountid)+opp.amount;
acctotal.put(opp.accountid,amt);
System.debug('++++++++++opp.accountid--------NotNull--Total Amount---->'+acctotal.get(opp.accountid));
}
}
}
list<account> alist= new list<account>();
list<account> accList = [select total_amount__c from account where id in:acctotal.keyset()];
for(account a:acclist){
a.total_amount__c+=acctotal.get(a.id);
alist.add(a);
System.debug('++++++++++opp.accountid--------finally---->'+a.total_amount__c);
}
update alist;
}
}
plz help me thank you guys,
- Premanath
- July 23, 2012
- Like
- 0
- Continue reading or reply
How to write apex class for formated phone number
Hi All,
I have some issue like-- > I have two fields
phone number-- +91-(08)/9855664555
country code ---> 110
third field is should be automatically comes when we fill above two fields like this :
formatedph: 11091089855664555
Means write a wrapper class it call from any where(trigger) . and print without special char.
Thank you guys,
- Premanath
- July 17, 2012
- Like
- 0
- Continue reading or reply
How to Avoid DML and SOQL operations in for loop
Hi All,
I have problm with Governor limits.
In for loop we cannot use DML and SOQL quiries .. But i have used in my issue.
That issue is Account related opportunity records amount should be add and give the total amount ..
Please give me code instead of this ...
trigger AmountTask on Opportunity (after insert)
{
for(Opportunity varopp:Trigger.new){
Decimal Amount=0;
List<Opportunity> oppbj=[select id,name,Amount from Opportunity where AccountId=:varopp.AccountId];
for(integer i=0;i<oppbj.size();i++){
Amount=Amount+oppbj[i].Amount;
}
//system.debug('----->'+oppbj.size());
Account varacc=[select id,name,Total_Amount__c from Account where id=:varopp.AccountID];
varacc.Total_Amount__c=Amount;
update varacc;
}
}
Thank you guys....................
- Premanath
- July 05, 2012
- Like
- 0
- Continue reading or reply
How to use Five9 On-Demand Call Center Software for Salesforce
Hi Everybody,
In my new project i am using Five9 On-Demand Call Center Software for Salesforce
I don't think soo how to use.
I want to know about basic things.
How to use this one.... It's already installed in my org...
Thank you,
- Premanath
- July 04, 2012
- Like
- 0
- Continue reading or reply
visible the fields on picklist selection
Hi guys,
please help me...
I have a pick list field Qualification in Application Object ,
Qualification (picklist)
BE/B-Tech
M_Tech
Degree
INTER
ssc
if i select -BE/B-Tech
Related fields should be visible. i.e
enter college:
enter semister marks:
If i select -- SSC
Enter school:
enter section
grade:
So like this fields should be visible on selection.
How can i achive with Visual force tabs/Any custom functionality. please help me....
Thank you,
- Premanath
- June 27, 2012
- Like
- 0
- Continue reading or reply
How can i reach the 501 certification
Hi guys,
I have done 401 certification.
I am planning to do 501.
How can i prepare ...and i have to follow which sites.
Please give me guidence.
Thank you,
Prem
- Premanath
- June 27, 2012
- Like
- 0
- Continue reading or reply
Unlock the Record using trigger
I need small favor from you, help me on below issue please.
Requirement à In Approval Process quote(Object) records gets Locked Automatically, when the user approves . We want to unlock the record using Trigger.
Salesforce newly implemented method called unlock(recordsToUnlock), but it’s not working as expected.
Ref: https://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_apex_approval_locks_unlocks.htm
- I am updating the status field in Quote when user approves, from approval Process.
- In debug logs it’s coming into the trigger, I guess record is locking after the trigger fires.
- May be the problem with Order of execution.
Could you please help me, Is there any way to resolve this issue.
Thanks
Prem
- Premanath
- May 19, 2016
- Like
- 0
- Continue reading or reply
Date text field using Pattern
Date text field should Accept only dd/mm/yyyy
String RE_date= '(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/((19|20)\\d\\d)';
Pattern MyPattern = Pattern.compile(RE_date);
Matcher MyMatcher = MyPattern.matcher(myDate);
The above code is working
if we enter 5/6/1988 also it is Accepting... so i need it should accept only dd/mm/yyyy (05/06/1988)... other wise it should give error..
how can i achive this.
- Premanath
- February 26, 2014
- Like
- 0
- Continue reading or reply
after update trigger creates duplicate value to related list if related list is empty
I am trying to create a trigger that would add a new value to a related list if a value is adeded to a field.
The field is called Reason of Contact (ROC) and when ever a new reason of contact is added or the field is populated it brings the new value to the related list in the Case. This is working correctly but when ever the first reason of contact is added to the case this value is entered twice. But after that everything works fine. So can someone see what is wrong with the code so that it would not create a duplicate value if the list for Reason Of Contacts (ROCs) is empty.
// trigger createROCchildonCaseUpdate on Case (after update) { // Create an empty list of String List<Reasons_of_Contact__c> ROCs = new List<Reasons_of_Contact__c>(); //For each case processed by the trigger, add a new //ROC record for the specified case. //Note that Trigger.New is a list of all the new positions //that are being created. for (Case newCase : Trigger.new) { Case oldCase = Trigger.oldMap.get(newCase.Id); if (oldCase.Request_3__c != newCase.Request_3__c | oldCase.Request_3__c != NULL) { //Create the new ROC in the related list with the following values ROCs.add(new Reasons_of_Contact__c( ProgramCaseLink__c = newCase.Id, Type__c = newCase.Request_3__c, ProgramCommentLookup__c = newCase.Program__c)); } } insert ROCs; }
- ReneRend
- November 29, 2013
- Like
- 0
- Continue reading or reply
conditional rendering of apex:repeat element
I have an output panel inside my apex:repeat tag.
My requirement is to conditionally display it.
So for one element in apex:repeat this panel might be rendered ..for some not. Rendering condition is,i need to check whether line item occurs in another controller set variable.
I find it difficult because of following reasons;
1)I understand you cannot check whether a set variable contains this element on visualforce page .or is this possible
2) i can see you cannot pass arguments in your rendered attribute.else i could have specify a boolean value for rendered attribute and set the value based on lineitem passed from front end
3)as the set variable is totally unrelated to line item.i cannot simply specify as below
<apex:repeat value="{!Proposals}" var="item">
<apex:outputPanel rendered="{!item.LineCount > 0}">
<li>
<a href="{!$Page.aa_rg_jm_proposal}?id={!item.Proposal.ID}">{!item.Proposal.Name}</a>
<span class="ui-li-count">{!item.LineCount}</span>
</li>
</apex:outputPanel>
</apex:repeat>
- Newbie10
- November 28, 2013
- Like
- 0
- Continue reading or reply
unable 2 see the fields
<apex:page standardController="Account">
<apex:pageBlock title="Hello{!$User.FirstName} {!$User.LastName}">
</apex:pageBlock>
<apex:PageBlock title="Contacts">
<apex:pageBlockTable value="{!account.Contacts}" var="con">
<apex:column value="{!con.name}"/>
<apex:column value="{!con.LastName}"/>
<apex:column value="{!con.Phone}"/>
<apex:column value="{!con.Title}"/>
</apex:pageBlockTable>
</apex:PageBlock>
</apex:page>
want 2 create a table but i am unable 2 see the fields name,LastName,phone,Title and their data pls help me what is the error
- sfdcdevelopers
- November 28, 2013
- Like
- 0
- Continue reading or reply
Creation of PDF file
Hi Guys,
I want to create a pdf of my vf page ,
we can create like this way
pdfPage = page.product_delivery;//new PageReference('/apex/product_delivery1');
pdfPage.getParameters().put('id',oppid);
pdfPage.setRedirect(false);
Blob b=pdfPage.getContentAsPDF();
In my vf i am displaying some records with checkbox. When i click on Selected Button , It is displaying Selected Records.
I want to Create PDF for Selected Records only.
But it is Generating PDF for my intial VF page..
please suggest me..
prem
- Premanath
- November 22, 2013
- Like
- 0
- Continue reading or reply
How do I submit output text to record?
When the page loads there will be an output text that is generated into an input field. I want that value to be submitted into salesforce. The content loads into the boxes, but it won't submit to the lead record.
<body onload="XYZ()"> </body> <apex:form > <br/><br/> <apex:actionFunction name="lg" action="{!iTEST}" rerender="jsvalues"> <apex:param name="lt" value="" assignTo="{!valueLt}"/> </apex:actionFunction> <apex:outputPanel id="jsvalues"> <apex:outputText value="Value lt:{!valueLt}" /><br/> <input type="text" name="{!Lead.Lt__c}" value="{!valueLt}"/> </apex:outputPanel> </apex:form> </apex:define> <html> <body>
- FFAA
- November 22, 2013
- Like
- 0
- Continue reading or reply
Soql with two in clause
I have to query from a custom object.
In the apex class i have to pass two lists as given below:
Select field1__c,field2__c , ,field3__c,field4__c,field5__c,field6__c,field7__c
From Object_custom__c where
field1__c in : List1 AND
field6__c in : List6
When I run the following query in developer console but it gives 'Unknown error parsing query'.
Select field1__c,field2__c , ,field3__c,field4__c,field5__c,field6__c,field7__c
From Object_custom__c where
field1__c in : ['Field1_value1,' Field1_value2'] AND
field6__c in : ['Field6_value1,' Field6_value2']
- sonam
- November 20, 2013
- Like
- 0
- Continue reading or reply
Sequence of Deployment from Sandbox to Production.
Hello Folks,
What is the sequence while deployment from sandbox to Production?
Lets say, I've Custom Objects /Roles / Profiles/VF Pages/Classes/Triggers.Which one to be moved first to Production? -
What is the Sequence of it.
Appreciate your help.
- AlenForce
- November 20, 2013
- Like
- 0
- Continue reading or reply
Remove trailing zero with decimal format for apex:inputField
How to remove trailing zero with decimal format for <apex:inputField> and <apex:outputField>
Field Definition - Decimal - (10,5) - Five Decimal precision
Example :
Value : 5.01 - SFDC stores and displayed as 5.01000. I need to remove the trailing zeros. Actual value should be 5.01
- nsattish
- November 19, 2013
- Like
- 0
- Continue reading or reply
Page needs a refresh After Insert
I have a after insert, after update trigger that calls a class with @future annotation.
When i insert a record, a field in the record gets populated with a value based on existing records in the data base.
My trigger is working well but after i insert a record, I have to do do F5 (i.e refresh) to see the field value.
I don't have to do F5 on update, it's only on insert.
Is there any way to refresh the page after the (after insert) trigger is fired ?
I don't have any VFP. It's a standard page.
It's strange that sometimes the field is updated immediately after insert, without having to refresh.
i read a post with similar issue http://boards.developerforce.com/t5/Apex-Code-Development/Refresh-a-page-after-insert/td-p/504945 which doesn't resolve my problem.
Thanks.
- Sabrent
- November 19, 2013
- Like
- 0
- Continue reading or reply
Does anyone know how to apply style to dependent picklist.
Hi,
I have two picklist fields.
I am able to apply style for controlling field but the style is not getting applied to dependent picklist.
Does anyone know how to apply style to dependent picklist.
Even I put javascript for onchange event of controlling picklist field to apply style for dependent picklist.
But it is not working.
It will be great help if some one have any idea to do it.
Thanks!
- amitashtekar
- April 26, 2013
- Like
- 1
- Continue reading or reply