I am trying to add a calendar to a group whenever a new group is created.
The problem is that acs-object doesn't seem to like the fact that due to the transaction, the group_id doesn't really exist.
This makes sense, except that I would think PG would actually create the row and then rollback if it didn't complete. Of course, there is every possibility it is my code ;) pc_group__new returns the acs_object which was generated from the form. This is in team__new()
Here is the relevant code:
v_team_id := pc_group__new (
null,
p_team_code || ''-'' || p_name,
p_context_id,
p_district_id,
''team''
);
-- now create a default calendar
v_calendar_id:= calendar__new (
null, -- calendar_id
p_team_code, -- calendar_name
''calendar'', -- object_type
p_creation_user, -- owner_id
''f'', -- private_p
p_context_id, -- package_id
null, -- context_id
now(), -- creation
v_team_id, -- owner
null -- ip
);