LIST ITEM [message #661615] |
Sat, 25 March 2017 02:01 |
|
sr8464
Messages: 82 Registered: February 2017 Location: India
|
Member |
|
|
DECLARE
CURSOR GRP2 IS
SELECT ROWNUM RN2, MODULE_MAST.MODULE_CODE||' - '||MODULE_NAME MODULE
FROM MODULE_MAST, USER_MAST WHERE :LOGIN_USER_CODE = USER_MAST.USER_CODE
AND :LOGIN_PASSWORD = USER_MAST.PASSWORD;
BEGIN
CLEAR_LIST ('LOGIN_MODULE_LIST');
FOR I2 IN GRP2 LOOP
ADD_LIST_ELEMENT ('LOGIN_MODULE_LIST', I2.RN2, I2.MODULE, I2.MODULE);
END LOOP;
END; WORKS FINE
BUT I WANT LIST ITEM AUTO SELECT 1ST VALUE/ ITEM
|
|
|
Re: LIST ITEM [message #661636 is a reply to message #661615] |
Sat, 25 March 2017 13:05 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
The way you wrote the SELECT statement, you can't know which value will be the first as there's no ORDER BY clause there.
Once you fix it, you'll have to use the same query in one of triggers (such as WHEN-NEW-ITEM-INSTANCE, or WHEN-CREATE-RECORD, or WHEN-NEW-FORM-INSTANCE, or similar) and set the initial value of that item to a desired value. I can't check it myself, but I think that you can't do it in item's Property Palette; there is the "Initial value" property and I know it accepts a constant (such as "1" or "New York"), but I don't know whether you can put a query in there. Though, you can easily check it yourself.
|
|
|
|
|
Re: LIST ITEM [message #661811 is a reply to message #661784] |
Mon, 03 April 2017 12:56 |
|
sr8464
Messages: 82 Registered: February 2017 Location: India
|
Member |
|
|
CREATE TABLE ENTITY_MAST(
ENTITY_CODE VARCHAR(2) NOT NULL,
ENTITY_NAME VARCHAR(50));
INSERT INTO ENTITY_MAST VALUES ('SR','SR INFO SOLUTION');
INSERT INTO ENTITY_MAST VALUES ('DP','DIGITAL PLANET');
INSERT INTO ENTITY_MAST VALUES ('XP','XEROX POINT'); BEGIN
DECLARE
RG_LIST_ID RECORDGROUP;
RG_NAME VARCHAR (20) := 'RG_LIST';
RET_CODE NUMBER;
V_SELECT VARCHAR (60);
BEGIN
V_SELECT := 'SELECT ENTITY_NAME, ENTITY_NAME FROM ENTITY_MAST ORDER BY 1';
RG_LIST_ID := FIND_GROUP (RG_NAME);
IF NOT ID_NULL (RG_LIST_ID)
THEN
DELETE_GROUP (RG_LIST_ID);
END IF;
RG_LIST_ID := CREATE_GROUP_FROM_QUERY (RG_NAME, V_SELECT);
RET_CODE := POPULATE_GROUP (RG_LIST_ID);
POPULATE_LIST ('LOGIN_ENTITY_LIST','RG_LIST');
DELETE_GROUP (RG_LIST_ID);
END;
END;
SET_ITEM_PROPERTY('LOGIN_ENTITY_LIST',INITIAL_VALUE,'XEROX POINT');
showing error
FRM-41042 No such property for Set_item_property.
|
|
|
|
|