Steve,

method "cudAssessment"($cudAction; $cudPhase; $cudTable; $cudResult; $params; $cudTimestampField; $cudTimestamp)
        writebr('$cudAction $cudPhase $cudResult')
        case of
                :($cudPhase = "query")
query([assessments]; [assessments]id = num($params{"assessment.id"}))
                :($cudPhase = "update")
                        buildFromParams("assessments";$params)
                :($cudPhase = "delete")
                        // delete questions and answers
        end case
        return ("success")
end method

What I noticed is that my record was not being updated, (action = update) but it was returning "success". I put the writebr in and saw that it only did the query phase and the cleanup phase. That pointed out that I had an error in my query as it reported missing out of query. It then it fell through to the cleanup phase, which was successful and the overall result was success.

That leads me to believe that:

1 - You can't ignore the cleanup phase since any error would be overwritten in the cleanup phase if not handled. 2 - If the status is not success before calling the cleanup phase, it should report that result.

Good point. Conceptually cleanup is not an action that has a result, so in fact the status returned by cleanup should just be ignored. Change the end of a4d.utils.cud to this:

$cudPhase := "cleanup"
$cudResult_ := $cudResult

if ($cudInclude)
    include($cudProcessor)
else
call method($cudProcessor; $cudAction; $cudPhase; $cudTable; $cudResult; $attributes; $cudTimestampField; $cudTimestamp)
end if
        
return ($cudResult_)


Kind regards,

   Aparajita
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoy.org

_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to