Retrieving column datatypes

As SmartList works with a SmartList object, it must be told what type of data is found in each column. The Explorer_Get_Datatype procedure will be called by SmartList to perform this action. In this procedure, you will set the datatype for each column you added to the new SmartList object.

The following is the Explorer_Get_Datatype procedure that retrieves the column datatypes for the columns added to the Leads SmartList object. Note the else clause of the case statement. This is necessary so that the “Any Field” search feature of SmartList works properly.

Procedure name: Explorer_Get_Datatype

 

inout integer IO_Datatype;
in integer IN_Object_Dict_ID;
in integer IN_Object_Type;
in integer IN_Field_Dict_ID;
in integer IN_Field_ID;

if IN_Object_Dict_ID = IG_PROD_ID then
	if IN_Object_Type = SMARTLIST_OBJECTTYPE_LEADS then
		case  IN_Field_ID
			in [resourceid(field 'Lead ID')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			in [resourceid(field 'Lead Name')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			in [resourceid(field 'Lead Business Category')]
				IO_Datatype = SMARTLIST_DATATYPE_DDL;
			in [resourceid(field 'Potential Revenue')]
				IO_Datatype = SMARTLIST_DATATYPE_CURRENCY;
			in [resourceid(field 'Contact')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			in [resourceid(field 'Address 1')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			in [resourceid(field 'Address 2')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			in [resourceid(field 'City')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			in [resourceid(field 'State')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			in [resourceid(field 'Zip')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			in [resourceid(field 'Phone 1')]
				IO_Datatype = SMARTLIST_DATATYPE_PHONENUMBER;
			in [resourceid(field 'Phone 2')]
				IO_Datatype = SMARTLIST_DATATYPE_PHONENUMBER;
			in [resourceid(field 'Fax')]
				IO_Datatype = SMARTLIST_DATATYPE_PHONENUMBER;
			in [resourceid(field 'Salesperson ID')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			in [resourceid(field 'Qualified Lead')]
				IO_Datatype = SMARTLIST_DATATYPE_DDL;
			in [resourceid(field 'Qualification Date')]
				IO_Datatype = SMARTLIST_DATATYPE_DATE;
			in [resourceid(field 'Lead Source')]
				IO_Datatype = SMARTLIST_DATATYPE_STRING;
			else
				{The "Any" field case for searching}
				IO_Datatype = SMARTLIST_DATATYPE_ALL;
		end case;
	end if;
end if;


Documentation Feedback