Schultz’s PowerBuilder Notes

Update Status Flags


ItemStatus actually holds two pieces of information at once:

  • New/Not New
  • Modified/Not Modified

Every Row and Column has a status. Status of an item (column) can be DataModified! Or NotModified only. Rows can be of any of the four values.

How do I get the row and column update flags

Use GetItemStatus function. The return value is an enumerated value of type dwItemStatus.

DataWindow.GetItemStatus(row, column, dwbuffer)

To change the row status, set the column status to zero. Example

dwItemStatus ldwItemStatus
dwItemStatus = this.GetItemStatus(1, 0, Primary!)

How Do I change item status flags?

Basic syntax:

SetItemStatus(row, column, buffer, status)

Example:

SetItemStatus(ll_row, 0, Primary!, NotModified!) // 0 in column specifies update the row status flag

Setting status is not always straightforward. Here is the status change table:

Original status

Specified status

New!

NewModified!

DataModified

NotModified!

New!

Yes

Yes

No

NewModified!

No

Yes

New!

DataModified!

NewModified!

Yes

Yes

NotModified!

Yes

Yes

Yes

 

 

To set DataModified! To New!

SetItemStatus(New!)

SetItemStauts(NotModified!)

Advertisements

June 7, 2008 - Posted by | Datawindow PowerScript | , , , , , ,

1 Comment »

  1. First class piece of writing

    Comment by creation site internet haute savoie | October 13, 2011 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: