Load combobox values after changing another combobox

    Load combobox values after changing another combobox

    Hi,

    For an allocation procces I have to fil a reference table with Costcenters.
    This can be done by a form where you can change the name, and the attributes.

    However there are some attributes where only predefined values are allowed. This can be values from a list or values from another dimension within the database. So I made some comboboxes with the predefined values. so far so good.
    For costcenter xx You can chage attribute a with the combobox

    But now for me the difficulty:
    If I choose costcenter zz with the combobox, attribute a is overwritten with the value from costcenter xx.
    How can I change the default value of the combobox after changing the costcenter?

    Hope anyone can help me with this.
    Oke I found the solution (Thanks noelgaur for the hint):

    1. Define a variable in the depending combobox

    2. In the leading combobox add a macro like:

    function Update_Cmb_attributes ()
    {
    //load variables and names
    $s = activesheet();
    $Connection = ActiveWorkbook()->names->item('Connection')->value;
    $Costcenter = retrieve_variable('Costcenter');

    //set variables for the depending combobox

    define_variable("...name variable...", application()->PALO_DATA($Connection,'#_Costcenter','...Attribute....',$Costcenter));
    }

    Now the depending attribute is changed by the leading combobox

    3. Last but not least you have to add a macro for the depending combobox so that the change is written to the cube (or do it with set.data in the report.)

    function Attrib_setdata ()
    {
    $s = activesheet();
    $Connection = activeworkbook()->names->item('Connection');
    $Costcenter = retrieve_variable('Costcenter');

    $Update_value = retrieve_variable('....Variable from depending combobox...');
    application()->PALO_SETDATA($Update_value, false, $Connection,'#_Costcenter','.. Attribute name....',$Costcenter);
    }

    Only the palo_setdata is not working



    Kind regards,

    Martjan wrote:


    application()->PALO_SETDATA($Update_value, false, $Connection,'#_Costcenter','.. Attribute name....',$Costcenter);
    }

    Only the palo_setdata is not working


    if I remember well you have to add the begin_calculation before launching the palo_setdata statement in order to make it work:

    Source Code

    1. application()->begin_calculation;
    2. application()->PALO_SETDATA($Update_value, false, $Connection,'#_Costcenter','.. Attribute name....',$Costcenter);
    3. application()->end_calculation;


    but I am not sure of it yet
    laloune

    Post hoc, non est propter hoc