You can find useful informations here:
custom button
Cristian Gilè:
I had tried that but it took a while to finally figure it out and find that I was not able to get it to write to the second connection and
write the record? There was no example in manual, that I could find. Alexey Kornilov with support@xlinesoft.com replyed to a e-mail telling
me DAL deals with the database tables, not the PHPRunner custom views, so your $tblEvents=... line is wrong and advised me to use: $tblEvents = $dal-Table( "PHPAOVIEW","", "ODBC:PCCRemote"); I still could not get it to work. I thought I found the problem in the Manual. It looked like DAL only works with the Primary connection and not the secondary one which is where my other two tables were at:
I decided because the tables were same name and field were the
same, even though PHPRunner add a 1 to the end of the remote table name that maybe I needed to change the table names and field name to get it to work and it did:
The Project maintains 4 files, two files PHPAOVIEW and TABAOVNAC on my system and two file PHPAOVIEW1 and TABAOVNAC1, are the ones that PHPRunner added the 1 to each table, and are on a remote system. They all have an ODBC connection. The problem was when I update PHPAOVIEW on my system I want it to also save the same record to the PHPAOVIEW1 on the host system and selected it from the list program that had the DAL events it gave no errors and would not write to the remote system
I was trying to use this method because it was all I found when looking for a PHPRunner solution to
enter a key value and retrieve all records and write them to another table or update to another table.
What I understood DAL would do was save record or insert records in another table based on the event of
add or update record in primary table or selected with events to retrieve and insert with PHPRunner connected to multiple databases.
What I did was create two new tables with different name and fields with different name a go to the List page of the file in the Maintenance Program and add a send Button to each row and create a event for Send Record leaving the Client Before empty and adding to the server
function OnServer($params, $result)
{
// Put your code here.
$record = $button->getCurrentRecord();
$result["CLIENTID"]=$record["CLIENTID"];
$result["PHPOVRID"]=$record["PHPOVRID"];
$result["PHPOVTBID"]=$record["PHPOVTBID"];
$result["PHPOVLK"]=$record["PHPOVLK"];
$result["PHPOVURL"]=$record["PHPOVURL"];
$result["PHPOVIMGPATH"]=$record["PHPOVIMGPATH"];
$result["PHPOVNOTES"]=$record["PHPOVNOTES"];
global $dal;
while ( $data = $button->getNextSelectedRecord() ) {
$tblEvents = $dal->Table( "PHPWKVIEW");
$tblEvents->Value["WKCLIENTID"]=$result["CLIENTID"];
$tblEvents->Value["WKOVRID"]=$result["PHPOVRID"];
$tblEvents->Value["WKOVTBID"]=$result["PHPOVTBID"];
$tblEvents->Value["WKOVLK"]=$result["PHPOVLK"];
$tblEvents->Value["WKOVURL"]=$result["PHPOVURL"];
$tblEvents->Value["WKOVIMGPATH"]=$result["PHPOVIMGPATH"];
$tblEvents->Value["WKOVNOTES"]=$result["PHPOVNOTES"];
$tblEvents->Add();
}
$result["txt"] = "Records were updated.";
;
and the event Client After:
function OnClient After(result,ctrl)
{
var message = result["PHPOVRID"] + '<BR>' + result["PHPOVLK"];
ctrl.setMessage(message);
and it wrote to the different table on the host system. I still have to ftp the different table(file) to the remote and
insert or update the records on the remote system. I was hoping to be able to write directly from host system to remote
system updateing the same table with same fields cutting out all the steps of maintaining different table, ftp table and create
insert or update on remote system.
Even thought there are some good examples and the forum is available its too simple and support provides good support but if
more complex you have to pay for added support or figure it out for your self which takes time.
I have used WebSmart PHP from BCD Software for several years but it cost a lot more for all the same features as PHPRunner Enterprise
has so that is why I am making the change.
When I decided to change from WebSmart PHP to PHPRunner, I knew if I ever worked close with someone on
a project there would be more to consider with PHPRunner than with WebSmart PHP.
WebSmart PHP has templates and creates a program with certain functions. Example
page at a time program that will let you add, display, change or delete records.
If I work on a project I would work on one program while someone else might
work on another one. Therefore no problem consolidating all the source etc together
but with PHPRunner it works on the whole project
making it harder to work together since you cannot separate just one program from
another one and combine them easily.
In Websmart PHP it ftp's from the output directory the one program
to the server without any other necessary supporting program, scripts or directories.
but in PHPRunner that is not the case. So one programmer working on part of the same
project would make it difficult to update the server without changing what anyone
else has uploaded.
So when I was searching for an answer to my DAL problem I was trying to solve, the xlinesoft
blog had this information about Best practices: multiple developers working on the same project
and it look like a possible solution. It also pointed out how much more complex PHPRunner
is than WebSmart PHP and to me it meant a lot more capability and that they recognize the
need to support more than on developer working on same project.
[url]http://xlinesoft.com/blog/2011/06/08/best-practices-multiple-developers-working-on-the-same-project/[/url]
Best practices: multiple developers working on the same project
I have got great support for xlinesoft but I need to find some associates that want to work with me.
Have a great day.
James