You need to sign in to do that
Don't have an account?
Linda Gatson 7
<apex:selectOptions value="{!generalActivityOptions}"/>
This is what our former developer said: So apparently the Time Entry page was written in Visualforce. The backend code builds those drop down lists in code and looks at a Custom Setting in Salesforce to build the options in the picklist. So editing the picklist does nothing towards changing the values you see in the Activity dropdown list on the Daily Time Entry page.
Need to figure out where/how to edit picklist on a visualforce page
<apex:selectOptions value="{!generalActivityOptions}"/>
This is what our former developer said: So apparently the Time Entry page was written in Visualforce. The backend code builds those drop down lists in code and looks at a Custom Setting in Salesforce to build the options in the picklist. So editing the picklist does nothing towards changing the values you see in the Activity dropdown list on the Daily Time Entry page.
where xxxx is the name of the apex class used as the controller or controller extension for the page.
I found and looked at an apex class page called TimesheetExtension, but still don't see the picklist items I need to edit. Any other thoughts?
Total for Day Note: Project choices cannot be edited once saved. To remove a time entry, highlight and delete Labor and Travel hours on that row and click Save. And this is the code from the TimesheetExtension page: public with sharing class TimesheetExtension { public Timesheet__c timesheet; public Contact userContact; List upserts = new List(); List deletes = new List(); private Date currentDate; public Boolean dirty {get; set;} public class ProjDescException extends Exception{} /* * */ public TimesheetExtension(ApexPages.standardController ctl) { this.timesheet = (timesheet__c)ctl.getRecord(); dirty = false; if (getUserContact() == null) { ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Timesheets can only be created for users with matching Contact records. Please see your system administrator for assistance.')); } Schema.sobjecttype.Timesheet__c.getKeyPrefix(); } public void pageDirty() { this.dirty = true; } public Boolean getValidUser() { return (getUserContact() != null); } /* * */ public PageReference navigate() { if (timesheet.id == null) { timesheet.status__c = 'New'; try { timesheet.person__c = getUserContact().id; timesheet.person__r = getUserContact(); } catch (Exception e) { } String dateParam = ApexPages.currentPage().getParameters().get('dt'); if (dateParam != null) { currentDate = Date.valueOf(dateParam); } else { currentDate = System.today(); } timesheet.workday__c = currentDate; try { Timesheet__c findTimesheet = [SELECT ID, Status__c FROM timesheet__c WHERE person__c = :timesheet.person__c AND workday__c = :currentDate LIMIT 1]; if (findTimesheet.id != null) { return new ApexPages.standardController(findTimesheet).edit(); } } catch (Exception e) { } } else { if (timesheet.status__c == null) timesheet.status__c = 'New'; } return null; } public Contact getUserContact() { if (userContact == null) { String uId = Userinfo.getUserId(); try { userContact = [SELECT ID, name FROM contact WHERE user_account_link__c = :uId LIMIT 1]; } catch(Exception e) { } } return userContact; } /* * */ public Boolean getIsLocked() { //return (timesheet.status__c != 'New'); if (timesheet.id == null || timesheet.Weekly_Timesheet__c == null) { return false; } else { return (timesheet.week_status__c != 'New'); } } /* * */ public PageReference switchDate() { Timesheet__c tm = new Timesheet__c(); PageReference pg = Page.DailyTimesheet; Date dt = timesheet.Workday__c; pg.getParameters().put('dt',dt.year() + '-'+dt.month() + '-' + dt.day()); pg.setRedirect(true); return pg; //return null; } public PageReference nextDay() { Timesheet__c tm = new Timesheet__c(); if (timesheet.Workday__c != null) { PageReference pg = Page.DailyTimesheet; Date dt = timesheet.workday__c.addDays(1); pg.getParameters().put('dt',dt.year() + '-'+dt.month() + '-' + dt.day()); pg.setRedirect(true); return pg; } else { return null; } } public PageReference prevDay() { Timesheet__c tm = new Timesheet__c(); if (timesheet.Workday__c != null) { PageReference pg = Page.DailyTimesheet; Date dt = timesheet.workday__c.addDays(-1); pg.getParameters().put('dt',dt.year() + '-'+dt.month() + '-' + dt.day()); pg.setRedirect(true); return pg; } else { return null; } } /* * */ public List projectEntries { get { if (projectEntries == null) { projectEntries = getEntries(Utility.RT_TIME_PROJECT.id); } return projectEntries; } set; } public Boolean hasProjectEntries { get { return projectEntries != null && projectEntries.size() > 0; } } /* * */ public List oppEntries { get { if (oppEntries == null) { oppEntries = getEntries(Utility.RT_TIME_OPPORTUNITY.id); } return oppEntries; } set; } public Boolean hasOppEntries { get { return oppEntries != null && oppEntries.size() > 0; } } /* * */ public List accEntries { get { if (accEntries == null) { accEntries = getEntries(Utility.RT_TIME_ACCOUNT.id); } return accEntries; } set; } public Boolean hasAccountEntries { get { return accEntries != null && accEntries.size() > 0; } } /* * */ public List otherEntries { get { if (otherEntries == null) { otherEntries = getEntries(Utility.RT_TIME_OTHER.id); } return otherEntries; } set; } public Boolean hasOtherEntries { get { return otherEntries != null && otherEntries.size() > 0; } } /* * */ private List getEntries(ID rtId) { List entries = [SELECT ID , name , account__c , activity__c , opportunity__c , project__c , service_hours__c , travel_hours__c , total_hours__c , description__c , recordTypeId , Activity_Link__c FROM Time_Entry__c WHERE timesheet__c = :timesheet.id AND RecordTypeId = :rtId]; if (rtId == Utility.RT_TIME_OTHER.id && getIsLocked() == false) { for (Integer i = 0; i < 3; i++) { entries.add(new Time_Entry__c(RecordTypeId=rtId, Workdate__c = currentDate, Contact__c=userContact.Id)); } } else if (entries.isEmpty()) { for (Integer i = 0; i < 1; i++) { //entries.add(new Time_Entry__c(RecordTypeId=rtId)); } } return entries; } /* * */ public List allEntries { get { if (allEntries == null) { allEntries = [SELECT ID , name , account__c , activity__c , opportunity__c , project__c , service_hours__c , travel_hours__c , total_hours__c , description__c , recordTypeId , title__c FROM Time_Entry__c WHERE timesheet__c = :timesheet.id ORDER BY recordTypeId , project__c]; } return allEntries; } set; } /* * public List getProjects() { Map projectMap = new Map(); List projects = new List(); Date endDateRange = timesheet.Workday__c - 120; List prs = [SELECT project__c , project__r.id , project__r.name FROM project_resource__c WHERE resource__c = :getUserContact().id AND project__r.start_date__c = :endDateRange OR project__r.actual_Completion__c = null) //AND project__r.status__c NOT IN ('Cancelled') ORDER BY project__r.name]; for (Project_Resource__c pr : prs) { if (projectMap.get(pr.project__c) == null) { projectMap.put(pr.project__c, pr.project__r); projects.add(pr.project__r); } } return projects; } */ /* * public List getProjectOptions() { if (projectOptions == null) { projectOptions = new List(); projectOptions.add(new SelectOption('', '')); for (Project__c p : getProjects()) { projectOptions.add(new SelectOption(p.id, p.name)); } } return projectOptions; } */ /* * public List getProjectActivityOptions() { if (projectActivityOptions == null) { projectActivityOptions = getActivityOptions(Utility.RT_TIME_PROJECT.id); } return projectActivityOptions; } */ /* * public List getOpportunityActivityOptions() { if (opportunityActivityOptions == null) { opportunityActivityOptions = getActivityOptions(Utility.RT_TIME_OPPORTUNITY.id); } return opportunityActivityOptions; } */ /* * public List getAccountActivityOptions() { if (accountActivityOptions == null) { accountActivityOptions = getActivityOptions(Utility.RT_TIME_ACCOUNT.id); } return accountActivityOptions; } */ /* * */ public List generalActivityOptions { get { if (generalActivityOptions == null) { generalActivityOptions = getActivityOptions(Utility.RT_TIME_OTHER.id); } return generalActivityOptions; } private set; } /* * */ public List getActivityOptions(ID rtId) { List opts = new List(); opts.add(new SelectOption('', '')); for (String act : Utility.getActivityList(rtId)) { opts.add(new SelectOption(act, act)); } return opts; } /* * */ public List summary { get { if (summary == null) { summary = new List(); summary.add(timesheet); } return summary; } set; } /* * */ private void updateEntries(List entries) { for (Time_Entry__c te : entries) { if (te.id != null && te.Service_Hours__c == null && te.Travel_Hours__c == null) { deletes.add(te); } else if (te.Service_Hours__c != null) { if (te.id == null) { te.Workdate__c=timesheet.Workday__c; te.Contact__c = userContact.ID; te.Timesheet__c = timesheet.ID; } upserts.add(te); } } } /* * */ private void saveChanges() { if (dirty != null && dirty == true) { //only do the save if something has changed if (timesheet.ID == null) { timesheet = TimeEntryUtility.buildTimesheet(timesheet.Workday__c, userContact.ID); } upserts = new List(); updateEntries(projectEntries); updateEntries(oppEntries); updateEntries(accEntries); updateEntries(otherEntries); upsert upserts; if (deletes.size() > 0) { delete deletes; } } } /* * */ public PageReference submitTimesheet() { try { if (getIsLocked() == false) { //don't save changes if we're locked saveChanges(); } } catch (Exception e) { ApexPages.addMessages(e); return null; } Weekly_timesheet__c wt = new Weekly_Timesheet__c(ID=timesheet.Weekly_Timesheet__c); return new ApexPages.standardController(wt).view(); } /* * */ public PageReference saveTimesheet() { String projDescCheck = ''; if (dirty != null && dirty == true) { try { //projDescCheck = getCheckProjects(); //if(projDescCheck == '') { saveChanges(); //} else { // if(Label.EnableProjectDescValidation == 'Y') { // throw new ProjDescException(projDescCheck); // } //} } catch (Exception e) { ApexPages.addMessages(e); return null; } return new ApexPages.standardController(timesheet).edit(); } else { return null; } } public PageReference cancelSave() { PageReference ref = ApexPages.currentPage(); ref.setRedirect(true); return ref; } /* public String getCheckProjects(){ String errorstring = ''; Set setProjIds = new Set(); for (Time_Entry__c te:getProjectEntries()) { setProjIds.add(te.Project__c); } for(Project__c pj:[select id, Project_Description__c, Owner.Name, Name from Project__c where id in :setProjIds]) { if(pj.Project_Description__c.length() < 50) { errorstring = errorstring + 'Project Description is invalid for Project: ' + pj.Name + '. Please contact the Project Owner: ' + pj.Owner.Name + ' to request a correction before you may enter your time against this project.' + '\n'; } } System.Debug('error string: ' + errorstring); // return errorstring; } */ }
If yiu go to Setup and typecustom settings on the search box then click on the custom settings link it will give you a list of all the custom settings In your org. See if you can find one that has a name or description for the Activity in the time sheet. Click on the name to see the values it contains.
Like i said, I will check on this later and if you haven't found it by then I will see what I can do.
public List generalActivityOptions
{ get
{ if (generalActivityOptions == null)
{ generalActivityOptions = getActivityOptions(Utility.RT_TIME_OTHER.id);
}
return generalActivityOptions;
}
private set; } /* * */
public List getActivityOptions(ID rtId)
{
List opts = new List();
opts.add(new SelectOption('', ''));
for (String act : Utility.getActivityList(rtId))
{
opts.add(new SelectOption(act, act));
} return opts;
} /* * */
So my other suggestion is to look into the Custom Settings and see if you find there a custom setting named Utility. If it is there, it should have a field called RT_TIME_OTHER which should be the list of the values for the picklist.
I am out of my depth here, so if this is not the answer I don't think I can't help.
ok IF i understand correctly, the Utility Class sets the value of RT_TIME_OTHER by giving it the ID of the record type 'Other_Time' in the Object Time_Entry__c
then with the id of that recordtype it calls a class, object or custom setting called Project_Settings__c project settings has the list of values in a field (or attribute) called general_activities__c
so now check and see if you have an object, class or Custom Setting with the name Project_Settings__c I sure hope it is a custom object or a Custom Setting.