Relationship problem

roshanthaparoshanthapa Member Posts: 90
I am a bit confused. Please enlighten me regarding this issue of relationship

For example, we have these tables

media type, media and media rate tables. That means three tables with names media type, media and media rates.

Now, attributes:

Medt-1, Medt-2, Medt-3 for media type table.
Med-1, med-2, Med-3 for media table.
medr-1, medr-2 for media rate.

I want to show the "media type" table's list from the field called "medr-2" of the table called "media rate". But the condition is
medr-1 should be equal to med-2 i.e. medr-1=med-2 and
the list should be shown for all the records where medt-2 are less than med-2 i.e. medt-2<med-2.


Please enlighten me if I can do that form table relation property. If not, from the code.

Comments

  • roshanthaparoshanthapa Member Posts: 90
    Question redefined.......

    I am a bit confused. Please enlighten me regarding this issue of relationship

    For example, we have these tables

    media type, media and media rate tables. That means three tables with names media type, media and media rates.

    Now, attributes:

    Medt-1, Medt-2, Medt-3 for media type table.
    Med-1, med-2, Med-3 for media table.
    medr-1, medr-2 for media rate.

    I want to show the "media type" table's list from the field called "medr-2" of the table called "media rate" on lookup that means by setting relationship. But the condition is
    medr-1 should be equal to med-2 i.e. medr-1=med-2 and
    the list should be shown for all the records where medt-2 are less than med-2 i.e. medt-2<med-2.


    Please enlighten me if I can do that form table relation property. If not, from the code.
  • ufukufuk Member Posts: 514
    You can use Conditon property in TableRelation for static values. But if this fields change then you have to edit the conditon property. For constant values you can use const and you can use filter option with wildcards(*,<,> etc.) But in the table relation property the called field must be a member of primary key.

    By code you can write something like that:
    IF Media.Med2 = MediaRate.Medr1 THEN
      MediaType.SETFILTER(Medt1,'<%1',Media.Med2)
    

    Regards.
    Ufuk Asci
    Pargesoft
Sign In or Register to comment.