Our customer has a lot of company, and each company has a lot of site.
The administrators of the system would like to filter on lobby pages directly all sites from one company.
So the idea is to filter a company, which will search all sites connected to filter with these sites.
Is it possible to do this ?
Thank you in advance
Version : V10
Best answer by JohanLindstrom
Where do you find the “&AO.SITE” in your request ?
If I look on the system info on the site menu, I find this :
It will help me for other request.
You can find it in Sites Analysis (Application Base Setup - Enterprise - Site > Sites Analysis
I think I was not clear because it is possible to filter with multiples site in the lobby page.
With the formula given by Ashok in this topic, it works :
AND CONTRACT IN ( select regexp_substr('$SITE$','[^,]+', 1, level) from dual connect by regexp_substr('$SITE$', '[^,]+', 1, level) is not null )
My concern is to combine the filters with the conditions I wrote in my previous reply.
I don’t have much experience with regexp but try the following:
CONTRACT IN (SELECT CONTRACT FROM &AO.SITE WHERE COMPANY LIKE NVL('$COMPANY$','%') AND (CONTRACT LIKE NVL('$SITE$','%') OR CONTRACT IN ( select regexp_substr('$SITE$','[^,]+', 1, level) from dual connect by regexp_substr('$SITE$', '[^,]+', 1, level) is not null )))
It should allow you to select multiple sites.
Or leave site and/or company empty which would select all sites/companies that the user is connected to
We have 2 companies with multiples sites associated :
C1
S1
S2
S3
S4
C2
S5
S6
S7
S8
In the lobby, the goal is to filter with all sites from C1. At the moment, our customer has to :
Filter with the first site, write the result and so on with the other sites
With another SQL formula, he can write in his filter “S1,S2,S3,S4” and it will work but it is not a solution because they do not want to write all sites each time they come the lobby
So the idea is to have like you show a filter “Company” but in the SQL condition, it will find all sites associated to this company to make the filter. Because the field “Company” is most of the time not available in the logical unit from the lobby element.
For instance :
I want to see my customer orders from all sites of the company C1.
The idea is to write “C1” in the “Company” filter and it will search all customers orders from sites S1,S2,S3 and S4.
Basicly it is possible. But in some views or tables you haven’t the column Company or Site (also Contract). In this case maybe you can use APIs if exist or create an IAL.
This means you need the columns Company and Contract in the view which you need for your lobby data source. And you need this structure for all lobby elements.
In additional you can use the API IFSAPP.COMPANY_SITE_API.Get_Company (CONTRACT) to fetch the company of a site if you haven’t the column company but the site.
Where do you find the “&AO.SITE” in your request ?
If I look on the system info on the site menu, I find this :
It will help me for other request.
You can find it in Sites Analysis (Application Base Setup - Enterprise - Site > Sites Analysis
I think I was not clear because it is possible to filter with multiples site in the lobby page.
With the formula given by Ashok in this topic, it works :
AND CONTRACT IN ( select regexp_substr('$SITE$','[^,]+', 1, level) from dual connect by regexp_substr('$SITE$', '[^,]+', 1, level) is not null )
My concern is to combine the filters with the conditions I wrote in my previous reply.
I don’t have much experience with regexp but try the following:
CONTRACT IN (SELECT CONTRACT FROM &AO.SITE WHERE COMPANY LIKE NVL('$COMPANY$','%') AND (CONTRACT LIKE NVL('$SITE$','%') OR CONTRACT IN ( select regexp_substr('$SITE$','[^,]+', 1, level) from dual connect by regexp_substr('$SITE$', '[^,]+', 1, level) is not null )))
It should allow you to select multiple sites.
Or leave site and/or company empty which would select all sites/companies that the user is connected to