Home » Developer & Programmer » Forms » Not allow duplicate values for an item
Not allow duplicate values for an item [message #286734] Mon, 10 December 2007 00:57 Go to next message
subhash.pophale
Messages: 9
Registered: December 2007
Location: Mumbai
Junior Member
Hi,
My form contains tabbular layout with two field
1):acc_poa_mapping.hold_ind and 2):acc_poa_mapping.holder_nm

I want to restrict duplicate values for item HOLD_IND without saving them to database. Also I don't want change property,I have to do it using some code in form provided trigger.

Waiting for your solutions....

Thanks

Re: Not allow duplicate values for an item [message #286740 is a reply to message #286734] Mon, 10 December 2007 01:08 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Here's one way (silly as it is):
- Copy all the item values to an array.
- In the when-validate-item, check whether the value the user has entered is in the array.
- If it is: raise an error, if it isn't, add it to the array.

Why are you reluctant to fiddle with properties?

MHE
Re: Not allow duplicate values for an item [message #286756 is a reply to message #286734] Mon, 10 December 2007 01:33 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Dear for this you have to create an array with these two columns and populate it when you perform execute query on your base table block.

Now on runtime on Pre-Record check the current record's value with your array records.

The Base Table current record number and Array's index no. will help you in checking that which record you are analyzing.

Regards,
Azam Khan
Re: Not allow duplicate values for an item [message #286764 is a reply to message #286756] Mon, 10 December 2007 01:39 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
A great! I got myself an echo Very Happy.

@azamkhan: check my post. What did I write?

I think a PRE-RECORD is not the correct place to check for duplicate values.

MHE
Previous Topic: codinig for Execute_query button
Next Topic: Messaging problem
Goto Forum:
  


Current Time: Sun Dec 11 08:02:19 CST 2016

Total time taken to generate the page: 0.24880 seconds