?
Solved

dw delete record problem

Posted on 2004-10-30
7
Medium Priority
?
606 Views
Last Modified: 2013-12-26

Hello,
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.

Thanks
0
Comment
Question by:mayuri25
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
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.
0
 
LVL 4

Assisted Solution

by:Bhatti
Bhatti earned 80 total points
ID: 12459470
Hi,

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


Bhatti
0
 
LVL 4

Assisted Solution

by:falvaro3
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.
0
 
LVL 4

Expert Comment

by:falvaro3
ID: 12832135
I'm in...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

594 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