Home » Developer & Programmer » Forms » Server and Client Forms having same Voucher Numbers
Server and Client Forms having same Voucher Numbers [message #637574] Wed, 20 May 2015 06:22 Go to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Dear Members,

I'am generating voucher numbers using the WHEN-VALIDATE-ITEM Trigger with following Query:

Select nvl(max(field_name,0)+1) into :form_field from Table;

On server it works fine, but whenever both the server and client running the same form and entering data then same voucher numbers are generating on both the machines resulting unable to commit record.

Please help me in the matter.

Regards,

Muhammad Usman
Re: Server and Client Forms having same Voucher Numbers [message #637576 is a reply to message #637574] Wed, 20 May 2015 06:24 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That's expected in a multi-user environment. Switch to a sequence.
Re: Server and Client Forms having same Voucher Numbers [message #637577 is a reply to message #637576] Wed, 20 May 2015 06:28 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Dear littlefoot would you please brief in detail
Re: Server and Client Forms having same Voucher Numbers [message #637579 is a reply to message #637577] Wed, 20 May 2015 06:39 Go to previous message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
In SQL*Plus:
create sequence my_seq;


In a form:
select my_seq.nextval into :form_field from dual;



[EDIT] Modified form code as
:form_field := my_seq.nextval;
won't work in Forms

[Updated on: Wed, 20 May 2015 06:52]

Report message to a moderator

Previous Topic: Default Login Form customize
Next Topic: Restrict number of record in Form6i
Goto Forum:
  


Current Time: Fri Apr 26 02:15:24 CDT 2024