Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Autofilling fields from one module to antoher
#1
This one took me some time to figure out, and in the end it was dead-simple:

Let's say you want to create a module, of which the records can be created using an entry from another module as the starting point. So you create an action link in the source module's action column that includes the record ID from that source module in the query params.

Now you have a UI10 field in your new module that needs to be filled out with that record. Just edit "CreateView.php" in your new module and add:

PHP Code:
if (isset($_REQUEST['source_id']) && $_REQUEST[source_id'] != '') {
 $focus->column_fields['
your_module_column_name'] = $_REQUEST['source_id'];


Before the smarty BLOCKS are assigned. This will take care of the rest. The source_id is your query param, the columnname is the field/column name in your new module, where you want the link to take place.

Hope this helps someone.
Reply
#2
In fact, it is even easier than that. Try putting the destination field directly in the action URL, like this:


Code:
..&your_module_column_name=$RECORD$

that should fill in the field for you directly.

In general you can set the value for any field on the module when creating by setting it's value in the URL
Joe
TSolucio
Reply
#3
Nice!
Reply
#4
You can even take this a step further with (Field) Mapping Business Mapping
http://corebos.org/documentation/doku.php?id=en:adminmanual:businessmappings:mapping
Joe
TSolucio
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)