I’m struggling with something really basic, but I cannot figure out whats wrong.
To demonstrate my problem I have 3 BO’s to create a many-to-many structure:
Company->CompToCont<-ContactPerson
The testdata entered in these 3 BO’s is as follows:
Microsoft -> Microsoft,Rob <- Rob
Oracle -> Oracle,Rob <- Rob
Oracle -> Oracle,John <- John
Oracle -> Oracle,Pierre <- Pierre
If the contactperson "Rob" logs in, I want him to show the company’s where he is working for.
I have a process like this
Find CompToCont WHERE CompTocont.PersonRef=LoggedInContactPerson
///in my example this shows two records in CompToCont (Microsoft and Oracle) and this is right so the CompToCont BO is in the right context.
DISPLAY Company WHERE Company.CompContRef= CompToCont ////This shows me one (????) Companyrecord (Microsoft), but there should be two (Microsoft and Oracle).
I tried also:
DISPLAY Company WHERE Company IN CompToCont.CompanyRef //// this shows me also one record, but it is the second (now Oracle instead of Microsoft)
NOTE: I know it can be done otherwise with Shortcuts, but thats not the case here
What I really want to do is to READ PROTECT the Company BO, so the contact person can only work with the to him assigned Company’s.
So I did this:
Find Comp_Cont WHERE Comp_cont.PersonRef=LoggedInContactPerson
If Company.CompContRef<>Comp_Cont
Then
READ PROTECT Company
Because this was not working, I started to ‘debug’ with DISPLAYing the results and I bumped to the situation above.