AnsweredAssumed Answered

IF statement on portal or ODBC

Question asked by ngramstad on Dec 31, 2018
Latest reply on Jan 2, 2019 by ngramstad

Hi all,

 

I have a PO Header table and PO Detail table set up in a MySQL database via ODBC. The PO Header is represented in a layout which also contains a portal holding the PO Detail records. The two tables are related via "aliased" tables in the FM Relationship graph. I think these are referred to as ESS tables...?

 

I want to implement a series of checks for the business logic for each section of the workflow. I'd prefer to be able to do this via stored procedure on the DB server, but I'm not seeing a way to return a value to the FM client to prompt a script step/ show custom dialog. I then tried to create a script using IF statements that would validate the data and prompt the user if there was  a problem.

 

From the PO Header Layout the user hits a "Manage PO" button that opens a new window with buttons that allow them to move the PO to a new status. When I try to execute my IF statements from a button on this New Window I'm getting results that aren't making sense to me. Basically, when I run the script from the button the logic doesn't appear to be applied correctly. When I execute the script from the Script Workspace/ Debug the logic is applied correctly. Definitely feels like I'm missing something basic.

 

Here's my script:

If [(fm_PO_Detail::product_qty < 1)]

     Show Custom Dialog [ "Test1"; "Less than" ]

Else

     Show Custom Dialog [ "Test2"; "More than" ]

End If

 

Any thoughts?

Outcomes