Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


dw delete record problem

Posted on 2004-10-30
Medium Priority
Last Modified: 2013-12-26

I am working on one project in PB 9.0 and I am getting one problem in deleting records in a DW.

I am retrieving data in a DW based on the search criteria. I am also adding and deleting records in the DW. I don't want to let the user modify the previously retrieved records in the DW. User can only modify newly added records. So i have set the protect property for one editable column to false/true using expression. It is working fine while adding records but in case of delete it is not working.

After inserting new record to the DW control moves to the editable column in the new row. If i give valid data it accepts it and again set focus to the same column and row. And hence i am not able to delete other records in the DW. If i try selecting other rows it does not moves the focus to that row. Even I click anywhere in the window it not moving focus out of the editable column and hence i can not select another row that i want to delete. The row status is set to NewModified. The code for searching and populating data in other columns for the newly added code is written in itemchanged event. the event returns 2 when successful.

Please tell how I can handle this problem. What code/property setting i have to write so that i can delete other records after adding new records. I tried lots of options the whole day but coulden't get rid of this problem.

Please reply ASAP. It is very very urgent for me. Please reply at the earliest.

Question by:mayuri25
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

michaelstoffel earned 80 total points
ID: 12457264
If the row clicked on is protected then you need to do a SetRow to the protected row in order to make it the current row.

Assisted Solution

Bhatti earned 80 total points
ID: 12459470

Normal is it so, You can add a new row with InsertRow() function. Now you can add a new record to this row. You can always select a new row. You can always delete a selected row.
Please try to check your script if your are selecting row with SELECTROW() function then it is working properly. In the clicked event:

dw_1.SelectRow(0, FALSE)
dw_1.SelectRow(row, TRUE)

Please look if you used somewhere Modify() function for new added row as taborder > 0 and others 0.

The protection setting of a column. The Protect property overrides tab order settings. When a column is protected, the user cannot edit it even if the column's tab order is greater than 0.

If you want to delete then in the clicked event with the help of Modify function set the protection to false for the selected columns in the selected row and then delete this row.

Use the modify() to set the protection to false for the column of the selected row. If you have any question please let me know.

dw_1.Modify("column_name.protect='0~t if(column_name.protect=1,0,1'")

This is just a demostration. Please read once help (modify() for datawindow and script the right one as you need.

Best regards


Assisted Solution

falvaro3 earned 80 total points
ID: 12472869
How about setting the protection based on IsRowNew() expression function?

ls_Protect = "0~tif(IsRowNew(),0,1)"
dw_1.Modify("mycolumn.Protect='" + ls_Protect + "'")
This way, only retrived columns get protection, and anything with NewModified! or New! DWItemStatus will be left for modification.

Expert Comment

ID: 12832135
I'm in...

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question