2

I'm trying to save the JobID used for a User Initiated Send to a DE for research purposes (when something fails). My ampscript is below (where we lookup email address & current date) to perform the update. The jobID saved is always 0 (zero). I have been able to get this to work via a User Guided send, so I know the ampscript is good. Is there something special about User Initiated sends and how the JobID gets set / when it is available?

%%[
VAR @currentSystemDate, @today, @month, @day, @year, @hour, @minute, @ampm, @jid
SET @currentSystemDate = NOW()
SET @year = Datepart(@currentSystemDate,"year")
SET @month = Datepart(@currentSystemDate,"month")
SET @day = Datepart(@currentSystemDate,"day")
SET @hour = "00"
SET @minute = "00"
SET @ampm = "AM"
SET @today = CONCAT(@month,"/",@day,"/",@year," ",@hour,":",@minute," ",@ampm)
SET @jid = JobID

UpdateDE("DataExtensionName",2,"EMAIL",EMAIL,"InsertedDate",@today,"JobID",@jid,"Sent","1")

]%%

1 Answer 1

0

I believe the issue is the way JobID is being set and the way AMPScript is processed. Instead of setting it to a parameter, try specifying the system defined Name in the UpdateDE function.

UpdateDE("DataExtensionName",2,"EMAIL",EMAIL,"InsertedDate",@today,"JobID",JobID,"Sent","1")

1
  • Thanks for the suggestion Homs85. Unfortunately, did not change the behavior / jobid is still zero in my DE.
    – user7934
    Commented Aug 25, 2014 at 16:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .