# "filtering" between 2 subforms

**URL:** <https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460>\
**Category:** Developers Forum\
**Created:** [August 12, 2003, 2:18pm UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460 "2003-08-12T14:18:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![geoffreyd78](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@geoffreyd78](https://www.dynamicsuser.net/u/geoffreyd78)\
**Post date:** [August 12, 2003, 2:18pm UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/1 "2003-08-12T14:18:45Z")

</div>

Hello, NF2.6 I would to make a window like when you select recipients on outlook. I do that to select some employee I have one form with 2 subforms On main form, I have 2 button with left and right arrow I would that user select some employee on first subform, then click on right arrow, then selected employee are “added” on subform2. If I use a field on table employee, and change this field and filter, I have problem for “concurrent” user I try to use to mark record, but I have problem. Subform1 is markedonly(false), second is markedonly(true) on subform2, I have a function : SetMark(num : Code[10]) SETRANGE(“No.”,num); MARK(TRUE); SETRANGE(“No.”); CurrForm.UPDATE; On right arrow button, I call SetMark function for each employee selected on first subform. But, on second subform, nothing is displayed, why?? How can I correct it, or do the same. When all desired employee are on right subform, I would do a lopp on each, to “send mail” Thx

---

<div class="post-metadata">

**Author:** ![jurica](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@jurica](https://www.dynamicsuser.net/u/jurica)\
**Post date:** [August 12, 2003, 3:18pm UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/2 "2003-08-12T15:18:59Z")

</div>

Try this: It works in 3.60, can’t guarantee for 2.60 Main form (unbound) Subform called LeftForm Subform called RightForm Temporary table called EmpTemp that is copy of Employees table;empty it on opening the main form Create functions caled RefreshMe in both subforms that contain CurrForm.UPDATE; Lets say you’re copying from LeftForm to RightForm: Create function CopyToRight in the LeftForm Globals: Employee Record Employee EmpTemp Record EmpTemp CurrForm.SETSELECTIONFILTER(Employee); IF Employee.FIND(’-’) THEN REPEAT IF NOT EmpTemp.GET(Employee.“No.”) THEN BEGIN EmpTemp.TRANSFERFIELDS(Employee); EmpTemp.“No.”:= Employee.“No.”; EmpTemp.INSERT; END; UNTIL Employee.NEXT=0; In OnPush trigger on main form for Right Arrow button write: CurrForm.LeftForm.FORM.CopyToRight; CurrForm.RightForm.FORM.RefreshMe; The code will check for existing record in right form before copying. Hope this helps, Jurica

---

<div class="post-metadata">

**Author:** ![geoffreyd78](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@geoffreyd78](https://www.dynamicsuser.net/u/geoffreyd78)\
**Post date:** [August 13, 2003, 9:20am UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/3 "2003-08-13T09:20:04Z")

</div>

Globals : EmpTemp Record EmpTemp ?? it’s an error, or it’s impossible in 2.6 I try to do that with temporary table. - temp table on main form - empty on open - add selected employee on temporary table But how can I say to my right subform that they must use my temporary table like sourcetable, and not real table?

---

<div class="post-metadata">

**Author:** ![jurica](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@jurica](https://www.dynamicsuser.net/u/jurica)\
**Post date:** [August 13, 2003, 12:15pm UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/4 "2003-08-13T12:15:34Z")

</div>

> quote:
> 
> * * *
> 
> _Originally posted by geoffreyd78_  
> Globals : EmpTemp Record EmpTemp ?? it’s an error, or it’s impossible in 2.6 I try to do that with temporary table. - temp table on main form - empty on open - add selected employee on temporary table But how can I say to my right subform that they must use my temporary table like sourcetable, and not real table?
> 
> * * *

I’m sorry, my mistake. Table is normal, permanent Navision table. Just open Employee table in design view and choose Save As with number in 50000 range and name EmpTemp. Sorry for not making more sense. Jurica

---

<div class="post-metadata">

**Author:** ![geoffreyd78](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@geoffreyd78](https://www.dynamicsuser.net/u/geoffreyd78)\
**Post date:** [August 13, 2003, 2:59pm UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/5 "2003-08-13T14:59:39Z")

</div>

Ok, But I wouldn’t use a table for that (Money is limited) But I find a solution : left subform based on real table employee on right subform : global emptemp temporary table employee onverride of next and find trigger to read on temporary table. on mainform, right arrow, I call a function of right subform. These function add the specified record into temporary table. And, for other traitement, on right arrow, I write on a second temporary table, global on main subform, to have copy for treatment.

---

<div class="post-metadata">

**Author:** ![AGUSTI](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@AGUSTI](https://www.dynamicsuser.net/u/AGUSTI)\
**Post date:** [August 13, 2003, 5:13pm UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/6 "2003-08-13T17:13:40Z")

</div>

And use Single Instance codeunit? Best regards from BCN

---

<div class="post-metadata">

**Author:** ![geoffreyd78](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@geoffreyd78](https://www.dynamicsuser.net/u/geoffreyd78)\
**Post date:** [August 14, 2003, 2:14pm UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/7 "2003-08-14T14:14:10Z")

</div>

My solution work good. But, what is a single instance codeunit? If I define 2 variable, I think it’s 2 separate instance? How can I make it single instance? I don’t see properties

---

<div class="post-metadata">

**Author:** ![AGUSTI](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@AGUSTI](https://www.dynamicsuser.net/u/AGUSTI)\
**Post date:** [August 14, 2003, 8:06pm UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/8 "2003-08-14T20:06:33Z")

</div>

At codeunit properties, there’s one called SingleIntance (3.01 …). If you activate this property, you can transfer data (variables, records, …) thougt all navision. Crete functions like: - GetVar - GiveFilter Thats ok to transfer information Best regards from bcn

---

<div class="post-metadata">

**Author:** ![geoffreyd78](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@geoffreyd78](https://www.dynamicsuser.net/u/geoffreyd78)\
**Post date:** [August 18, 2003, 7:45am UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/9 "2003-08-18T07:45:10Z")

</div>

I don’t find this propertie in 2.6

---

<div class="post-metadata">

**Author:** ![stepheng](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@stepheng](https://www.dynamicsuser.net/u/stepheng)\
**Post date:** [August 18, 2003, 10:11am UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/10 "2003-08-18T10:11:39Z")

</div>

Hi [WWW.Mibuso.com](http://WWW.Mibuso.com) has a download for this[:)], but it will only work with versions 3.60+ [:(]

---

<div class="post-metadata">

**Author:** ![jurica](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@jurica](https://www.dynamicsuser.net/u/jurica)\
**Post date:** [August 19, 2003, 9:20am UTC](https://www.dynamicsuser.net/t/filtering-between-2-subforms/7460/11 "2003-08-19T09:20:51Z")

</div>

> quote:
> 
> * * *
> 
> _Originally posted by stepheng_  
> Hi [WWW.Mibuso.com](http://WWW.Mibuso.com) has a download for this[:)], but it will only work with versions 3.60+ [:(]
> 
> * * *

Unfortunately, that won’t work even in 3.60 (if you’re thinking of multiple subforms download). I tried to use it, but it is only good for viewing data- subforms are synchronized through OnTimer trigger, and data entry invariably breaks the forms. Jurica
