Use of Palo_Subset in PHP Macro Editor

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Use of Palo_Subset in PHP Macro Editor

    Hi Guys,

    i'm trying to build a useable controlling application with Palo Web for a Student Project (my Bachelor Thesis), but the more i try, i go to it's limits-
    It seems sometimes a bit unstable and slow, but i have 2 concrete problems regarding the PHP Macro Functions.:

    First of all:
    Is there a way to enable error messages for the php Macro code ? Just something that tells me in which line the program breaks up.?
    At the moment it's very difficult for me to find out where in my macro code i made a mistake.
    There are 2 cases:
    first one: my macro does well and the code executes or
    second case: my macro does not work and nothing happens.
    But sometimes i write macro code which does something in the background and i don't see so easy if it has worked or not.
    I always have to insert a kind of check manually - for example writing a value like "it works" into a cell. If this executes - i know the macro worked.

    But if it's not working it's really diffucult to find the mistake. i have to uncomment parts of my code manually to check which is working - and which not.

    All at all i feel transported back to the stone age of programming. The macro editor doesn't even help me closing brackets and so on.

    OK, enough complainment :)

    My 1. concrete Question is: Is there a more comfortable way of writing macros, and is there a way to enable error logging to show me in which line of code the macro breaks up?


    My Second Question/Notice - (maybe a Bug?):

    I want to use the PHP palo_subset() directly into my Macro Code.
    The big problem is, that once i call this function my Palo Web crashes completely. The PaloSuiteCoreService process stops (really ends / is killed) and i have to start it again.
    I tried different way of the parameters but nothing helps.

    I also tried out the sample code out of the SDK Doc:

    function test(){

    // define the constants
    define('CONN', 'LOCALHOST');
    define('HOST', '127.0.0.1');
    define('PORT', '7777');
    define('USER', 'admin');
    define('PASS', 'admin');

    // registers a name for a PALO server
    $connection = palo_register_server(CONN, HOST, PORT, USER, PASS);

    // create the filter as follows
    $hfilter = palo_hfilter("Stationary PC's",FALSE,FALSE,2,NULL,NULL,NULL,2,3);
    $tfilter = palo_tfilter(array("D*"),false);
    $afilter = palo_afilter(array(2,1,"Price Per Unit",">500000"));
    $subcube = palo_subcube("Sales",NULL,"Germany","Jan","2005","Budget",
    "Gross Profit");
    $dfilter = palo_dfilter($subcube,array(">","5000"),5,NULL,NULL,0);
    $picklist = palo_picklist(array("Notebook SX","Notebook GT","Notebook LXC"
    ,"Notebook TT","Notebook SL","Subnote SL",
    "Subnote XK"),0);
    $palo_sort = palo_sort(1,0,NULL,0,NULL,2,1);


    // subset function with all filter possibilities
    palo_subset(CONN . '/' . "Demo", "Products", 1, NULL, $dfilter, $afilter,
    $picklist, $hfilter, $tfilter,$palo_sort);

    }


    Could it be that this is a bug ? I really would find it nice if you try to reproduce the problem on your machine (just with the sample code).

    I know that there is another way of using the palo_subset function, just by writing =palo.subset(...) into a cell and fetching the result. But that's far away from clean code i think, and also not that performant.


    Any help is very appreciated . Thanks in advance.
    You can answer also in german if you like to (i'm german too :)).

    Greets Christian