"filtering" between 2 subforms

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

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

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?

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

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.

And use Single Instance codeunit? Best regards from BCN

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

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

I don’t find this propertie in 2.6

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

quote:


Originally posted by stepheng
Hi 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