0 Replies Latest reply on Jan 26, 2010 11:23 AM by deltatango

    Portal Row refresh as you type in a field

    deltatango

      Title

      Portal Row refresh as you type in a field

      Post

      I figured out how to make refreshing portal lists based on text input in a field, in case anyone else wants to know here it is. Note, it only works in FM 10

       

      You need to first create a calculation that converts a string from:

       

      text

       

      to

       

      t

      te

      tex

      text

       

      You do this with this function:

       

      1. create a Custom function called IndexWord(Text;Header) [first called with empty header string] 

      Let(

      [

      tCount = Length(Text);

      newHeader = If(Header <> "" ; Header & ¶ );

      NewText = Left(Text;tCount - 1)

      ];

      Case(

      Text = "" and Header = ""; "";

      tCount = 0; Header;

      IndexWord(newText ; NewHeader & Text)

       

      )

       

       

      ) 

       

       

      2. Then, create a calculation field which performs this function on your field that you want to look up, and Index the result.

       

      3. Then make a relation from a global text field to this calculation field on: globalField = CalcField

       

      4.  Once this is done add the portal to your layout and the globalSearch field.

       

      5. create a script with these steps:

      commit records / no dialog

      Go to Field [the globalField] - DO NOT select/Perform

       

      6. Finally, add a script trigger to the global field which runs this script onobjectModify or onkeystroke

       

      Voila - as you type, the list updates   :)