project QadFinancials > class BSharedSetMerge > method MergeValidateLoadProfDataProject


Parameters


iiMasterSharedSetIdinputinteger
iiRedundantSharedSetIdinputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BSharedSetMerge.MergeValidateLoadProfData


program code (program6/bsharedsetmerge.p)

/* =================================================================================================== */
/* Method      : MergeValidateLoadProfDataProject                                                      */
/* Desc        : This method reads referenced profile data from all elements of Project shared sets.   */
/* --------------------------------------------------------------------------------------------------- */
/* Params:  (I)  MasterSharedSetId    Id of the master shared set                                      */
/*          (I)  RedundantSharedSetId If of the redundant shared set                                   */
/* =================================================================================================== */

assign oiReturnStatus = -98.

/* ================================================================================== */
/* Project Profile                                                                    */
/* ================================================================================== */
<Q-16 run ProjectForSSMProf (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiMasterSharedSetId, (MasterSharedSetId)
    input iiRedundantSharedSetId, (RedundantSharedSetId)
    output dataset tqProjectForSSMProf) in BProject > 
 
for each tqProjectForSSMProf:
    create tProfileSharedSetData.
    assign tProfileSharedSetData.tcKeyValue            = tqProjectForSSMProf.tcRedundantProjectCode
           tProfileSharedSetData.tcFieldName           = "Profile.ProfileCode":U
           tProfileSharedSetData.tcProfileCode         = tqProjectForSSMProf.tcProfileCode
           tProfileSharedSetData.tcMasterFieldValue    = tqProjectForSSMProf.tcMasterProjectCode
           tProfileSharedSetData.tcRedundantFieldValue = tqProjectForSSMProf.tcRedundantProjectCode.
end.

/* ================================================================================== */
/* Project - DivisionProfile                                                          */
/* ================================================================================== */
assign vcProfileFieldName = 'DivisionProfile_ID':U.
 
<Q-13 run ProjectForSSMProfDivision (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiMasterSharedSetId, (SharedSetId)
    output dataset tqProjectForSSMProfDivision) in BProject >

for each tqProjectForSSMProfDivision:
    create tMasterProfileSharedSetData.
    assign tMasterProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tMasterProfileSharedSetData.tcKeyValue                 = tqProjectForSSMProfDivision.tcProjectCode
           tMasterProfileSharedSetData.tcProfileCode              = tqProjectForSSMProfDivision.tcProfileCode   
           tMasterProfileSharedSetData.tcProfileTargetKeyValue    = tqProjectForSSMProfDivision.tcDivisionCode
           tMasterProfileSharedSetData.tiProfileTargetSharedSetId = tqProjectForSSMProfDivision.tiDivisionSharedSet_ID.
end.


<Q-14 run ProjectForSSMProfDivision (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiRedundantSharedSetId, (SharedSetId)
    output dataset tqProjectForSSMProfDivision) in BProject >

for each tqProjectForSSMProfDivision:
    create tRedundantProfileSharedSetData.
    assign tRedundantProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tRedundantProfileSharedSetData.tcKeyValue                 = tqProjectForSSMProfDivision.tcProjectCode
           tRedundantProfileSharedSetData.tcProfileCode              = tqProjectForSSMProfDivision.tcProfileCode   
           tRedundantProfileSharedSetData.tcProfileTargetKeyValue    = tqProjectForSSMProfDivision.tcDivisionCode
           tRedundantProfileSharedSetData.tiProfileTargetSharedSetId = tqProjectForSSMProfDivision.tiDivisionSharedSet_ID.
end.

/* ================================================================================== */
/* Return                                                                             */
/* ================================================================================== */
if oiReturnStatus = -98 then assign oiReturnStatus = 0.