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

Home » RADICORE development » Bug Reports » calling ADD2 from LIST1 with $where set.
calling ADD2 from LIST1 with $where set. [message #1164] Tue, 06 November 2007 17:41 Go to previous message
alrobertson is currently offline  alrobertson
Messages: 9
Registered: October 2007
Location: Vancouver
Junior Member
I realize this is not the usual way to use ADD2 so you may just want to tell me to use a different pattern.

What I was trying to do was:
1. Display a list (LIST1) of all the parts that could be built in house ($where specified parts that are built in house).
2. Make a selection and then call ADD2 to create a record of the part I wanted to build.

ADD2 accepts the $selection if it is returning from a popup or if $where is empty but since I am returning from a LIST1 with $where set, ADD2 ignores the $selection in favour of the $where.
In my case the $where did not have any fields that existed in the ADD2 table. I used this fact to get around it by changing std.add2.inc to wait until after $dbobject was set and then added:
if (!empty($selection) AND !isset($return_from)) {
$where2 = filterWhere($where, $dbobject->fieldspec, $dbobject->tablename);
if (empty($where2)) {
// only use $selection if $where is empty
$where = $selection;
} // if
$selection = null;
} // if
 
Read Message
Read Message
Previous Topic: getInitialDataMultiple does not deal with ') OR (' in $where parameter
Next Topic: Audit trail enquiry problem in 2007-11-01 release
Goto Forum:
  


Current Time: Fri Nov 29 02:43:13 EST 2024

Total time taken to generate the page: 0.00914 seconds