Boyum Validation Macro to Copy to A UDF Form

Carla van Zyl

Hi, 

I am trying to automatically calculate by Freight portion based on the KG on PO. 

I did a line Loop to Sum the KG in $[$BOYX_15.0.NUMBER] . I am struggling to know how to multiply the figure in $[$BOYX_15.0.NUMBER] with 0.16 and transfer the result to Transport  (Form 3007,Item 3, Column 3, Row 53) and Negative result to Transport (-) (Form 3007,Item 3, Column 3, Row 54). 

Any advice on how this can be done. Is it at all possible with macro? 

Comentarios

6 comentarios

  • Comment author
    Geoff Booth

    You should be able to use the Final Result UF to calculate the values using $[LLRESULT.NUMBER] (see Boyum Help); Open form 3007 and then Set the value.

    If you have troubles post your UF so we can review it.

    0
  • Comment author
    Carla van Zyl
    • Editado

    Hi Geoff Booth

     

    So I did a line loop and tried to run a macro to set values. 

    SET($[$BOYX_15.0.NUMBER]|$[LLRESULT.NUMBER]);   //Copy Line Loop value to field

    $[LLRESULT.NUMBER] *0.16 =@store2;   //Multiply kg and set as pos variable

    $[LLRESULT.NUMBER] *-0.16=@store3;     //Multiply kg and set as neg variable

    Activate($[$3.0.0]);                    //Open Form 3007

    Set($[$3.254000045.0]|@store2);        //Row 53 - Pos Value

    Set($[$3.254000045.0]|-@store3);   //Row 54 - Neg Value

    ClearAllStoreValues();

     

    I think My main issues are still: How do I get a specific syntax for my Form 3007? As the values needs to be set as a positive and negative in Row 53 and Row 54

    0
  • Comment author
    Geoff Booth

    Use:  Click(91);   // This will "click" the golden arrow beside the Freight field to open form 3007

    Row 53 and 54 seems very strange to me. Do you really have 54 rows in the table. Please add a screenshot of Form 3007 is you need additional help.

    0
  • Comment author
    Carla van Zyl

    Hi Geoff Booth 

    Please see below the screenshot. I am trying to set the last and second last row. I would prefer not to do a line loop but when I try to set the macro gives me the error: 

    Click(91);

    Set($[$3.254000045.0.LAST]|$[$BOYX_15.0.NUMBER]*0.16);

    Set($[$3.254000045.0.LAST-1]|$[$BOYX_15.0.NUMBER]*-0.16);

     

     

    0
  • Comment author
    Geoff Booth

    Try the following

    @STORE3 = SQL(Select TO_Decimal($[LLRESULT.NUMBER] *0.16));   //Multiply kg and set as pos variable

    @STORE4 = SQL(Select TO_Decimal($[LLRESULT.NUMBER] *0.16*-1));   //Multiply kg and set as neg variable

    MessageBox(Pos: @STORE3          Neg: @STORE4); // Display values for testing only

     

    Set($[$3.254000045.0.LAST]|@STORE3);

    Set($[$3.254000045.0.LAST-1]|@STORE4);

     

    0
  • Comment author
    Carla van Zyl

    Hi Geoff Booth

    Thanks for all your help. I was able to calculate and set the amount. Thanks for All you help!!

    @STORE3 = $[LLRESULT.NUMBER] * 0.16;   // Multiply kg and set as pos variable @STORE4 = $[LLRESULT.NUMBER] * 0.16 * -1;   // Multiply kg and set as neg variable  Click(91);

    Activate();

    Set($[$3.254000045.0.LAST]|@Store4);

    Set($[$3.254000045.0.LAST-1]|@STORE3)

    Click($[$1.0.0]);

    Close(91);

     

    0

Iniciar sesión para dejar un comentario.