Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Application Development » How to provide choices for two compound foreign keys in a form? (I want to provide a selection mechanism such that fill two fields in a form can be chosen and populated.)
Re: How to provide choices for two compound foreign keys in a form? [message #4856 is a reply to message #4855] Thu, 23 July 2015 07:18 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2348
Registered: April 2006
Location: Surrey, UK
Senior Member
This is what I have in the _cm_initialise() method of the parent entity in the POPUP2 task:
$pattern_id = getPatternId();
if (!preg_match('/order_id=/i', $where)) {
    if (isset($GLOBALS['return_from'])) {
        if ($GLOBALS['return_from'] == 'ord_order_header_p(popup1)') {
            // nothing selected from popup screen, so exit now
            scriptPrevious($GLOBALS['errors']);
        } // if
    } // if
    if (preg_match('/popup2/i', $pattern_id)) {
        // order_id has not been supplied yet, so get it now via a popup
        scriptNext('ord_order_header_p(popup1)', $where);
    } // if
} // if

It is expecting to find "order_id=...." in the $where string. If it isn't there it suspends the current task and executes the popup which will provide a value for order_id. If this popup is terminated without choosing a value then this task will quit and return to the task which called it.


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Compound foreign keys in linking tables
Next Topic: ERROR: 22P02: invalid input syntax for integer
Goto Forum:
  


Current Time: Sun May 05 01:36:38 EDT 2024

Total time taken to generate the page: 0.01013 seconds