bpanda
19th January 2015, 11:17
Hello,

I want to delete record from Routing Operations (tirou1502m000) session (type 3).
I am able to find the record by using browse.set and after stpapi.mark() I am able to get the required values.
But when I use stpapi.delete() then it removes the 1st occurence record not the marked one.

Please share your comments.

Thanks in advance

Best Regards,
Biswajyoti Panda

bhushanchanda
19th January 2015, 12:08
Hi,

Can you put your code here? That would help to identify the exact cause.

Just a quick question, have are you following the sequence - put fields, do a find, mark and then delete? Do not do a browse.set; instead of that try with stpapi.find() and check if its working.

mark_h
19th January 2015, 19:33
I can't remember which session it was - but on one of mine I had to find the record to get the current record "marked". I ended up doing it almost like Bhushan has mentioned. I had to use stpapi browse function to find it, store off the fields - then I had to do a find to get the exact record marked. Stpapi.mark did not work on the session, but a find with all of the fields now worked.

bpanda
20th January 2015, 07:46
Hello Bhusan,

Please find the used code attached here.

bpanda
20th January 2015, 08:41
Hi,

This issue solved.
There was a silly mistake in the code, for operation I was using "tirou102.opro" instead of "tirou102.opno" in find option.

But if after stpapi.mark() we use stpapi.get() and it returns correct value then why stpapi.delete() deletes the 1st occurence record not the marked record?

Thanks & Regards
Biswajyoti Panda

bhushanchanda
20th January 2015, 09:04
Hi,

Good to know that you got it working. As you were not actually putting the value in right field, mark was not working. You were passing the value to the session and stpapi.get will get the values what you put. May be the assigning was done based on the sequence of values passed.

E.g. if you have 2 records,

Number Pos
XYZ 10
ABC 10

If you were putting ABC correct and position into wrong field, stpapi.get() will get the default value for that i.e. 10

I guess this is what happened in your case.

vh3baan
6th February 2015, 09:33
Try using stpapi.find()