pears.GetContactEventCaption

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."GetContactEventCaption" IS 
{CREATE FUNCTION GetContactEventCaption 
 
/* Application Maintained Function / Procedure - DO NOT EDIT*/
 
(IN @ContactEventID CHAR(20))
RETURNS CHAR(250)
BEGIN
  DECLARE @Caption CHAR(250);
  DECLARE @PersonID CHAR(20);
  DECLARE @VacancyID CHAR(20);
  DECLARE @PlacementID CHAR(20);
  DECLARE @ProgressID CHAR(20);
  DECLARE @EmploymentID CHAR(20);
  DECLARE @CompanyID CHAR(20);
  DECLARE @CompanyName CHAR(100);
  DECLARE @ApplicantName CHAR(100);
  DECLARE @PositionName CHAR(100);
  DECLARE @ContactName CHAR(100);
  DECLARE @PlacementTerminology CHAR(20);
  SELECT PersonID,VacancyID,PlacementID,ProgressID,EmploymentID,cname,cpname,pname,POSITION,WPKMaintainGetSwitchValue('PLACNAME','Global','L') INTO @PersonID,
    @VacancyID,@PlacementID,@ProgressID,@EmploymentID,@CompanyName,@ContactName,@ApplicantName,@PositionName,
    @PlacementTerminology FROM ContactView WHERE
    ContactView.ContactEventID = @ContactEventID;
  CASE
  WHEN @ProgressID IS NOT NULL THEN
    SET @Caption=string(@ApplicantName,' progress re. ',@PositionName,' for ',@CompanyName)
  WHEN @PlacementID IS NOT NULL THEN
    SET @Caption=string(@ApplicantName,' ',@PlacementTerminology,' as. ',@PositionName,' for ',@CompanyName)
  WHEN @VacancyID IS NOT NULL THEN
    SET @Caption=string(@CompanyName,' - ',@ContactName,' re. ',@PositionName)
  WHEN @EmploymentID IS NOT NULL AND @PersonID IS NOT NULL THEN
    SET @Caption=string(@CompanyName,' - ',@ContactName,' re. ',@ApplicantName)
  WHEN @EmploymentID IS NOT NULL AND @PersonID IS NULL THEN
    SET @Caption=string(@CompanyName,' - ',@ContactName)
  WHEN @EmploymentID IS NULL AND @PersonID IS NOT NULL THEN
    SET @Caption=string(@ApplicantName)
  END CASE
  ;
  RETURN @Caption
END
}
  • database/procedures/pears_getcontacteventcaption.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1