Delivery Locked after Validation

SOLVED

I am creating deliveries in Sage EM using the SDH web service.  After the delivery is created, I am calling the code from the SDH object to validate the delivery.  I have found that the deliveries get validated successfully, but they remain locked.  Does anybody know what is causing this?  Below is the code, which I copied from the Validate button on the Delivery screen.

Subprog SDHVAL(DELNO, SITE)

Value Char DELNO
Value Char SITE

If clalev([F:SDH])= 0 : Local File SDELIVERY[SDH] : Endif

Local Char PADMIN
Call OUVRE_TRACE(mess(34,191,1)) From LECFIC
# Récupération paramètre administrateur stock
Call PARAMUTIL("STOADMIN",PADMIN,"","") From SUBAUS
GSTOADMIN = val(PADMIN)
Call TEMPON("V") From GESECRAN
Call VALIDATION(DELNO) From TRTVENLIVV
Call TEMPOFF From GESECRAN
Call GLOBVAR(SITE,"VEN") From TRTX3
Call FERME_TRACE From LECFIC
If [F:SDH]CFMFLG <> 2
Call LEC_TRACE From LECFIC
Else
#BRBAN 08/07/2014 SAM #93745
GTRACE = ""
Endif

Close Local File [SDH]

End

  • 0
    SUGGESTED

    What version and patch is this on?

    I have not seen this issue, but could you add Unlock command  after validation,

    In other words similar to what we have in SUBSDHA like below.

  • +1
    verified answer

    My version has the same issue exactly! I had to manually unlock the record using a Delete command to the APLLCK table directly, though, because the Unlock command didn't work from inside the web service. I just put a manual lock check prior to calling Validation to make sure it wasn't locked by someone else, first.

  • 0 in reply to Esfahani

    Thank you for the input.  I did end up changing this to call the import template from a custom web service instead, since the import template has a field available to validate the delivery.

  • 0 in reply to Denise Hartman

    Hi Denise, 

    I am running into the same issue where the delivery is getting locked when calling the VALIDATION function from TRTVENLIVV. 

    Are you updating the delivery to a validated state or creating a delivery into a validated state? If you are updating a delivery to a validated state, do you mind sharing what your import template looks like?

    I keep running into an error message that the sales order line is closed whenever I try to update a delivery to a validate state through an import template which is correct. How did you avoid this error message?

    Thank you, 

    Chris