This topic is locked

Copy record from REST view to database database table

3/11/2022 7:33:31 AM
PHPRunner General questions
C
CTom author

I am struggling with a button which copies a record displayed in a rest view to a database table.

The code below is throwing an error: Fatal error: Call to a member function buildSQL_default() on null in /hom.../classes/button.php on line 163

$record = $button->getCurrentRecord();
$data["idp"]=$record["id"];
$data["mas"] = $record["mas"];

Any tips about how to deal with this task?

Thank you.

C.

C
CTom author 3/12/2022

In fact, the button does not work even for a simple insert of values, throwing the same error.

It looks like basic button actions are not handled in the rest view pages.

fhumanes 3/13/2022

Hello,

My example is quite different but what it does is recover from an API Resfull JSON service, and insert all the information on table. For this, do not use the implementation of Phprunner.

https://fhumanes.com/blog/integracion/app-phprunner-cliente-restfull-api/

Greetings,
fernando

C
CTom author 3/18/2022

Thank you very much.

Catalin