Home » Developer & Programmer » Forms » Sort Order (Windows XP DB 8i - forms 6i)
Sort Order [message #353279] Mon, 13 October 2008 03:43 Go to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
Hi Guyz,

hope all r doing well......

guyz im facing some problem

I have 8 text field on my main form

im calling forms with this text field

i wrote a trigger when mouse click it will call to below procedure and call to concern form whic display on text field on main menu form

PROCEDURE MENU_CALL IS
BEGIN

IF :tablename.item='xxx' THEN
CALL_FORM(GETPATH||'USERLOG',HIDE);

ELSIF :tablename.item='PURCHASE ORDER' THEN
CALL_FORM(GETPATH||'SI_PO',HIDE);
end if;
end

GETPATH is also a procedure to search the exact form and display on the screen.

is there anyway to show the record in asending order or (order by )is there anyway to do some alter in procedure to show the record in order. now it was showing like this

1) SYSTEM INVENTORY
2) ASSETS ADMINISTRATION
3) DEPARTMENTS

I WANT THIS TO BE IN ORDER LIKE BELOW

1) ASSETS ADMINISTRATION
2) DEPARTMENTS
3) SYSTEM INVENTORY

ANY HELP please
Re: Sort Order [message #353310 is a reply to message #353279] Mon, 13 October 2008 05:27 Go to previous messageGo to next message
rajy_salim
Messages: 204
Registered: January 2008
Location: Beirut - Lebanon
Senior Member
What are these records? Where do they come from? How do you get them? What is the relation between them and the explanation you provided?
I think this relation does not exist . . .

Please clarify you point!!

Rajy!
Re: Sort Order [message #353347 is a reply to message #353310] Mon, 13 October 2008 07:58 Go to previous messageGo to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
Hi salim

All these records are coming from database tables

As you seen in the snap whic is my main form arrow number1 are the text item non database item, im calling the records into the text item from another table call user_details some of the records you can see on arrow number2. (i.e. user access menu etc etc )

i want to sort theese records in asending order as you seen all the records are in randomly.

when the mouse clik on any item (ie: user access menu) it will call procedure menu call i put the coding below through the procedure it will call the same form display in the snap.

just i want to sort these records asending.

Hope you got my point.....if need more details please let me know.

so that i can clear in detailsssssssss

Regards

  • Attachment: error.JPG
    (Size: 35.31KB, Downloaded 89 times)
Re: Sort Order [message #353401 is a reply to message #353347] Mon, 13 October 2008 14:12 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm quite confused here as I don't understand what is going on.

However: if these records are retrieved from a database (your first sentence in the last post), why don't you make this block a database block (instead of a control block - second sentence in your post) which would enable you to simply order these values by using the ORDER BY block property?

Furthermore, as you've said (in the very first post here) that values are retrieved by a function (GETPATH?), why did you choose to do that?

As we don't know your database model, it is difficult to guess what is going on, but - I'd think about having these "menu items" in a table which looks like
CREATE TABLE menu_items
(application_user number,         --> foreign key to "application_users" table
 item_name        varchar2(30)
)

Form block would then be based on such a table; depending on "application user" value, you'd execute query on this block having the WHERE clause set to
SET_BLOCK_PROPERTY('menu_items', default_where, 'application_user = ' || :users.application_user)

And that should be all ... at least, in my version ./fa/1600/0/.

Perhaps I'm wrong, but - your style seems too complicated.
Re: Sort Order [message #353495 is a reply to message #353279] Tue, 14 October 2008 01:00 Go to previous messageGo to next message
rajy_salim
Messages: 204
Registered: January 2008
Location: Beirut - Lebanon
Senior Member
As LittleFoot said, making your datablock a database block is a good idea.

But still,
Why don't you order your result (by using order by) and fetch the first record to the first text item , the second record to the second text item and so on ...?
And can you assure your query retrieves 8 records (the number of you text items)? what happens if you add a new record to your database??

Rajy
Re: Sort Order [message #353551 is a reply to message #353495] Tue, 14 October 2008 02:58 Go to previous messageGo to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
greetings,

Dear all thanks for supporting me....

little might be you are rite but let me explain u my scenario

after login form it will display the main menu as i attach the snap of main menu.

i have two tables.

SQL> desc user_master
Name Null? Type
------------------------------- -------- ----
USERNAME NOT NULL VARCHAR2(15)
PASS VARCHAR2(15)
STATUS CHAR(1)

SQL> desc user_details
Name Null? Type
------------------------------- -------- ----
USERNAME VARCHAR2(15)
MENUS VARCHAR2(30)

im using user_master on my login form and user_details on main menu form.

in user_master i have user information such as
username, password and their status administrator can view the status of user weather the user logging in or not.

and in user_details menus contain menus name as show in the attach snap arrow number2.

as you can see in attach snaps the menus records is related to administrator user is shown in randomly like

ASSETS ADMINISTRATION
PERSONAL CONTACTS
HARDWARE & SOFTWARE INFO
SYSTEMS INVENTORY
DEPARTMENTS EDITING
ADMINISTRATION
USER REQUEST FORM

i would like these records in asending order like

ADMINISTRATION
ASSETS ADMINISTRATION
HARDWARE & SOFTWARE INFO
PERSONAL CONTACTS
SYSTEMS INVENTORY
USER ACCESS MENU
USER REQUEST FORM

furthurmore (GETPATH) is a funtion whic looks an appropiate form if i clik on administration it will search and display on screen the code is below

FUNCTION getpath RETURN VARCHAR2 IS
path VARCHAR2(255) := Get_Application_Property(CURRENT_FORM);
slash PLS_INTEGER;
BEGIN
slash := instr(path,'\',-1);
IF slash = 0 THEN
slash := instr(path,'/',-1);
END IF;
Return(substr(path,1,slash));
END;

and im using the another procedure to call the appropiate forms below is the code

PROCEDURE MENU_CALL IS
BEGIN

IF :USER_DETAILS.MENUS='ADMINISTRATION' THEN
CALL_FORM(GETPATH||'ADMINISTRATION',HIDE);

ELSIF :USER_DETAILS.MENUS='SYSTEM INVENTORY' THEN
CALL_FORM(GETPATH||'SI_INV',HIDE);

END IF ;
END;

sorry little but i cannot change my application already it was develop by another person. coz already laks of records etc etc...just i wanna to sor the menus thatz all....even thoug i check ORDER BY :user_details.menus as you said but not working displaying same as before.....

Regards
  • Attachment: ERROR.JPG
    (Size: 69.68KB, Downloaded 69 times)

[Updated on: Tue, 14 October 2008 02:59]

Report message to a moderator

Re: Sort Order [message #353585 is a reply to message #353551] Tue, 14 October 2008 04:39 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

Quote:
All these records are coming from database tables


How are you fetching them? If by using an sql statement then order it in the statement itself.
Re: Sort Order [message #353649 is a reply to message #353585] Tue, 14 October 2008 08:19 Go to previous message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
thanks Little n all i solved....my query...i get a little clue from little Laughing
Quote:
simply order these values by using the ORDER BY block property?


it works fine now....thanks little.....n salim as well mudabir Cool

Regards

Munna
Previous Topic: Form, ID Field and a Button
Next Topic: EDI SYSTEM
Goto Forum:
  


Current Time: Sun Dec 04 00:25:49 CST 2016

Total time taken to generate the page: 0.25918 seconds