Community

fls Custom Function

Hi to all

Is there any way to define a custom function in flexilayout studio?

I need to calculate a value in the presearch script and i ended up to copy my calculation script on each element i need it. It would be very helpfull if there is a user defined function in order to call from one place.

The best close senario i found is to give my parameters to an sql command and call a store procedure from my db. This way i can use the sp as a calculation function role but it is not ideal to call the db for every calculation.

Any Suggestion?

0

Comments

3 comments

  • Avatar
    DusanS

    Hi!

    You can use external fields for that.

    Example:

    First Declare variable in ExternalFields in the element where you would like to store calculation Header.StaticText for example:

    Int OwnCalculation = 0;

    Then do calculation in Advanced Pre-Search Relations

    OwnCalculation = 1 + 1;

     

    Later you can refer to that calculation from other elements (pre-search, post-search) like this

    Int ExistingValue = Header.StaticText.OwnCalculation;

     

    Regards,

    Dusan

    0
    Comment actions Permalink
  • Avatar
    pfotisgr

    Hi Dusan

    Thanks for the answer.

    The problem is that the calculation needs input from any later element that i am using, thats why i need a function.

    What i am already doing is this, to repeat all the calculation script in advanced pre-search relations.

    It will be helpful to refer to cantralized function for better maintanance.

    0
    Comment actions Permalink
  • Avatar
    DusanS

    Hi pfotisgr

    then DB approach would be OK for you

    It is possible to call the procedure from your DB

    Regards,

    Dusan

    0
    Comment actions Permalink

Please sign in to leave a comment.