Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Is there any way to change the content of a bookmark automatically?

Hi guys, I have a bookmark that gets the two last months of the current year.

So my bookmark is :

Year : 2011

Month : apr,may

What about if when last month changes to june? I would like to automatically get the last two months in my bookmark, and not create a brand new bookmark with my new desired selection.

Many thanks in advance!!

1 Solution

Accepted Solutions
isaiah82
Creator III
Creator III

Correct; you will need to do it in the load script.  Obviously you'll want to make these calculated in your script instead of hard-coded based on some other date (e.g. today() or something similar.)

Just on a semantic note, I would name your fields as "MonthCounter" or something similar; using the convention you used above I would expect a 1 if in the current year/month otherwise a 0.  The purpose for the counter is a bit different.  But very useful, counterfield = -1 always returns the prior period.

-Isaiah

View solution in original post

5 Replies
isaiah82
Creator III
Creator III

Hi Marcel - I don't think you can include the explicit values in your bookmark, however you have a few other options.


Probably best would be to use some calculated fields in your loaded data.  For example a "month counter" that would have maybe 0 for the current month and -1 for the prior month, etc.  Or you could "Current Month" and "Last Month" for a more friendly display.  Then you could filter on the derived field for your bookmark.  Every time the document reloads these would be recalculated making them dynamic.  Let me know if that doesn't make any sense.


Alternatively sometimes for this purpose I scap the bookmark and instead use a macro to make the dynamic selections.  You would have to trigger this with some action instead of using a bookmark.  Maybe not the best solution here, but the nice thing is that your selections reflect the actual month values (e.g. apr,may.)

-Isaiah

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Do you mean to do it inside the load script? Something like.

Year      Month        CurrentYear     CurrentMonth

2011    jan                    0                    -4

2011    feb                    0                    -3

2011    mar                   0                    -2

2011    apr                    0                    -1

2011    may                  0                     0

Where 0 is current, -1 is current-1, and so on??

isaiah82
Creator III
Creator III

Correct; you will need to do it in the load script.  Obviously you'll want to make these calculated in your script instead of hard-coded based on some other date (e.g. today() or something similar.)

Just on a semantic note, I would name your fields as "MonthCounter" or something similar; using the convention you used above I would expect a 1 if in the current year/month otherwise a 0.  The purpose for the counter is a bit different.  But very useful, counterfield = -1 always returns the prior period.

-Isaiah

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Many thanks Isaiah. This is what I wanted to do.

Regards, Marcel.

controlling_ms
Contributor
Contributor

Hi,

great Tip, simple and effective!

Regards