Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have 3 tables
Customer ( Codcli: code of customer, Descli: description of Customer)
Codcli | Descli |
---|---|
a | AA |
b | BB |
c | CC |
xx | yy |
Contract ( Codcon: codd of Contract, Codcli: code of Customer)
Codcon | Codcli | flag |
---|---|---|
CCC | c | 1 |
zz | xx | 0 |
Tree(Codcli:code of customer, sup: Code of superior element)
Codcli | sup |
---|---|
a | c |
b | xx |
xx | a |
c | 0 |
is a tree structure
c
|
|------a
|
|------xx
|
|_____b
I need to implement a function that verify if the Customer have a contract:
If a Customer have contract in the table contract, I must take his contract, if he don't have contract I must to take the contract of
this superior element that have flag=1. So if Customer b don't have a contract, I cannot take a contract of the Customer xx, but I must take the contract
of c that have flag=1.
Should I use a Macro ?
Can I find the contract in Load Script?
Can you give me a suggest?
Thanks
Hi,
Find the attached file, hope it helps you.
Regards,
Jagan.
Hi
Jagan thank you for your answer, but I must to have this situation
Customer ----> Contract
c ---------> CCC (OK)
a ----------> CCC (OK)
xx ------------> zz (OK)
b --------------> CCC (KO because b take contract of c Customer)
I will study your resolution
Regards
Oronzo