Short summary:
I've created a custom object screen for change control, set up the sequence number, and can get it to populate with an infbox or before field action on the document field (which populates a number in sequence prior to record creation, so I cannot use), but when I try to use INICRE it creates a record with a blank value in the field that should be populated with the sequence number.
I've been fighting it for over a day, tried multiple approaches, and can't help the feeling that I'm missing some step here that would bring it all together. Code block below:
$INICRE
#GPE = 1
Local Integer STAT
Local Char ZSEQNUM
# Assign a document number from counter ZSEQNUM
Call NUMERO ("ZCCM0","","","",ZSEQNUM,STAT) From SUBANM
If STAT = 0
[F:ZCCM]ZDEVNUM = ZSEQNUM
[M:ZCCM0]ZDEVNUM = ZSEQNUM
Affzo [M:ZCCM0]ZDEVNUM
Else
GERR=1:GMESSAGE = mess(60,199,1) : GOK=0 : Return
Endif
Return