Home » Developer & Programmer » Forms » 2 questions about List Of Value and how to make sequence (Form 6i)
2 questions about List Of Value and how to make sequence [message #363386] Sat, 06 December 2008 10:13 Go to next message
aorlunla
Messages: 20
Registered: March 2008
Junior Member
Dear all,

I have 2 questions like ...

1. I want to create sequence in each record when I choose customer number(choose from List of value)like first record when I choose customer number A then it'll appear '1' in Item line number and next to second record when I choose customer number then '2' will appear. which trigger I can use in this case?

2. Can I cut off customer which I ever choose from List Of Value? For example I have 3 customer A, B, C first record I choose customer A from LOV and then when I choose customer in second record in LOV, It will appear only customer B and C (customer A was cut off already).

thank you so much.

Regards,
aorlunla
Re: 2 questions about List Of Value and how to make sequence [message #363388 is a reply to message #363386] Sat, 06 December 2008 10:32 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
  1. WHEN-CREATE-RECORD might be one choice; WHEN-VALIDATE-ITEM on the "customer number" item might be yet another one.
  2. You might need to delete the record group and populate it again for every record; see if this discussion helps (also, follow David's link for even more information).
Re: 2 questions about List Of Value and how to make sequence [message #364301 is a reply to message #363386] Sun, 07 December 2008 22:04 Go to previous messageGo to next message
aorlunla
Messages: 20
Registered: March 2008
Junior Member
Dear,
I've try to use WHEN-VALIDATE-ITEM trigger with this PL/SQL


BEGIN
first_record;
declare i number := 0;
begin
if :INVOICE_WH.customer_number is not null then
Loop
:INVOICE_WH.line_num := i;
i:=i+1;
next_record;
end loop;
end if;
end;
END;


but when I choose customer number it'll appear '2' on Item line number and I can't move to next record also I can't click to show detail in another page too. how can I solve this problem? please help me

Regards,
aorlunla
Re: 2 questions about List Of Value and how to make sequence [message #364324 is a reply to message #364301] Mon, 08 December 2008 00:34 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't think that LOOP is the right way to do that (unless you are going to do that for records that already exist in the database. And, if that's the case, I don't think that Forms is the right tool to do that); besides, you've written an infinite loop (as you never exit it).

You might, though, use a parameter and increase its value in the trigger (this time, no looping, please!). Simply, when you create a new record, set item value to "parameter value" and add 1 to the parameter.
Re: 2 questions about List Of Value and how to make sequence [message #364342 is a reply to message #363386] Mon, 08 December 2008 01:09 Go to previous messageGo to next message
aorlunla
Messages: 20
Registered: March 2008
Junior Member
sorry for my silly Loop.
I am really newbie for programming so Could anyone please give me any an example for create sequence for each record please?

thank you so much
aorlunla
Re: 2 questions about List Of Value and how to make sequence [message #364522 is a reply to message #364342] Tue, 09 December 2008 00:10 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Use 'post-query' trigger to populate your field.

Use 'post' to get the record's data into the database and use a 'not exists' in the 'record_group' for the LOV.

Read the help system concerning the 'post-query'. The other is standard SQL.

David
Previous Topic: Master detail
Next Topic: How to get the control back to form from the command prompt after opening a web page usin HOST comnd
Goto Forum:
  


Current Time: Thu Dec 08 06:27:43 CST 2016

Total time taken to generate the page: 0.09754 seconds