1. CJ Lai
  2. PowerServer 2020 or older (Obsolete)
  3. Monday, 24 August 2020 22:57 PM UTC

Hi

I am hoping someone would know why this is happening.

This is the setup

I have the CloudPro IDE with PowerServer installed. (This is all local)

Also, I run the app as IWA.

- There are several (user-defined) function calls in a button's clicked().

Something like this:

(some variable assignments)

function call #1 (it does file UPload by calling appeonfileservice user object)

(some process)

function call #2 (it does file DOWNload by calling appeonfileservice user object)

(some more process including a dw.Update() call)

when the update is successful

function call #3

(some other stuff)

 

For some reason, Powerserver skips function call #3. I have a messagebox() in the first line of the function's script just to make sure Powerserver does go in and do stuff. Unfortunately, that message box never popped up. That's how I figured function #3 is skipped all together.

The button's clicked() works just fine in Powerbuilder and all the script gets executed when running Powerserver BUT function #3. 

I really can't figure out why function #3 is jumped over. (not a single line of script was executed in it)

Could you help?

Thanks

Accepted Answer
CJ Lai Accepted Answer Pending Moderation
  1. Tuesday, 25 August 2020 17:07 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # Permalink

I got it figured out although I have no idea how it happened

 

Out of desperation, I did an "Edit Source" on the function. Right off the bat, I saw the following lines of code:

forward prototypes
global function integer f_save_form_as_pdf_to_db ()
global function long f_save_form_as_pdf_to_db (string as_patient_id, string as_form_full_path, string as_form_name)
end prototypes

 

I have no idea how and why the first line of Global Function got in there but it apparently is Not how the function is defined. So, I took it out.

That fixed the 'invisibility' of the function. The invisible cloak was lifted.

 

Thank you all for your input. I appreciate your effort and time.

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 25 August 2020 18:17 PM UTC
Thanks for sharing the solution!
  1. Helpful
  1. Kai Zhao @Appeon
  2. Wednesday, 26 August 2020 00:35 AM UTC
If there are multiple parameter list in the function definition section, then this global function is the overloading function.

I am sorry to let you know PowerServer can't support the global function contain the overloaded function. So please separate your global function to two new functions to solve this issue.
  1. Helpful
  1. CJ Lai
  2. Wednesday, 26 August 2020 14:20 PM UTC
Good to know that function overload is not supported in PowerServer
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Tuesday, 25 August 2020 14:58 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Powerserver will by design skip over any unsupported code, which is actually kinda cool and what you might typically want.

The problem is how it decides what to skip over, and when.  It will sometimes skip an entire function or event if they contain something that PS doesn't support - even if that code generally won't be executed.

the hardest part is finding those parts of the system that it skips.  once you find that, you pretty much have to work out the why and figure out a work around.  I generally start commenting things out and use messageboxes to work out where the problem is.

Usually i will have an:

IF NOT PSWEB THEN unsupported code

for when i need to include unsupported PS code, which works great.  My app runs on both PS and as C/S so i have a fair bit of that.

 

In any case, this is actually a somewhat rare occurrence so don't let this stop you from using powerserver.  

 

Comment
  1. CJ Lai
  2. Tuesday, 25 August 2020 16:22 PM UTC
Hi Nike

Per your suggestion, I commented out all but a MessageBox in the function in question (function #3).

Powerserver Still skipped the function call; the messagebox never showed up.



ZhaoKai suggested that I check the UFA output which indicated Powerserver 'can not' find such function. That is baffling..
  1. Helpful
There are no comments made yet.
CJ Lai Accepted Answer Pending Moderation
  1. Tuesday, 25 August 2020 13:20 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

UFA screen shot attached

Attachments (1)
Comment
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 25 August 2020 02:31 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3

Hi CJ,

Are there deployment errors related to this function? Are there unsupported features used in this function? You can check it in the UFA report.

Do the scripts after function call #3 work well in the button's clicked()? Please try to call this function separately and see if it works well.

If there is still the issue, please provide a simple reproducible PB case for us for more study, thanks.

Regards,
ZhaoKai

Comment
  1. CJ Lai
  2. Tuesday, 25 August 2020 13:20 PM UTC
Hi ZhaoKai

You were correct; the function in question showed up in the UFA report. What I don't understand is why/How?



The function is listed in the PBL list and certainly in the PBT.(please see the attached screen shot red box to the left)

The UFA says the function isn't found (the red boxes in the screen shot to the right)



In the bottom of the screen shot I also attached the arguments that are needed by the function. They match.



Please advise



Thanks!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 25 August 2020 01:47 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 4

Hi CJ;

   I've had this happen the odd time in my frameworks when the function / command before the next function crashes. In your case / example, Function #2 crashes just before Function #3, causing F#3 not to execute.

   Have you tried stepping through the code using the PowerServer debugger?

Regards... Chris

Comment
  1. CJ Lai
  2. Tuesday, 25 August 2020 14:16 PM UTC
Hi Chris

The command right before the function call is a COMMIT to the dw.Update().

Even after I took out the Commit and thus make the function call the very first line to execute, it got skipped over.
  1. Helpful
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.