Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking for a week number in a workflow expression
#11
I think you can make it displaytype 4, those are read-only but updatable from workflows and then hide it from the profile of the user. Try that

Answering your previous question: "Would this also work in reports by the way?" No, we still don't have calculated values in reports but you could follow the same pattern I propose above and create a custom field to hold the calculation to report on.
Joe
TSolucio
Reply
#12
Thanks, will try that.

About the reports, I don't think I could use the 'format_date' function in a condition? Not sure What you meant by 'follow the same pattern I propose above', since the above pattern does rely on using a function to get the current week no. My question is more about: can we use those functions (not comparison functions, but functions that evaluate to the current week no.) in reports?

I can't update a UI type 4 field from a workflow, so changed it to UI type 1, then I'll just lock it for all profiles (read-only)

Hm, that doesn't work either, since the comparator won't let me select 'less than', it only does so on currency fields. I want to get the SO's with a week no. that is lower than the current week no., so really need to get this comparator. I think it's off to a custom cron job..
Reply
#13
Are you sure displaytype 4 isn't working? We created it just for that and it is currently in use (besides some clients) in the forecast amount in the application.

Making it read-only in the profiles will not work because the workflows won't update a read-only field that is why we create displaytype 4

AFAIK the "less than" operator will work on any numeric field. I just checked on my development install and it is there. How did you create the week number?
Joe
TSolucio
Reply
#14
I'm pretty sure, but again, this is a pretty old install. As we speak I'm in the process of updatin it, but this will take some time since I have to walk through all the hacks I made and replace them with new functionality that we have available now. I also need to write out a whole test procedure (for after the update) since this install is tied to all kinds of portals and a third-party accounting software suite.

However, I checked my own install, that is pretty recent, to check a workflow against the 'spent hours' field in timecontrol. That is a UI type 1 field, no 'smaller than' option. Are you talking about a specific UI type? What I'm trying to say is: how does the application decide which comparators should be available?
Reply
#15
It depends on the type of the field. If it is numeric (integer, decimal, currency, percent) you will be able to compare with less and greater. If it is a text field those operators are not available.
Joe
TSolucio
Reply
#16
So that's 7,9 and 71? Or does it check the column type in MySQL? I'm not sure if I have these types available yet. I'm writing upgrade notes and posting topics about this as we speak. I think I'll pickup this project after I've upgraded my installation.
Reply
#17
yes, those uitypes look good but I'd say it uses the typeofdata column, the first character which holds the type of the field:

http://corebos.org/documentation/doku.php?id=en:devel:field_structure#typeofdata_for_fields_in_modules
Joe
TSolucio
Reply
#18
Ah, wait, then I COULD get it to work. Damn, never knew about these typeofdata structures. Thanks!
Reply
#19
Joe, another thing I just found out: I thought you were talking about UI type no. 4, but I just now realized you were talking about display type no. 4.
Reply
#20
:-)

give displaytype 4 a try and let us know how it goes
Joe
TSolucio
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)