Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.NetCreateAvailabilityContactEvent ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create procedure "pears"."NetCreateAvailabilityContactEvent"( in "pWebUserID" char(20) default null, in "MessageText" long varchar ) result( "result" char(50) ) // iqxWEB begin declare @PersonID char(20); declare @ClassCode char(20); set @PersonID = "NetCandidateValidPersonID"("pWebUserID"); set @ClassCode = (select "WPKMaintainGetSwitchValue"('AVAILCHECKCONTEVENT','','L')); insert into "contactevent"( "contacteventid","personid","staffid","contactdate","contacttime","description","classcode","who","notes","DivisionID" ) values ( "uniquekey"(@PersonID), @PersonID, "userstaffid", current date, current time, (if "len"("MessageText") >= 20 then "left"("MessageText",20)+'...' else "MessageText" endif), @ClassCode, 'A', "MessageText", (select "DivisionID" from "staff" where "staffid" = "userstaffid") ) ; select '0:~success' end /* DOC 2020-03-16 GJ Added auto contact even creation when adding availability. Creates contact events */ /* TEST */ go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetCreateAvailabilityContactEvent" IS {create PROCEDURE pears."NetCreateAvailabilityContactEvent"( in "pWebUserID" CHAR(20) DEFAULT NULL, in MessageText LONG VARCHAR ) RESULT( "result" CHAR(50) ) // iqxWEB BEGIN DECLARE @PersonID char(20); DECLARE @ClassCode char(20); SET @PersonID=NetCandidateValidPersonID(pWebUserID); SET @ClassCode=(SELECT WPKMaintainGetSwitchValue('AVAILCHECKCONTEVENT', '', 'L')); INSERT INTO contactevent (contacteventid, personid, staffid, contactdate, contacttime, description, classcode, who, notes, DivisionID) VALUES ( uniquekey(@PersonID), @PersonID, userstaffid , CURRENT DATE, CURRENT TIME, (IF len(MessageText)>=20 THEN left(MessageText, 20) + '...' ELSE MessageText END IF), @ClassCode, 'A', MessageText, (SELECT DivisionID FROM staff WHERE staffid = userstaffid) ); SELECT '0:~success'; END /* DOC 2020-03-16 GJ Added auto contact even creation when adding availability. Creates contact events */ /* TEST */ } </code> database/procedures/pears_netcreateavailabilitycontactevent.txt Last modified: 2026/08/07 19:24by 127.0.0.1