Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

SetChanges – PB Docs 125 – PowerBuilder Library

SetChanges – PB Docs 125

SetChanges method (DataWindows)

Description

Applies changes captured with GetChanges to
a DataWindow or DataStore. This method is used primarily
in distributed applications.

Controls

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataStore object

Web ActiveX

DataWindow control

Syntax

[PowerBuilder]

[Web ActiveX]

Argument

Description

dwcontrol

A reference to a DataWindow control or
DataStore.

changeblob

A read-only change blob created with
GetChanges from which you want to apply changes.

resolution (obsolete)

A value of the dwConflictResolution enumerated
datatype (PowerBuilder) or an integer (Web ActiveX) indicating how conflicts
should be resolved:

  • FailOnAnyConflict!
    (default)

  • AllowPartialChanges!

This
argument is obsolete and will be disabled in a future release.

Return Values

Returns one of the following values:

  • 1

    All changes were applied

  • 2

    A partial update was successful; conflicting changes were
    discarded

  • -1

    Method failed

  • -2

    There is a conflict between the state of the DataWindow changeblob and
    the state of the DataWindow

  • -3

    Column specifications do not match

If any argument’s value is null, in PowerBuilder
and JavaScript the method returns null.

Usage

Use this method in conjunction with GetChanges to
synchronize two or more DataWindows or DataStores. GetChanges retrieves
data buffers and status flags for changed rows in a DataWindow or
DataStore and places this information in a blob. SetChanges then
applies the contents of this blob to another DataWindow or DataStore.

note.png Calling SetChanges when no changes are pending

GetChanges returns 0 if no changes are
pending. This can happen if AcceptText is not
called after rows are modified. In this case, calling SetChanges will
fail, with a return code of –1.

If you call GetChanges on a DataWindow
and apply the data passed in the changeblob argument
to another DataWindow using SetChanges, you must
call GetChanges on the second DataWindow before
you reapply changes to it from the first DataWindow. The GetChanges call
on the second DataWindow updates the original timestamp on that
DataWindow so that it matches the current timestamp. (You cannot
use the Reset, ResetUpdate,
or AcceptText calls to update the original timestamp.)
If you try to reapply changes without first calling GetChanges on
the second DataWindow, you will get an error due to the conflict
between the state of the DataWindow changeblob and
the state of the second DataWindow.

Examples

The following example is a script for a remote object
function. The script uses SetChanges to apply
changes made to a DataWindow control on a client to a DataStore
on a server. The changes made on the client are contained in a change
blob that is passed as an argument to the function. After applying
changes to the DataStore, the server updates the database:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x