Go To items

Go To items in SmartList provide quick navigation to the windows in the accounting system that allow you to view of modify the selected item. You can add additional Go To items to new SmartList objects you create.

Adding Go To items

Use the Explorer_Add_GoTo_Item procedure in the SmartList dictionary to add the Go To items. When you add a Go To item, you specify the following:

 

The following procedure from the sample integrating application that adds the Go To items for the Leads SmartList object created by the sample. Notice how the separator item is added to the list.

Procedure name: SmartList_CreateLeadObjectGoto

 

local integer l_error;
local string l_message;

call with name "Explorer_Add_GoTo_Item" in dictionary SMARTLIST,
	IG_PROD_ID,
	SMARTLIST_OBJECTTYPE_LEADS,
	"View",
	IG_PROD_ID,
	resourceid(form IG_Lead_Maintenance), {Unique ID for this form}
	true, {Will be the default Go To item}
	l_error;
if l_error <> OKAY and l_error <> DUPLICATE then
	set l_message to getmsg(22002);
	substitute l_message, "Explorer_Add_GoTo_Item", str(l_error);
	error l_message;
end if;

call with name "Explorer_Add_GoTo_Item" in dictionary SMARTLIST,
	IG_PROD_ID,
	SMARTLIST_OBJECTTYPE_LEADS,
	"-",
	IG_PROD_ID,
	1, {Unique ID for this form}
	false, {Will not be the default Go To item}
	l_error;
if l_error <> OKAY and l_error <> DUPLICATE then
	set l_message to getmsg(22002);
	substitute l_message, "Explorer_Add_GoTo_Item", str(l_error);
	error l_message;
end if;

call with name "Explorer_Add_GoTo_Item" in dictionary SMARTLIST,
	IG_PROD_ID,
	SMARTLIST_OBJECTTYPE_LEADS,
	"Lead Inquiry",
	IG_PROD_ID,
	resourceid(form IG_Lead_Inquiry), {Unique ID for this form}
	false, {Will not be the default Go To item}
	l_error;
if l_error <> OKAY and l_error <> DUPLICATE then
	set l_message to getmsg(22002);
	substitute l_message, "Explorer_Add_GoTo_Item", str(l_error);
	error l_message;
end if;

Processing Go To items

The Go To items you add must be processed by the procedure named Explorer_GoTo_Button that you will add to your dictionary. This procedure must have the following parameters:

inout anonymous field IN_ListView;
in integer IN_Object_Dict_ID;
in integer IN_Object_Type;
in integer IN_GoTo_Dict_ID;
in integer IN_GoTo_Item;

The procedure will examine the values passed into these parameters to determine whether it must process the Go To item. If it should, the list view field for the Smart List is passed in as an anonymous field. This allows the code to find the currently-selected line and perform the specified action for that item.

The following is the Explorer_GoTo_Button procedure for the sample integrating application. If the user chooses one of the Go To items for the Leads SmartList, this code will find and display the first selected lead.

Procedure name: Explorer_GoTo_Button

 

inout anonymous field IN_ListView;
in integer IN_Object_Dict_ID;
in integer IN_Object_Type;
in integer IN_GoTo_Dict_ID;
in integer IN_GoTo_Item;

local long selected_item;
local string LeadID;

if IN_Object_Dict_ID = IG_PROD_ID then
	{Is it the Lead Maintenance form?}
	if (IN_GoTo_Dict_ID = IG_PROD_ID) and (IN_GoTo_Item = resourceid(form IG_Lead_Maintenance)) then
		{Try to find the first Lead selected in the list}
		selected_item = ListView_SelectionGet(IN_ListView, 1);
		if selected_item <> 0 then
			LeadID =  ListView_ItemGetLabel(IN_ListView, selected_item);
			open form IG_Lead_Maintenance;
			'Lead ID' of window 'Lead Maintenance' of form IG_Lead_Maintenance = LeadID;
			run script 'Lead ID' of window 'Lead Maintenance' of form IG_Lead_Maintenance;
		end if;
	end if;

	{Is it the Lead Inquiry form?}
	if (IN_GoTo_Dict_ID = IG_PROD_ID) and (IN_GoTo_Item = resourceid(form IG_Lead_Inquiry)) then
		{Try to find the first Lead selected in the list}
		selected_item = ListView_SelectionGet(IN_ListView, 1);
		if selected_item <> 0 then
			LeadID =  ListView_ItemGetLabel(IN_ListView, selected_item);
			open form IG_Lead_Inquiry;
			'Lead ID' of window 'IG_Lead_Inquiry' of form IG_Lead_Inquiry = LeadID;
			run script 'Lead ID' of window IG_Lead_Inquiry of form IG_Lead_Inquiry;
		end if;
	end if;
end if;


Documentation Feedback