Filter lookup flowfield.

CrunchCrunch Member Posts: 38
On T27 Item a new field is added: MyField code 10
on T37 Sales Line, I'm trying to make a lookup flowfield to MyField.
I copied the field, and set it as Flowfield, lookup.
Lookup(Item.MyField WHERE (No.=FIELD(No.)))

How can I also filter, so I only get the value, when Sales Line.Type = Item ?
My own guess is the OnLookup trigger.

EDIT:
Onlookup didn't work for me.
Tried this:

IF Type <> Type::Item THEN
MyField := '';

A trigger on the form perhaps?

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Crunch wrote:
    How can I also filter, so I only get the value, when Sales Line.Type = Item ?
    You can't use a Condition in a FlowField, as you can with the TableRelation-property.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • MBergerMBerger Member Posts: 413
    If the client doesn't want to filter or sort on your new field, you could make it a function in T37 instead of a flowfield. Then use that function as the sourceexpression on the form.
  • CrunchCrunch Member Posts: 38
    Thank you for your answers.

    At the moment I do the following on the form on the OnFormat trigger of the ctrl.
    IF Type <> Type::Item THEN
      Text := '';
    

    It works, but still feels somewhat "wrong".
    Might go with the function.
  • SavatageSavatage Member Posts: 7,142
    Why the OnFormat Trigger? Or were you just guessing where to put it?
Sign In or Register to comment.