This topic is locked
[SOLVED]

 please Help!

6/22/2010 8:21:45 AM
ASPRunnerPro General questions
M
magma7247 author

Hi all,
I have ticket form, I have two fields , filed 1 ( Customer Number ) and filed 2 for ( ticket status ) /has two dropdown menu opened and closed.
what I want to do is, if someone want to add new record and there is exist record in ( filed1 ) with open status in filed2 , I need to send him duplicate error.
but if the ticket status closed it's ok to be duplicated.
please help me on this, I use mysql 5.1 with ASPrunner.
all regards

C
clig 6/22/2010



Hi all,
I have ticket form, I have two fields , filed 1 ( Customer Number ) and filed 2 for ( ticket status ) /has two dropdown menu opened and closed.
what I want to do is, if someone want to add new record and there is exist record in ( filed1 ) with open status in filed2 , I need to send him duplicate error.
but if the ticket status closed it's ok to be duplicated.
please help me on this, I use mysql 5.1 with ASPrunner.
all regards


before add do a query using the value in field 1 to check for exists and open - if exists return a popup / redirect to a list page or something - duplicate else write record (do nothing)...

M
magma7247 author 6/22/2010

Thanks for your kind reply, but I'm new on this, can you explain to me more, I mean how (the code ) to do it and where , in mysql or runner ?
regards.

A
ann 6/23/2010

Hi,
use predefined Check if specific record exists action in the Before record edit/ Before record updated events(Add action button on the Events tab).

Here is just a sample:

dim rsExists

set dal_table=dal.Table("TableName")

set rsExists = dal_table.Query("Customer_number="& values("Customer_number"),"")

if not rsExists.eof then

if values("Status")="Open" then

BeforeAdd=false 'if record exists do something

else BeforeAdd=true

end if

else

BeforeAdd=true 'if dont exist do something else

end if

rsExists.Close : set rsExists = Nothing



where TableName is actual table name; Customer_number, Ticket_status are actual field names.

M
magma7247 author 6/23/2010

sorry I wasn't so clear, here what I have
first of all, my table ( database ) I name it : "databse" on mysql 5.1
1- I have form for IT records.

2- I have two fileds

  • DSL
  • Status ( has dropdown , open and close )

    3- I need anyone when he try to add new record in DSL filed the script will check other filed which is Status filed, the Status filed has to dropdown menu open and close.
    4- I want to do this, once the DSL number exist, and the user trying to add new record for same DSL numberthe script will check Status filed, if it's open , then the user will get duplicated error
    5- if the exist record status close and he trying to add same exist DSL number then it's ok to duplicate.
    please tell me how to do it, I don't mind to pay for it.

A
ann 6/24/2010

Hi,
use code above, just replace TableName, Customer_number, Ticket_status with your actual names: databse, DSL, Status.

If it doesn't help please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.

M
magma7247 author 6/24/2010

I added whole thing to open ticket.
thanks.