project QadFinancials > class BMfgControlWorkTable > method DeleteRoleFromCanRun


Parameters


icRoleNameListinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BRole.AdditionalUpdates


program code (program3/bmfgcontrolworktable.p)

/*If oiReturnStatus = 0
Then Assign oiReturnStatus = -98.

/* ========================================================================== */
/* Check first to see if replication is enabled - replication can be disabled */
/* for conversion routines that need to replicate data from logistics to      */
/* financials.                                                                */
/* ========================================================================== */
<M-6 run IsReplicationEnabled (output vlReplicationEnabled (olReplicationEnabled), 
                               output viFcReturnSuper (oiReturnStatus)) in BMfgControlWorkTable>
If viFcReturnSuper <> 0
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
Then Return.                              
if vlReplicationEnabled then do: 

<M-1 run ClearData (output viFcReturnSuper (oiReturnStatus)) in BMfgControlWorkTable>
If viFcReturnSuper <> 0
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
Then Return.

Assign vcFreeForm = '':U.
Repeat viCounter = 1 To Num-entries(icRoleNameList):
    Assign vcRoleName = Entry(viCounter, icRoleNameList).
    
    If vcFreeForm = '':U
    Then Assign vcFreeForm = 'For Each mfc_ctrl Where mfc_ctrl.mfc_field = "vqc_userids" And (mfc_ctrl.mfc_char matches "*':U + vcRoleName + '*"':U.
    Else Assign vcFreeForm = vcFreeForm + ' Or mfc_ctrl.mfc_char matches "*':U + vcRoleName + '*"':U.
    
End.
Assign vcFreeForm = vcFreeForm + ')':U.
   
<M-2 run DataLoad (input  '' (icRowids), 
                   input  '' (icPkeys), 
                   input  '' (icObjectIds), 
                   input  vcFreeForm (icFreeform), 
                   input  False (ilKeepPrevious), 
                   output viFcReturnSuper (oiReturnStatus)) in BMfgControlWorkTable>
If viFcReturnSuper = -4
Then Do: 
    Assign oiReturnStatus = 0.
    Return.
End.                                      
If viFcReturnSuper <> 0 
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
Then Return.          
    
Repeat viCounter = 1 To Num-entries(icRoleNameList):
    Assign vcRoleName = Entry(viCounter, icRoleNameList).
    For Each tmfc_ctrl:
        If Lookup(vcRoleName, tmfc_ctrl.mfc_char) > 0 
        Then Do:
            Assign Entry(Lookup(vcRoleName, tmfc_ctrl.mfc_char), tmfc_ctrl.mfc_char) = '':U.
            Assign tmfc_ctrl.mfc_char = Trim(REPLACE (tmfc_ctrl.mfc_char, ',,':U, ',':U), ',':U)
                   tmfc_ctrl.tc_Status  = 'C':U.    
        End.    
    End.   
End.

<M-3 run ValidateBC (output viFcReturnSuper (oiReturnStatus)) in BMfgControlWorkTable>
If viFcReturnSuper <> 0
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
Then Return.    

<M-4 run AdditionalUpdates (output viFcReturnSuper (oiReturnStatus)) in BMfgControlWorkTable>
If viFcReturnSuper <> 0
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
Then Return.    

<M-5 run DataSave (output viFcReturnSuper (oiReturnStatus)) in BMfgControlWorkTable>                        
If viFcReturnSuper <> 0
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
Then Return.    

End. /*if vlReplicationEnabled then do: */

If oiReturnStatus = -98
Then Assign oiReturnStatus = 0.
*/