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 next 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
Re: calling ADD2 from LIST1 with $where set. [message #1165 is a reply to message #1164] Tue, 06 November 2007 19:32 Go to previous message
AJM is currently offline  AJM
Messages: 2350
Registered: April 2006
Location: Surrey, UK
Senior Member
The ADD2 pattern is designed to be called from a LIST2 pattern, not a LIST1. You are mixing your patterns incorrectly, therefore you need to rethink your design.

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: Mon Jun 24 09:47:42 EDT 2024

Total time taken to generate the page: 0.01165 seconds