You need to sign in to do that
Don't have an account?

Is this a realy bad idea?
Hi All,
I have a custom object named timesheet__c, which has a date field week_ending__c (this date can only be a saturday)
I am required to show clickable list of dates,
where clicking on a date would lead to a view of all objects with week_ending__c = <date selected>
I don't know Visual force or Apex. so I was thinking have a more simple solution, please tell me if this is a really bad Idea.
I would create another custom object: weekend_dates__c. and feed it with all of the Saturdays in the coming year or two.
When a user chooses week_ending__c from a date control, another field (a lookup to weekend_dates__c) would look up to the appropriate Saturday.
This would allow me to easily design a tab listing weekend_dates__c, and in which all related timesheet__c will be seen under related lists.
The question is, how hard, if at all possible, to create a lookup field that automatically looks up a record. can this be done with a default formula?
I'm thankful to any ideas you may come up with.
Ben
I have a custom object named timesheet__c, which has a date field week_ending__c (this date can only be a saturday)
I am required to show clickable list of dates,
where clicking on a date would lead to a view of all objects with week_ending__c = <date selected>
I don't know Visual force or Apex. so I was thinking have a more simple solution, please tell me if this is a really bad Idea.
I would create another custom object: weekend_dates__c. and feed it with all of the Saturdays in the coming year or two.
When a user chooses week_ending__c from a date control, another field (a lookup to weekend_dates__c) would look up to the appropriate Saturday.
This would allow me to easily design a tab listing weekend_dates__c, and in which all related timesheet__c will be seen under related lists.
The question is, how hard, if at all possible, to create a lookup field that automatically looks up a record. can this be done with a default formula?
I'm thankful to any ideas you may come up with.
Ben
Have a list of dates, where by each date there would be a count of the number of sheets that are marked by that date.
Clicking on a date, would lead one to an inline editable, list view of the object.
Simple enough, I found I don't know how to do that.
Ben
Yikes! LOL!
Without using Apex this could get a little crazy, but it's doable. You need a pretty complex validation rule to do this. This site has a pretty decent calculation, and the only problems I see with it are validation data that the date control should handle for you anyway (ie. you can enter things like 0 for the day and month and it doesn't complain. lol). http://www.urquhart.org/clanurquhartge/birthday_calculator.htm
You will have to sort of use this:
... but we are only concerned with small peices of it. First, Saturday should always mean that val0 = 0. So we don't really need the arrays. Also, we shouldn't need the validation for calc range as the date field will do that for us. Lastly, we don't need to set the result textboxes. So... we are left with the bits we need.
So, all you have to do now is struture all of that up above so that is it in one line and convert it to the validation rule code. parseInt = Round, form.day.value will now use Day, etc.
Do you need my help to take this farther, or do you think you can take it from here?
It's more like a formula field or a date field filled by Apex (personally I'd go with the latter). In Apex, it's as simple as using the toStartOfWeek function and adding 6 days to get to the next Saturday. Just a couple of lines of code. Not that difficult.
Well, first he said this: "I don't know Visual force or Apex. so I was thinking have a more simple solution...", but you are right that sorting this out in APEX is WAY easier.
Second, shame on me for stopping me reading of what he wanted after I got this far.
"Hi All,
I have a custom object named timesheet__c, which has a date field week_ending__c (this date can only be a saturday)
I am required to show clickable list of dates,
where ....
I don't know Visual force or Apex. so I was thinking have a more simple solution, please tell me if this is a really bad Idea."
Which made me think he just wanted a date input field that only accepted saturdays. -- Anyway, I went back up and "read" it all and now I'm really confused. LOL! It sounds like he wants a tab that acts like a summary report grouped by week_ending__c... but then he wants a list view that is inline editable??? I didn't think a list veiw had any any way to be inline editable. ---- OK... apparently you can edit some things by checking "Enable Enhanced Lists"... interesting. Is that new to v9?
Beener, you might think about calling your Salesforce.com support guy and asking about the Force.com Extension program whereby Salesforce.com developers can write simple Apex and Visualforce pages for you at a low cost.
I understand from the discussion that what I want isn't available in any simple manner.
SiriusBlackOp, is that script supposed to help me find the upcomng saturday? if it is I have a one line formula that does that. if not, what does it do?
I did look into VF, as werewolf said, I can only look at enhanced, existing lists, that is, I cannot make an enhanced list by way of a query, such as [select ... where date1__c= this_weekend_date].
This is a real shame, but I guess I'll have to work within what I have.
Thanks again to both of you.
CASE( MOD( date__c - DATE(1900, 1, 7), 7),
6, 1,
0 ) = 0
I copied and pasted it from my Validation rule.
It's much shorter then the Java script. do you see any fault with it?
Tested it and it seems to work great! Covered both leap and non-leap years.
If anyone needs to validate a day, that is the way to go. :smileyhappy:
Thanks for the post.