Very simple question : filter table based on a textbox value

SeeryxSeeryx Member Posts: 23
hello,

I begin to learn CAL with Nav 2009R2. So, apologies for my simple questions. :)

I have a form with a subform.

On the main form, I have a field "No." Below the main form, I created a textbox where I extract a part of the value of the field "No."
For example "No." has a value of CP0456. In the textbox called New No., I retrieve all letters in oder to obtain a string like that 0456.
What I want to do is to filter the subform (a field called CRCODE) with the value of the field New No. in a way like @*New No. *
So, when I move to another record, the subform is updated and filtered.

I supposed it is pretty simple but I have very basic knoledge in CAL so if you can give me some advices, it could be cool.

Thanks :D

Comments

  • vijay_gvijay_g Member Posts: 884
    Where you placed the code to calculate new no. field value and from which trigger you are calling subfom to set the filter?
  • SeeryxSeeryx Member Posts: 23
    Hi,

    I created a function on the subform but this function is off course available from the main form :
    CurrentRecord := DELCHR("No.",'<>','CPR');
    IF STRLEN(CurrentRecord) >= 5 THEN
      NewString := DELSTR(CurrentRecord,1,1)
    ELSE
      NewString := CurrentRecord;
    

    I apply the function in the OnaftergetRecord trigger.

    For the filter, I didn't place any filter code in any trigger for the moment because I don't know exactly how to do it.
  • vijay_gvijay_g Member Posts: 884
    Seeryx wrote:
    For the filter, I didn't place any filter code in any trigger for the moment because I don't know exactly how to do it.

    Then what is this..?
    Seeryx wrote:
    when I move to another record, the subform is updated and filtered.
  • SeeryxSeeryx Member Posts: 23
    Sorry. For the moment the subformLink properties is set to : Field2=FIELD(No.)
    So yes, it is filtered but not in the way I want.

    7580b219949aa4b001092da76639c.jpg

    What I want is to filter the subform with the value of my textbox but adding the filter @*value of textbox* on the field CRCODE, it is clear ?
  • SeeryxSeeryx Member Posts: 23
    Here is a screenshot of the form with explanations :

    6d229915c9a40f5bac84701c9e21f.jpg
Sign In or Register to comment.