Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't change setfldstate when appending new record.

Status
Not open for further replies.

longda

Programmer
Jul 24, 2001
66
US
When I append a new record to table then try to use setfldstate() to change some of the fields to not edited, it gives me an error (function, value, or type is incorrect). The only states I can change the field to is 3 or 4. I have optimistic table buffering on. Is there any way around this or is there a setting on that might prevent it.

In my program I appended the record then made changes to the record. This is the following code to change the state of certain field back to 1:

LOCAL l_nFields
l_nFields=AFIELDS(l_aFields,"pendtranedit")
FOR l_nI=1 TO l_nFields
IF UPPER(SUBSTR(ALLTRIM(l_aFields(l_nI,1)),1,2))=="SE"
=SETFLDSTATE(l_nI,1,"pendtranedit")
ENDIF
ENDFOR
DODEFAULT()
 
HI
I believe, the basic status that it is appended cannot be changed by user interaction, or else, the whole thing could fail.

SO if you have done a table update after the append, then you can toggle 1 or 2. If this is just appended record then you can toggle between 3 and 4.

I think this provides the explanation. :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
That's what I was afraid of. I wanted to loop through a view and only use certain fields based on their status using the getfldstate then add them to an auditlog table with the new values of each field. Thanks for you help.

Dave L.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top