project BLF > class RPCRequestService > method GetContextProperty

function returns character

Description

This method returns a context property from the vhSessionContextDS dataset-handle.


Parameters


icPropertyQualifierinputcharacter
icPropertyNameinputcharacter


Internal usage


BLF
method RPCRequestService.ReadContextPropertiesForForcePublish
method RPCRequestService.ReadContextPropertiesForXMLImport
method RPCRequestService.ReadMainContextProperties


program code (program1/rpcrequestservice.p)

if valid-handle(vhSessionContextDS)
then do:
    assign vhSessionContext = vhSessionContextDS:get-buffer-handle(1) no-error.
    if not valid-handle (vhSessionContext)
    then do:
        /*error: vhSessionContextDS does not contain any buffer handles*/
        return ?.
    end.

    create query vhQuery in widget-pool "non-persistent".
    vhQuery:forward-only = yes.
    vhQuery:set-buffers(vhSessionContext). 
    assign vcQueryPrep = "FOR EACH " + vhSessionContext:table + " WHERE propertyName = '" + icPropertyName + "'" +
                         (if icPropertyQualifier = ? or icPropertyQualifier = "" 
                          then "" 
                          else " AND propertyQualifier = '" + icPropertyQualifier + "'").
    vhQuery:query-prepare(vcQueryPrep) no-error.
    if error-status:error
    then do:
        /*error: query prepare failed*/
        return ?.
    end.
    vhQuery:query-open.

    repeat:
        vhQuery:get-next().
        if vhQuery:query-off-end then leave.
        vcValue = vhSessionContext::propertyValue.
    end.

    vhQuery:query-close().
    delete object vhQuery. 

    return vcValue.
end.
else do:
    /*error: vhSessionContextDS is not valid*/
    return ?.
end.