Report 1 should have cid column selectable and pass cids to Report 2 and refresh Report 1 after update. But the Submit button is not showing up in Report 1. Is there something wrong that we do?
Report 1
CREATE PROCEDURE `sp_DBR_appt_test`()
BEGIN select 'dbr.hidecolumn','aid','TID';
select 'dbr.selectable','cid';
select 'dbr.resultclass','Teams'; SELECT
a.`cid` 'cid',
a.aid,
IF(
a.`TM Name` IS NULL, 'Assign', a.`TM Name`
) as 'TM Name[vName]',
a.`TM Id` as 'TID',
if(T_Date IS NULL, 'New', 'Edit') 'Appointment',
convert_tz(T_Date, '+00:00', '-07:00') as 'Date[sdate]:type=datetime',
a.sugar_meeting_status as 'Status[Status]',
a.`Company Name` 'Company',
a.`Name`,
a.`C Street` 'Contact Street',
a.`C City` 'Contact City',
a.`C State` 'Contact State',
IF(b.Team IS NULL, '', b.Team) 'Reporting',
a.`Title`,
a.`Department`,
a.`Reports To`,
a.`Email Address`,
a.`Work Phone`,
a.`Street` 'Company Street',
a.`City` 'Company City',
a.`State` 'Company State',
a.sugar_meeting_id
FROM
db2.sales_list a
left join (
select
`Reports To`,
count(cid) 'Team'
from
db2.sales_list
where
`Reports To` IS NOT NULL
group by
`Reports To`
) as b on b.`Reports To` = a.`Name`
WHERE
MATCH(a.Title, a.department) AGAINST (
'manager director sales technical application -project -account -consult -consultant -exec -executive -specialist -architect -program -engineer -planning -marketing -channel -representative -representitive' IN BOOLEAN MODE
)
AND (
a.`C State` IS NOT NULL
AND a.`State` IS NOT NULL
)
limit
10; select 'dbr.button','Submit';
select 'dbr.report','sp_DBR_sales_appt_multi_update','dynamic_div[]','vcid=cid.Teams';
SELECT 'dummy result set for the button';
Report 2
CREATE PROCEDURE sp_DBR_sales_appt_multi_update(vcid text)
BEGIN
Declare vuid varchar(36) Default uuid(); insert into global_gm_merged.meetings (id,name,date_entered,date_modified,modified_user_id,created_by,description,deleted,assigned_user_id,location,duration_hours,duration_minutes,date_start,parent_type,status,parent_id) values (vuid,'AT&T Road Show',now(),now(),vtmid,vtmid,'AT&T Road Show','0',vtmid,'','0','0',convert_tz(vstart,'-07:00','+00:00'),'Contacts',vcstatus,vcid); insert into db1.meetings_contacts (id,meeting_id,contact_id,accept_status,date_modified,deleted) values(uuid(),vuid,vcid,vcstatus,now(),0);
insert into db1.meetings_users (id,meeting_id,user_id,required,accept_status,date_modified,deleted) values(uuid(),vuid,vtmid,'1',vcstatus,now(),0);
update db2.sales_list set sugar_meeting_id=vuid,T_Date=convert_tz(vstart,'-07:00','+00:00'),sugar_meeting_status=vcstatus where find_in_set(cid,vcid);
select 'dbr.refresh';
END