1. Thorsten Kummer
  2. PowerBuilder
  3. Monday, 21 February 2022 14:09 PM UTC

Dear all,

 

I am having a problem with setting a columns status to NotModiefied!, look here

dw_list.SetItem(ll_row, "workitemstatus", 'Y')
ldws_status = dw_list.getItemStatus(ll_row, 'workitemstatus', Primary! ) -->> now it is dataModified!
ll_ret = dw_list.SetItemStatus(ll_row, "workitemstatus",Primary!, NotModified!) ---> ll_ret is 1 (success)
ldws_status = dw_list.getItemStatus(ll_row, 'workitemstatus', Primary! ) ----> it is still DataModified! although I expect NotModieifed!

 

What's wrong here?

I am using PB 2019 R2, Build 2353

Thanks in advance
Thorsten

Jeff Stubbs Accepted Answer Pending Moderation
  1. Wednesday, 20 April 2022 15:48 PM UTC
  2. PowerBuilder
  3. # 1

Thank you all for posting about this.  I have been debugging this same issue today.  If this is expected behaviour, then in my opinion it should be documented in the help, and the SetItemStatus should return a -1 when the column status is not changed.  We don't use the Update() function to generate the insert SQL, but instead send all the fields to an 'insert' stored procedure.  I would like to set a column status to NotModified! after setting it to a default in a script with SetItem.  This way I can check if a user has modified any fields later with ModifiedCount().  I know setting the row status works in my case, but thought it would be generally more appropriate to change each column status immediately after each SetItem.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 21 February 2022 15:50 PM UTC
  2. PowerBuilder
  3. # 2

Hi Thorsten;

  Don't forget to set the Row Status other than NewModifed! for this to work. If that is not convenient for your App, you could also attack the problem with a Modify() to change the updatable columns. Thus, having the same effect on an Update().

Regards ... Chris

Comment
There are no comments made yet.
Thorsten Kummer Accepted Answer Pending Moderation
  1. Monday, 21 February 2022 14:39 PM UTC
  2. PowerBuilder
  3. # 3

thanks, Rene,

 

I do want the Insert but I need the certain column to be Notmodified for further processing

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Monday, 21 February 2022 14:28 PM UTC
  2. PowerBuilder
  3. # 4

I guess your row is new. In this case the SetItemStatus function doesn't changes the column status to NotModified! It seems not documented but logical behaviour because it uses all columns in the INSERT statement anyway. If you don't want to do the insert you have to change the row status.

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.