Ajesh
2nd December 2009, 17:32
Hi
I want to use AFS to perform the following operation.
Copy a record in the User data and change the primary key to some other value and then save it.
I am using the following code
stpapi.put.field("ttaad2100m000", "ttaad200.user",similar.id)
stpapi.find("ttaad2100m000")
stpapi.application.option("ttaad2100m000", 1, 0, error.msg)
stpapi.put.field("ttaad2100m000", "ttaad200.user",form.id)
stpapi.put.field("ttaad2100m000", "ttaad200.name",form.name)
stpapi.put.field("ttaad2100m000", "ttaad200.uusr",form.uid)
stpapi.update("ttaad2100m000",1, error.msg)
stpapi.end.session("ttaad2100m000")
Where similar.user record is supposed to be searched and then a copy has to be performed and then the new values are put and saved.
I have used stpapi.application.option("ttaad2100m000", 1, 0, error.msg)
to access the copy command in the form 1.
But i cannot get the desired result. the result in the above case is that the existing record is updated.
I have also tried using stpapi.insert in place of update but it inserts record with blank fields.
Anybody with some insight
Regards
Shinoj
I want to use AFS to perform the following operation.
Copy a record in the User data and change the primary key to some other value and then save it.
I am using the following code
stpapi.put.field("ttaad2100m000", "ttaad200.user",similar.id)
stpapi.find("ttaad2100m000")
stpapi.application.option("ttaad2100m000", 1, 0, error.msg)
stpapi.put.field("ttaad2100m000", "ttaad200.user",form.id)
stpapi.put.field("ttaad2100m000", "ttaad200.name",form.name)
stpapi.put.field("ttaad2100m000", "ttaad200.uusr",form.uid)
stpapi.update("ttaad2100m000",1, error.msg)
stpapi.end.session("ttaad2100m000")
Where similar.user record is supposed to be searched and then a copy has to be performed and then the new values are put and saved.
I have used stpapi.application.option("ttaad2100m000", 1, 0, error.msg)
to access the copy command in the form 1.
But i cannot get the desired result. the result in the above case is that the existing record is updated.
I have also tried using stpapi.insert in place of update but it inserts record with blank fields.
Anybody with some insight
Regards
Shinoj