1. François Rossignol
  2. PowerBuilder
  3. Wednesday, 23 January 2019 09:20 AM UTC

Hi,

 

I'm using PB 2017 R3

 

I have a global function string f_global_function (date ad_date)

return(g_global_object.date_functions_object.of_method(ad_date))

 

If I use that global function in a computed field in a datawindow the function is never called

f_global_function(date_field)

 

I modified my global function string f_global_function (string as_date)

return(g_global_object.date_functions_object.of_method(date(as_date)))

and it works perfectly.

 

I'm not very keen on the conversion of dates and I'd like to stick to the date datatype.

 

Is this a normal behaviour of PB or is it a bug for which I shall open a ticket ?

 

Regards,

François ROSSIGNOL

Accepted Answer
Brad Mettee Accepted Answer Pending Moderation
  1. Wednesday, 23 January 2019 15:36 PM UTC
  2. PowerBuilder
  3. # Permalink

What happens if you define your function to take a datetime argument instead of just date?

Comment
There are no comments made yet.
François Rossignol Accepted Answer Pending Moderation
  1. Friday, 25 January 2019 08:49 AM UTC
  2. PowerBuilder
  3. # 1

If the argument is datetime it works.

 

I reported the bug with a small sample application.

Comment
  1. Chris Pollach @Appeon
  2. Friday, 25 January 2019 18:13 PM UTC
Hi Francois ... FYI: I replicated the issue in PB2017R3 and PB2019 Beta #1
  1. Helpful
There are no comments made yet.
Derek Hammonds Accepted Answer Pending Moderation
  1. Thursday, 24 January 2019 15:58 PM UTC
  2. PowerBuilder
  3. # 2

This 'bug' has been around for many, many years.   It's certainly been around since PB 11.  I believe the limitation is this: If you want to use a global function in a datawindow expression it has to return a string.

 

 

 

 

 

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 23 January 2019 19:37 PM UTC
  2. PowerBuilder
  3. # 3

Hi François;

  Please open a Support Ticket for this issue and also attach a simple PB App to the ticket as a Test Case.

Many thanks in advance!

Regards ... Chris

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 23 January 2019 09:42 AM UTC
  2. PowerBuilder
  3. # 4

Hi,

I think its a bug.

You may use datetime as parameter. This should work.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.