Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1719
  • Last Modified:

Accessing list element value of a list item

How do I access the list element value of a list item in Developer/2000?  I am trying to use the built in function: Get_List_Element_Value() that takes both the list name or list id and the list index as parameters.  

My form has a list item called site_list in data block3.  On the selection of an item in the list I am attempting to assign the value selected to the global variable site.  I place the following code in the when-list-changed trigger:

DECLARE

LIST_TYPE  item;

BEGIN

     LIST_TYPE := FIND_ITEM('BLOCK3.SITE_LIST');  --for debugging purposes only
     :GLOBAL.SITE := GET_LIST_ELEMENT_VALUE(FIND_ITEM('BLOCK3.SITE_LIST'),:BLOCK3.SITE_LIST);

END;

When I switch debugging on, I see that the ID field of the list_type record is being initialized with a value.  Also the value of :BLOCK3.SITE_LIST is correctly initialized.  However, an exception occurs on the line where :GLOBAL.SITE is being initialized.  

Could somebody please provide some insight?
0
desmondg
Asked:
desmondg
1 Solution
 
retronautCommented:
If the value of the item you are looking for is the selected item in the list you can simply reference the item.

:GLOBAL.SITE := :BLOCK3.SITE_LIST;
0
 
desmondgAuthor Commented:
Thanks.  This works perfectly when the list elements and the list item values are the same.  Previously I had the set differently.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now