Yup, you should be able to do this. No problem.
If you created an "Easy Calendar" make sure to convert it to a "SQL Calendar" (the option will be on the sidebar) so that you can specify your SQL with a union.
I should have added, add your page number as a column in your SQL (for example PAGE_ID) then use the #PAGE_ID# substitution for the Page when you specify the link. Then you can use the correct ID also in the parameters. You may need to specify the item that's receiving the parameter also.
select 1 page_id , 'P1_ID' ITEM , pk1 PK_VALUE , date1 calendar_date , description1 desc from table1 union all select 2 page_id , 'P2_ID' ITEM , pk2 PK_VALUE , date2 calendar_date , description2 desc from table2
Then #ITEM# is the name of the item that receives the PK, #PK_VALUE# is always the ID that needs to come up on the destination page.
Thanks for your help Jorge.
Now I can call Page1 and Page2 by PAGE_ID, but if I cange the field name of Page1 from P1_PK_ID_TABLE1 in PK_ID and the field name of Page2 from P2_PK_ID_TABLE2 in PK_ID (same of Page1), I have this error:
- Item name is already used by another application or page item.
You can leave the items with unique names P1 as P1_PK_ID_TABLE1 and P2_PK_ID_TABLE2 for P1. I suggest you place those item names in your SQL as the name of the item ("ITEM" column in the sample SQL I posted previously)
Then in the calendar when you define the link the "Set These Items" will use #ITEM# and the "With These Values" will say #PK_VALUE# (or whatever name you gave the PK column in the SQL.
Hope this helps
Sorry but I don't understand.
This is my SQL statement:
select '20' as ID_PAGE, A.PK_ID_APPEL as PK, A.TXT_SUJET as TXT, A.DAT_APPEL as DAT
from TBL_APPELS A
select '10', T.PK_ID_TACHE, T.TXT_TACHE, T.DAT_DEBUT_TACHE
from TBL_TACHES T
order by 4
The pages are 10 and 20 (IdPage) and I can call with #ID_PAGE#, I can also use #PK# for the parameter “With these values”, but how can I write the parameter “Set these items” if I have two different names in the two pages (Calendar attributes section>Column link)?
What I'm suggesting is that you add one more column to the SQL with the name of the destination item. So, one will be on p10 the other on p20
select '20' as ID_PAGE, A.PK_ID_APPEL as PK, A.TXT_SUJET as TXT, A.DAT_APPEL as DAT , 'P20_ID' item from TBL_APPELS A union select '10', T.PK_ID_TACHE, T.TXT_TACHE, T.DAT_DEBUT_TACHE , 'P10_ID' item from TBL_TACHES T order by 4
Then on the "Set these items" you reference the COLUMN (#ITEM#) from the SQL and not the name of the item.
It was very easy to understand....after reading....