I’m working on an updatable BAQ that will update some QuoteHed fields and some Task fields. Why the task fields? Well, because we want to be able to “Lose” quotes without running a process (ie. manually). So, I have this BAQ setup with the appropriate QutoeHed and Task fields, and am running the “Advanced BPM Processing” on the Update tab. Here is the code that I have, but it’s not updating the Task:
/* Update procedure */
def var hProc as handle no-undo.
def var errorsOccured as logical no-undo.
run createConstants.
run bo/Quote/Quote.p persistent set hProc.
do on error undo, leave:
for each ttResults where ttResults.RowMod <> '' on error undo, next:
dataset QuoteDataSet:empty-dataset().
create ttQuoteHed.
run ZeroizeBuf(temp-table ttQuoteHed:default-buffer-handle).
ttQuoteHed.RowIdent = '#' + ttResults.RowIdent.
ttQuoteHed.CheckBox11 = ttResults.QuoteHed_CheckBox11.
ttQuoteHed.CheckBox20 = ttResults.QuoteHed_CheckBox20.
ttQuoteHed.Company = Constants.CurrentCompany.
ttQuoteHed.Date20 = ttResults.QuoteHed_Date20.
ttQuoteHed.DocTotalExpected = ttResults.QuoteHed_DocTotalExpected.
ttQuoteHed.EntryDate = ttResults.QuoteHed_EntryDate.
ttQuoteHed.FollowUpDate = ttResults.QuoteHed_FollowUpDate.
ttQuoteHed.QuoteNum = ttResults.QuoteHed_QuoteNum.
ttQuoteHed.ShortChar01 = ttResults.QuoteHed_ShortChar01.
run UpdateExt in hProc(input-output dataset QuoteDataSet, true, true, output dataset BOUpdErrorDataset, output errorsOccured).
if IsInfoPromptHandlerInvoked() then return.
/*ttResults.RowMod = ''.*/
find first ttQuoteHed where ttQuoteHed.RowIdent = '#' + ttResults.RowIdent no-error.
if available ttQuoteHed then do:
ttResults.QuoteHed_CheckBox11 = ttQuoteHed.CheckBox11.
ttResults.QuoteHed_CheckBox20 = ttQuoteHed.CheckBox20.
ttResults.QuoteHed_Date20 = ttQuoteHed.Date20.
ttResults.QuoteHed_DocTotalExpected = ttQuoteHed.DocTotalExpected.
ttResults.QuoteHed_EntryDate = ttQuoteHed.EntryDate.
ttResults.QuoteHed_FollowUpDate = ttQuoteHed.FollowUpDate.
ttResults.QuoteHed_QuoteNum = ttQuoteHed.QuoteNum.
ttResults.QuoteHed_ShortChar01 = ttQuoteHed.ShortChar01.
end.
if errorsOccured then temp-table ttErrors:copy-temp-table(temp-table ttBOUpdError:handle, true, ?, true).
end.
finally:
delete object hProc.
for each ttErrors where ttErrors.ErrorRowIdent begins '#':
ttErrors.ErrorRowIdent = substring(ttErrors.ErrorRowIdent, 2).
end.
/* Task Update adapter*/
For each ttQuoteHed where ttQuoteHed.RowMod='U':
DEF VAR hTask as handle no-undo.
run bo/task/task.p persistent set hTask.
if valid-handle (hTask) then do:
find first Task where Task.Company = Cur-comp and Task.RelatedToFile=ttResults.Task_RelatedToFile and task.key1=ttResults.Task_Key1 and task.key2=ttResults.Task_Key2 and task.Key3=ttResults.Task_key3 and task.TaskSeqNum=ttResults.Task_TaskSeqNum no-lock no-error.
if avail task then do:
run GetTaskCnt in hTask.
Task.Company='4BUS'.
Task.RelatedToFile=ttResults.Task_RelatedToFile.
task.key1=ttResults.Task_Key1.
task.key2=ttResults.Task_Key2.
task.Key3=ttResults.Task_key3.
task.TaskSeqNum=ttResults.Task_TaskSeqNum.
Task.TaskDescription=ttResults.Task_TaskDescription.
task.ReasonCode='PRICE'.
Task.Conclusion=ttResults.Task_Conclusion.
Task.Complete=true.
run UpdateExt in hTask.
Delete Object hTask.
end.
end.
end.
/*End Task Update adapter*/
end finally.
end.
Any ideas on how I can get the “Task Update adapter” portion to work from the QuoteHed BPM process?