This topic is locked
[SOLVED]

 Button code isnt executed

2/6/2016 5:56:53 AM
PHPRunner General questions
S
snuffi01 author

Hi,
I have an button on an view page witch fire of an soap api request.

If i make an ordinary php file as test.php with following code it does work (the code is executed):



<?php

// global $dal;
// $record = $button->getCurrentRecord();
$soap = new SoapClient("http://ipadress:8070/WebSDK?wsdl"'>http://ipadress:8070/WebSDK?wsdl";);

$req = new stdClass;

$req->clientName = "name";

$req->userAuthenticationInfo = new stdClass;

$req->userAuthenticationInfo->UserDN = '8200-6612';

$req->userAuthenticationInfo->UserID = '82006612';

$req->userAuthenticationInfo->UserPassword = '';
$response = $soap->RegisterClient($req);

$handle = $response->RegisterClientResult;
$req = new stdClass;

$req->clientHandle = $handle;

$req->activeCallHandlingMode = "Standard";

$response = $soap->SetUserActiveCHM($req);
$req = new stdClass;

$req->clientHandle = $handle;

$response = $soap->UnegisterClient($req);

?>


My problem is when i have the same code on "Server" for an button the code isnt executed:


global $dal;
$record = $button->getCurrentRecord();
$soap = new SoapClient("http://ipadress:8070/WebSDK?wsdl"'>http://ipadress:8070/WebSDK?wsdl";);

$req = new stdClass;

$req->clientName = "name";

$req->userAuthenticationInfo = new stdClass;

$req->userAuthenticationInfo->UserDN = '8200-6612';

$req->userAuthenticationInfo->UserID = '82006612';

$req->userAuthenticationInfo->UserPassword = '';
$response = $soap->RegisterClient($req);

$handle = $response->RegisterClientResult;
$req = new stdClass;

$req->clientHandle = $handle;

$req->activeCallHandlingMode = "Standard";

$response = $soap->SetUserActiveCHM($req);
$req = new stdClass;

$req->clientHandle = $handle;

$response = $soap->UnegisterClient($req);


What am i doing wrong?

Sergey Kornilov admin 2/8/2016

You need to check if this code produces any errors. Here is the guide:

http://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm

S
snuffi01 author 2/8/2016



You need to check if this code produces any errors. Here is the guide:

http://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm


Thanks!

When debbugging with Firebug i could see that it was another button on a complete differnent View page that was making this to malfunction.

I deleted the other button on the different page and suddenly it start to function again.

Cant understand why an complete different buttoncode is run when hitting this button, but anyway i'm happy <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=78748&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
/ Kristian