-
ChatterFeed
-
11Best Answers
-
0Likes Received
-
0Likes Given
-
7Questions
-
98Replies
API Version 25 or 27?
Hi, I wanted to know how these two version differ? I noticed that some of my apex classes use version 25 and some of my triggers 25 or 27? We are taking project from sandbox to production, so I'm thinking should I update these or ?
- Laaral
- September 09, 2013
- Like
- 0
- Continue reading or reply
problem in saving records
i am able to save mutiple records at once but all the records are the same even if i selected/typed different values in each row. it is only saving the values from last row but the dates on the Leave_Date__c are working fine.
for example this is what i typed:
Id Date Remarks Days Off
a3He00000000ktX 09-05-13 A Whole
a3He00000000ktX 09-06-13 B Half
a3He00000000ktX 09-07-13 C Quarter
these are the records saved:
Id Date Remarks Days Off
a3He00000000ktX 09-05-13 C Quarter
a3He00000000ktX 09-06-13 C Quarter
a3He00000000ktX 09-07-13 C Quarter
codes:
<apex:pageBlockSection title="Details" columns="2" rendered="{!showDetails}"> <apex:pageBlockTable value="{!listOfDates}" var="date" width="500px"> <apex:column headerValue="LeaveDate" style="padding: 0px 30px 0px 30px;"> <apex:outputText value="{0,date,EEE MM/dd/yyyy}"> <apex:param value="{!date}" /> </apex:outputText> </apex:column> <apex:column headerValue="With Pay"> <apex:inputField value="{!newleavedetail.WIth_Pay__c}"/> </apex:column> <apex:column headerValue="Leave Application Id"> <apex:outputText value="{!leave.id}"/> </apex:column> <apex:column headerValue="Day/s Off"> <apex:inputField value="{!newleavedetail.Day_s_Off__c}"/> </apex:column> <apex:column headerValue="Project"> <apex:inputField value="{!newleavedetail.Project__c}"/> </apex:column> <apex:column headerValue="Remarks"> <apex:inputField value="{!newleavedetail.Remarks__c}"/> </apex:column> </apex:pageBlockTable><br/><br/> <br /> </apex:pageBlockSection>
public List<Date> listOfDates{get;set;} public lad__c newleavedetail {get; set;} public la__c leave { get { if (leave == null) leave = new la__c(); return leave; } set; } public LeaveCC(ApexPages.StandardController controller) { listOfDates = new List<Date>(); newleavedetail = new lad__c(); //used for saving details } public PageReference savedetail() { try { for(integer x=0;x < listOfDates.size();x++){ Datetime d = listOfDates.get(x); lad__c leavedetail = new lad__c(); leavedetail.Leave_Application__c = leave.Id; leavedetail.Day_s_Off__c = newleavedetail.Day_s_Off__c; leavedetail.WIth_Pay__c = newleavedetail.WIth_Pay__c; leavedetail.Project__c = newleavedetail.Project__c; leavedetail.remarks__c = newleavedetail.remarks__c; integer year = integer.valueof(d.format('yyyy')); integer month = integer.valueof(d.format('MM')); integer day = integer.valueof(d.format('dd')); leavedetail.Leave_date__c = date.newinstance(year, month, day); //listOfDates.get(x); leaveAppDetailList.add(leavedetail); } insert leaveAppDetailList; } catch(Exception e) { apexPages.addMessages(e); } PageReference leaveapppage = new PageReference('/'+leave.id); leaveapppage.setRedirect(true); return leaveapppage; }
help!
- sp13
- September 05, 2013
- Like
- 0
- Continue reading or reply
Need help with Apex Service class? I will give kudos to anyone that contributes.
I've never built a Apex Service.... Below is a description of what I'm trying to do. I will give kudos to anyone that contributes.
Do you have any info on Apex Services?
What I need is a way to look at the contracts and create a new contract 60 days before the previous contracts end date.
I have the code that will build the follow up contract, what I don't have is a way minus using Time Based Workflow to query all contracts that are in the window of renewal of Maint or expiration and create new contracts for those that are 60 days out from expiration.
Any ideas?
Thank you,
Steve Laycock
- RelaxItsJustCode
- August 30, 2013
- Like
- 0
- Continue reading or reply
Soql query
I want to delete an account,i know only the contact name.I need to find in which account the contact is present, and need to delete the account. what is the Soql query for this?
- ezhil_k
- August 15, 2013
- Like
- 0
- Continue reading or reply
Display sections based on checkboxes checked
Hi Everyone,
I would like to get some suggestions on how to display sections on a Visualforce page based on specific checkboxes selected.
For eg: I have 4 checkboxes: 1, 2, 3, and 4 & I have 4 Sections on the VF page: Section A, B, C, D.
When Checkbox 1 is checked: Section A and B has to appear
Checkbox 2 is checked: Section A, C and D has to appear
Checkbox 3 is checked: Section A and C has to appear
Checkbox 4 is checked: Section A and D has to appear
If someone could share some sample code or any suggestions would be greatly appreciated.
Thanks!
- Victor19
- July 19, 2013
- Like
- 0
- Continue reading or reply
Future? Im a newbie
trigger Touch_Imp on User (after insert) { if(trigger.isInsert){ Set<String> usercontactid = new Set<String>(); for (User u : Trigger.new) { usercontactid.add(u.contactid); } if([SELECT COUNT() FROM implementation__c WHERE implementation__c.implementation_contact__c IN :usercontactid]>0){ Implementation__c[] updateimp = [SELECT id from Implementation__c WHERE implementation__c.implementation_contact__c IN :usercontactid]; Database.update(updateimp); } } }
Above is my current code. But I get an error message about updaing a setup object and non-setup object at the same time when I try to create a user record now. I believe I need to use the future command to fix this, but I have no idea how. I'm pretty new to apex coding and I'm really hoping you guys can give me a step by step on how to accomplish this task.
More Info (background on what I'm trying to do):
I'm trying to get my triggers on my Imp object to fire after my new user is created. The only way I know how to do that is to update the Imp record after the User record is updated. If there is a better way to accomplish this, please let me know! If I can supply any more needed information, just ask and I'll see what I can stir-up.
Thanks for reading, and hopefully helping :smileyhappy:
- cdavis@elt.com
- September 30, 2011
- Like
- 0
- Continue reading or reply
Importing Database details
Hi,
Is there any way to import a table details into SFDC custom objects or any other objects.
Actually what i want to do is, I have some user details in an another CRM(SURADO) and I want to import those user details into SFDC. Is this possible by importing the data in the csv form or something.
Thanks and Regards
Hari G S
- Hari G S
- September 30, 2011
- Like
- 0
- Continue reading or reply
Issue with product code
Hi,
I have added a new product with a product code, and added this product into Account(In the purchased product section).
I then went back to the product list and update the product name and product code. The product Name gets updated in the Purchased Product section under the Account but the product code does not seems to be updated.
Can any one help me to update the product code also?
Thanks
Hari G S
- Hari G S
- September 29, 2011
- Like
- 0
- Continue reading or reply
Deployment Using Change Sets - Custom fields are hidden in the target org
Hi All,
For the first time using the change sets to deploy from sandbox to production org.Im deploying custom fields,objects and tabs.Though im the platform administrator in both sandbox & prod,after deployment all fields\tabs are hidden in the prod org.I had to manually grant access to each of the field.
Please let me know if there is any additional configuration required before creating the change sets.
Thanks
SC
- SC1252
- June 10, 2010
- Like
- 0
- Continue reading or reply
Campaign object doesn't appear to allow 'create' via force Sites
Hi everyone,
I have created a visualForce page that has a couple "<apex:inputField>" for the 'campaign' object. When I view the VF page directly in Salesforce, it appears correct with the input box. But when I view it via 'Sites', the input area/box is not displaying as though the fields are 'read only'. I assumed it was an issue with 'field security' and the guest user profile but the fields are set to 'editable'. I also verified that 'view' and 'create' were checked for the 'Standard Object Permissions' for the profile. I tested it with other objects and only campaigns seems to be an issue?
Here is the sites page:
http://icbeta1-developer-edition.na2.force.com/
http://icbeta1-developer-edition.na2.force.com/
Fields:
<apex:inputField id="inputValue" value="{!campaign.startDate}"/>
<apex:inputField id="inputValue2" value="{!campaign.isactive}"/>
Thanks ahead of time!
<apex:page standardcontroller="Campaign">
<apex:form >
<apex:pageBlock title="School Recruiter Events">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Event Details" columns="2">
<apex:inputField id="inputValue" value="{!campaign.startDate}"/>
<apex:inputField id="inputValue2" value="{!campaign.isactive}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
- IC-Tanner
- September 09, 2009
- Like
- 0
- Continue reading or reply
too many query rows error :50001
I have a batch apex class that is running into Too many query rows limit exception. There is only 1 SOQL query inside my execute method that returns around 5000 rows. But after looking at the debug logs, it seems that records returning by SOQL query are getting cumulatively added in different batch executions. So after 10 iterations of batch executions, my batch class gets terminated because cumulative number of 'Total # of query rows' returned are more than 50K records.
As per my knowledge, dIfferent executions of batch class (execute method) should reset the governor limits but its not happening here.
Please respond if anyone has ever faced this issue.
- Sandeep001
- May 02, 2012
- Like
- 0
- Continue reading or reply
Unable to parse callout response. Apex type not found for element
Hello,
I am getting an exception while making an apex callout to a 3rd party web service from apex stub classes - System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element : <element name>
I can see the request as well as response in the developer org, but after getting the response, SFDC might throwing an exception while parsing.
Please suggest if anyone has ever encountered this error.
Regards,
- Sandeep001
- May 17, 2011
- Like
- 0
- Continue reading or reply
actionSupport inside selectList
Hi,
Please have a look at this code:-
<apex:panelGrid id="selectAdd">
<apex:selectList id="fld1" value="{!selectedVal}" multiselect="false" size="1" >
<apex:selectOptions id="selectAddOption" value="{!addressOptions}"/>
<apex:actionSupport event="onselect" action="{!pickListProcess} rerender="errorPanel,
addressPanel" status="SearchStatus immediate="true"/>
</apex:selectList>
</apex:panelGrid>
I am trying to obtain the value of selected picklist option (selectedVal ) in controller method - pickListProcess. But i always get it as null... anyother way to achieve this?
Thanks in anticipation...
- Sandeep001
- July 23, 2009
- Like
- 0
- Continue reading or reply
sforce.apex.execute giving error in Sites hosted on Prod org (na6)
Hi I am using sforce.apex.execute call from javascript in my VF page to execute a method in global method of a webservice apex class. This is working fine on Sandbox Site page but throws an error:-
{faultcode:UNKNOWN_EXCEPTION, faultstring:UNKNOWN_EXCEPTION: 'Site UNder Construction',}
when we deploy the code to production org that is hosted on na6. It also works fine in VF page on production org but on Sites page it fails.
Any thoughts why it is happening?
- Sandeep001
- July 16, 2009
- Like
- 0
- Continue reading or reply
API currently Disabled Error - Sites Development
I have created a Sites Page and on one of the button clicks I am trying to open a page hosted on 3rd party server. I am using URL on click of button to open a new page but getting an error of API CURRENTLY DISABLED for this user.
The 'API ENABLE' checkbox is checked for the profile of my Sites' User. I am not gettin this error when I do the same action from Salesforce instance.
Please respond if anyone aware of this.
- Sandeep001
- May 14, 2009
- Like
- 0
- Continue reading or reply
Trigger on Fiscal Year.
- Sandeep001
- July 07, 2008
- Like
- 0
- Continue reading or reply
missing ; before statement
convertedCase.Price_Quote__c={!Lead.Price_Quote__c};
Price_Quote__c is a custom field having 'Currency' as a data type in Sales force DB.
Can anyone suggest me the reason?
- Sandeep001
- June 30, 2008
- Like
- 0
- Continue reading or reply
Class within trigger doesn't finish execute in time?
From what I understood, that the class will still be executing eventhough after the record page has been updated and reloaded for the end-user? Never experience this before, how about anyone here?
trigger Opp on Opportunity (after update) {
for (Integer i = 0; i < Trigger.old.size(); i++) {
Opportunity old = Trigger.old[i];
Opportunity nw = Trigger.new[i];
Boolean man = false;
if ((nw.Probability == 100) && (old.Probability != nw.Probability)) {
oppClose.createCase(nw.Id, man);
//Clone statuses indicate different follow-up actions for people.
if (nw.Clone_Status__c != 'Completed' && nw.Clone_Status__c != 'Non-renewable' && nw.Clone_Status__c != 'Exception') {
oppClose.cloneOpp(nw.Id);
/*Clone Status field is updated from the trigger instead of the the class. The class runs asynchronsously (ie. in the future)
* so the results do not show up immediatley in the Opp after closing it won and returning to the saved record.
* By updating the field in the trigger a flag is set to alert the user and to prevent a subsequent update from
* triggering the class again if the async execution is delayed.
*/
Opportunity opp = new Opportunity(
Id = nw.Id,
Clone_Status__c = 'Completed');
update opp;
}
}
}
- MC2014
- January 15, 2014
- Like
- 0
- Continue reading or reply
How customizable is the interface of salesforce?
- Eric_SalesForce
- January 15, 2014
- Like
- 0
- Continue reading or reply
Apex Test Method Error: Constructor Not Defined?
So I've come to realize that there are two errors that I am learning to dislike very much...
1) Easilly the one I dislike the most is: "System.NullPointerException: Attempt to de-reference a null object"
2) The second has become: Save error: Constructor not defined: [ApexPages.StandardController].<Constructor>(xxxxx)
I've just written a half dozen or more Test Classes using the same syntax for creating the constructor in my test method but for some reason, this one is giving me a fit.
This class is an extension class. Is there something I need to do different? The constructors in all my classes are set up almost identically so I would assume creating them in my test class would be as well.
public with sharing class taskMyDelegatedView { public Id tskId {get;set;} public Id uID {get;set;} public String iView {get;set;} private ApexPages.StandardController controller; public taskMyDelegatedView(ApexPages.StandardController stdController) { controller = stdController; } Id currentUserId = userinfo.getUserId(); public List<Task> getMyDelegatedTasks() { return [SELECT id, Subject, Description, Status, WhatId, What.Name, Owner.Name, OwnerId, CreatedBy.Name, CreatedById, ActivityDate, Task_Due_Date__c, LastModifiedDate FROM Task WHERE CreatedById =: currentUserId ORDER BY LastModifiedDate]; } String result='Click on a task subject to preview the latest notes.'; public String getFetchedData() { return result; } public PageReference invokeService() { Id id = System.currentPageReference().getParameters().get('id'); result = [SELECT Description FROM Task WHERE Id=:id].Description; return null; } public static Task testTsk; public static taskMyDelegatedView testTaskMDV; public static Task_Informed_Users__c testInformedUser; public static User testUserId; static testMethod void informedUserListTest() { Test.startTest(); testUserId = [SELECT ID FROM User WHERE LastName=: 'User2']; System.Debug(testUserId); testTsk = new Task(Subject='testTask', description='ABC', ownerId=testUserId.Id); insert testTsk; System.Debug(testTsk.Id); testInformedUser = new Task_Informed_Users__c(Informed_user__c=testUserId.Id, Task_ID__c=testTsk.Id, Chatter_Notification__c=FALSE, Send_Email__c=FALSE); insert testInformedUser; System.Debug(testInformedUser.Id); Test.setCurrentPage(Page.delegatedTaskView); ApexPages.currentPage().getParameters().put('Id',testTsk.Id); ApexPages.Standardcontroller con = new ApexPages.Standardcontroller(testTaskMDV); //ERROR HAPPENING HERE taskMyDelegatedView tTMDV = new taskMyDelegatedView(con); system.runas(testUserId) { } Test.stopTest(); } }
- Vader
- September 10, 2013
- Like
- 0
- Continue reading or reply
Unable to get all values from SOQL statement
Hello,
I have a trigger on the Asset object which inserts two Account IDs into two Lists. One ID is for a Business Account, the other is for a Consumer Account. Both are correct when looking at the debug log. The issue I am facing Is I when I go to select an External ID from using the SOQL statement below, it only returns unique values. An example would be if I have a total of 20 new Assets coming in, with 3 distinct Business Account IDs and 15 distinct Consumer Account IDs, the List of Accounts will only have the 3 and 15 values. I need it to be populated with all Accounts being updated/inserted.
trigger Update_Registering_Dealer on Asset (after insert, after update) { List<String> accIds = new List<String>(); List<String> consIds= new List<String>(); integer count = 0; for(Asset a : Trigger.new) { if (a.Type__c == 'Registration') accIds.add(a.AccountID); system.debug('AccountID: ' + a.AccountID); consIds.add(a.Consumer__c); system.debug('Consumer: ' + a.Consumer__c); count ++; } List<Account> accsAssets = [Select a.Account_Number__c From Account a where a.Account_Status__c='Active' and Id IN :accIds]; List<Account> consumerAccount = [Select Registering_Dealer__c From Account where Account_Status__c ='Active' and Id IN :consIds];
The business goal here is to pull the External ID from the Business Account, onto the Consumer Account so we can identify where the Consumer purchased their last product.
Thank you in advance.
- jconner
- September 10, 2013
- Like
- 0
- Continue reading or reply
is it possible to not be able to query fields of a custom object
is it possible to not be able to query fields of a custom object?
when i run: select Project_1__c from Leave_Application__c ----it returns the id of the projects
but when i run: select Project_1__r.name from Leave_Application__c ----it doesnt return the name of the projects but the result of total rows are the same.
PS. i tried to run this in the query editor in developer console.
- sp13
- September 10, 2013
- Like
- 0
- Continue reading or reply
Trigger for sending email with Template
Hi,
I wrote the trigger for sending email with email template .
I need to send some persons as in CC address.
The Following is my trigger, Is there an possiblity to add ccaddress in that code. I also want to set orgWideAddress when it is equal to the value in CaseEmail__c.
Please help me.
trigger mailnotification on Case (after insert) { for(case c:trigger.new){ EmailTemplate etc =[SELECT id from EmailTemplate where Name =:'Case Email to Customer']; If((c.ContactId != null ) ||(c.SuppliedEmail != null)){ Messaging.SingleEmailMessage m = new Messaging.SingleEmailMessage(); m.setTemplateId(etc.id); for( OrgWideEmailAddress owa : [select id, Address, DisplayName from OrgWideEmailAddress]){ If(owa.Address==c.CaseEmail__c) m.setOrgWideEmailAddressId(owa.id);} String userEmail = c.CaseEmail__c; m.setReplyTo(userEmail); m.setTargetObjectId(c.contactId); m.setWhatId(c.id); Messaging.sendEmail(new Messaging.SingleEmailMessage[] { m }); } } }
- AmbigaRam
- September 09, 2013
- Like
- 0
- Continue reading or reply
VF page for a NEW record on a custom object
I am new to writing VF pages. I have a VF page and Apex Class that I have written to override the NEW button for my custom object. However, all that displays are the buttons at the top and bottom of the page, no fields. Can anyone take a look and point me in the right direction to correct my issue?
Thank you
VF Page -
<apex:page standardController="STG_Payment_Requests__c" extensions="ContentNewSTGPR">
<apex:sectionHeader title="STG Payment Request" subtitle="{!STG_Payment_Requests__c.name}"/>
<apex:form >
<apex:pageBlock title="New STG Payment Request">
<apex:pageBlockButtons location="top">
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Update" action="{!quicksave}"/>
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Update" action="{!quicksave}"/>
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!STGPR}" var="a" id="table">
<apex:pageBlockSection title="Information" columns="2">
<apex:outputField value="{!a.Account_Name__c}"/>
<apex:pageBlockSectionItem />
<apex:outputField value="{!a.Name}"/>
<apex:inputField value="{!a.Quantity__c}" required="true"/>
<apex:outputField value="{!a.STG_Promotion__c}"/>
<apex:outputField value="{!a.Payment_Amount__c}"/>
<apex:outputField value="{!a.Lane_Vendor_Number__c}"/>
<apex:inputField value="{!a.Reference_for_remittance__c}" required="false"/>
<apex:outputField value="{!a.Promoted_Brand__c}"/>
<apex:pageBlockSectionItem />
<apex:outputField value="{!a.Promotion_Type__c}"/>
<apex:pageBlockSectionItem />
<apex:outputField value="{!a.Promotional_Rate__c}"/>
<apex:inputField value="{!a.Comments__c}" required="false"/>
<apex:pageBlockSectionItem />
<apex:inputField value="{!a.Manager_Approved__c}" required="false"/>
<apex:pageBlockSectionItem />
<apex:inputField value="{!a.Senior_Manager_Approved__c}" required="false"/>
<apex:pageBlockSectionItem />
<apex:inputField value="{!a.Director_Approved__c}" required="false"/>
<apex:pageBlockSectionItem />
<apex:inputField value="{!a.File_Attached_to_Payment_Request__c}" required="false"/>
<apex:pageBlockSectionItem />
<apex:inputField value="{!a.Paid__c}" required="false"/>
<apex:pageBlockSectionItem />
<apex:OutputField value="{!a.Paid_Date__c}"/>
</apex:pageBlockSection>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Class -
public class ContentNewSTGPR {
public ContentNewSTGPR(ApexPages.StandardController controller) {
}
public List<STG_Payment_Requests__c> STGPR {get; set;}
public ContentNewSTGPR(){
STGPR = new List<STG_Payment_Requests__c>();
STGPR.add(new STG_Payment_Requests__c());
}
public void addrow(){
STGPR.add(new STG_Payment_Requests__c());
}
public PageReference save(){
insert STGPR;
PageReference home = new PageReference('/home/home.jsp');
home.setRedirect(true);
return home;
}
}
- Mr. Met
- September 09, 2013
- Like
- 0
- Continue reading or reply
API Version 25 or 27?
Hi, I wanted to know how these two version differ? I noticed that some of my apex classes use version 25 and some of my triggers 25 or 27? We are taking project from sandbox to production, so I'm thinking should I update these or ?
- Laaral
- September 09, 2013
- Like
- 0
- Continue reading or reply
can we call workflow form apex code?
I want check if my object after changes it's fields values in code will fire workflow rule.
Is it possible?
- birthus
- September 05, 2013
- Like
- 0
- Continue reading or reply
problem in saving records
i am able to save mutiple records at once but all the records are the same even if i selected/typed different values in each row. it is only saving the values from last row but the dates on the Leave_Date__c are working fine.
for example this is what i typed:
Id Date Remarks Days Off
a3He00000000ktX 09-05-13 A Whole
a3He00000000ktX 09-06-13 B Half
a3He00000000ktX 09-07-13 C Quarter
these are the records saved:
Id Date Remarks Days Off
a3He00000000ktX 09-05-13 C Quarter
a3He00000000ktX 09-06-13 C Quarter
a3He00000000ktX 09-07-13 C Quarter
codes:
<apex:pageBlockSection title="Details" columns="2" rendered="{!showDetails}"> <apex:pageBlockTable value="{!listOfDates}" var="date" width="500px"> <apex:column headerValue="LeaveDate" style="padding: 0px 30px 0px 30px;"> <apex:outputText value="{0,date,EEE MM/dd/yyyy}"> <apex:param value="{!date}" /> </apex:outputText> </apex:column> <apex:column headerValue="With Pay"> <apex:inputField value="{!newleavedetail.WIth_Pay__c}"/> </apex:column> <apex:column headerValue="Leave Application Id"> <apex:outputText value="{!leave.id}"/> </apex:column> <apex:column headerValue="Day/s Off"> <apex:inputField value="{!newleavedetail.Day_s_Off__c}"/> </apex:column> <apex:column headerValue="Project"> <apex:inputField value="{!newleavedetail.Project__c}"/> </apex:column> <apex:column headerValue="Remarks"> <apex:inputField value="{!newleavedetail.Remarks__c}"/> </apex:column> </apex:pageBlockTable><br/><br/> <br /> </apex:pageBlockSection>
public List<Date> listOfDates{get;set;} public lad__c newleavedetail {get; set;} public la__c leave { get { if (leave == null) leave = new la__c(); return leave; } set; } public LeaveCC(ApexPages.StandardController controller) { listOfDates = new List<Date>(); newleavedetail = new lad__c(); //used for saving details } public PageReference savedetail() { try { for(integer x=0;x < listOfDates.size();x++){ Datetime d = listOfDates.get(x); lad__c leavedetail = new lad__c(); leavedetail.Leave_Application__c = leave.Id; leavedetail.Day_s_Off__c = newleavedetail.Day_s_Off__c; leavedetail.WIth_Pay__c = newleavedetail.WIth_Pay__c; leavedetail.Project__c = newleavedetail.Project__c; leavedetail.remarks__c = newleavedetail.remarks__c; integer year = integer.valueof(d.format('yyyy')); integer month = integer.valueof(d.format('MM')); integer day = integer.valueof(d.format('dd')); leavedetail.Leave_date__c = date.newinstance(year, month, day); //listOfDates.get(x); leaveAppDetailList.add(leavedetail); } insert leaveAppDetailList; } catch(Exception e) { apexPages.addMessages(e); } PageReference leaveapppage = new PageReference('/'+leave.id); leaveapppage.setRedirect(true); return leaveapppage; }
help!
- sp13
- September 05, 2013
- Like
- 0
- Continue reading or reply
Need help to write merge trigger
Hi,
I'm haveing requriment like : There are two accounts A1 and A2,A1 having one open opportunity and A2 having one open opportunity when I try to merge A1 and A2 error should throws
for this i need to write trigger to merge account with conditions with custom button.
- Vishnu7700
- September 05, 2013
- Like
- 0
- Continue reading or reply
Need to pull an existing User Record
I am trying to create a test class for a new trigger and it involves a lookup to a user record. In my test class, do i have to create a new user entry, or is there a way to to reference any existing users in the org for the test?
- tmbarry
- August 30, 2013
- Like
- 0
- Continue reading or reply
Pre-populating current date/time with URL
I have this:
PageReference retPage = new PageReference('/' + changeID + '/e?00Na000000BA4Ip=Rejected&00Na000000BA4IU=True&00Na000000BA4IW=UserInfo.getName()&00Na000000BA4IV=');
This needs to equal the current date and time. How do I accomplish that?
00Na000000BA4IV=
- Staci
- August 30, 2013
- Like
- 0
- Continue reading or reply
System.trigger.new and Trigger.new
Hi,
Is there any difference in: between System.trigger.new and Trigger.new
-Kaity.
- Kaity
- August 30, 2013
- Like
- 0
- Continue reading or reply
Need help with Apex Service class? I will give kudos to anyone that contributes.
I've never built a Apex Service.... Below is a description of what I'm trying to do. I will give kudos to anyone that contributes.
Do you have any info on Apex Services?
What I need is a way to look at the contracts and create a new contract 60 days before the previous contracts end date.
I have the code that will build the follow up contract, what I don't have is a way minus using Time Based Workflow to query all contracts that are in the window of renewal of Maint or expiration and create new contracts for those that are 60 days out from expiration.
Any ideas?
Thank you,
Steve Laycock
- RelaxItsJustCode
- August 30, 2013
- Like
- 0
- Continue reading or reply