This topic is locked
[SOLVED]

 Acquiring Field Values In New Button

6/6/2013 4:02:18 PM
PHPRunner General questions
B
bellocs author

Hello,
Using Phprunner 6.
Here's the situation. We have an add page with various fields where the user may enter data. Now we can't use the save button to do an SQL insert into the database, since we need to pass through a SOAP interface for provisioning.
So I delete the default "save" button and added my own button. With that, I added my code in the "Server" section of the buttons custom code, and I'm able to reach the remote SOAP server.
The problem is, I'm unable to get the values added in by the user in the various fieldso on the page, into the "Server" section of the custom button. I'm able to access them through $values in the "Before record added" events page, but in the custom button.
I've looked in the $params that is passed to the OnServer() function but I don't seem to be able to find them there.
Any help would be appreciated.
Thanks

Sergey Kornilov admin 6/6/2013

It depends on where button is added. It works different way on List and View pages for example. On List page it also works different if you add button right to the grid or outside of it.
Where exactly you add this button and what is exact version of PHPRunner?

B
bellocs author 6/7/2013

Hi, I'm using version 6.2, enterprise edition.
As for where the button is. It's in an Add Page, replacing the "Save" button set by default.

Sergey Kornilov admin 6/7/2013

For this type of action simply use BeforeAdd event and put your PHP code there. Makes things much simpler.