Bulk Update using Excel Binary File And Activity
Hi All,
In this blog we will see how we can use binary excel file and activity for bulk update.
Follow Below Steps:-
Create Excel file having following columns.
In excel, in first row put following headings:- Case ID , T Event ID, T Name, Quarter, ExpectedTDate,
TStatus,
In second row put following
{.pxResults().pyID}
{.pxResults().TUEventID}
{.pxResults().TUName}
{.pxResults().TrueUpQuarter}
{.pxResults().ExpectedTUDate}
{.pxResults().TUStatus}
Create Activity now
Step 1 First Create Activity
ID = TUpdate
CL = Data-Portal
Step 2 Define Pages & Classes
UploadPage Code-Pega-List
UploadPage.pxResults C-C-Art-Work-T
WorkObjectToCreate C-C-Art-Work-T
TUDeliverables Index-C-C-Art-Data-DeliverablesList
FinalTUWorkPage C-C-Art-Work-T
Step 3 Define Steps in Activity
1) Page-New Step page = UploadPage
2) Call pxParseExcelFile Step page = UploadPage
*FSFileName = @trim(pxRequestor.pyFileUpload)
*TemplateRFB = Art!TUpdate!XLSX
3) Loop = For each embedded page
Property-Set Step Page = UploadPage.pxResults
Param.amanager = .AManager
Param.cuser = .CUSER
Param.amanager1 = .AManager1
Param.cuser1 = .Cuser1
Param.cmanagerid = Cmanagerid
Param.case = .pyID
3.1) Page-New StepPage = WorkObjectToCreate
3.2) Page-New StepPage = TUDeliverables
3.3) Property-Set StepPage = TUDeliverables
.DDate = UploadPage.pxResults(<CURRENT>).ExpectedTUDate
.DName = "T-Report"
.TName = UploadPage.pxResults(<CURRENT>).TName
.DNotes = UploadPage.pxResults(<CURRENT>).DNotes
.ReportID = UploadPage.pxResults(<CURRENT>).TEventID
.pxInsIndexedKey = "C-C-ART-WORK"+UploadPage.pxResults(<CURRENT>).pyID
.pxIndexPurpose = "Index_DeliverablesList"
.pxIndexCount = @whatComesAfterLast(UploadPage.pxResults(<CURRENT>).TEventID,'-')
.TQuarter = "FY22Q2"
3.4) Property-Set Step Page = WorkObjectToCreate
.CID = UploadPage.pxResults(<CURRENT>).pyID
.CKey = "C-C-ART-WORK"+UploadPage.pxResults(<CURRENT>).pyID
.TQuarter = UploadPage.pxResults(<CURRENT>).TQuarter
.pyID = UploadPage.pxResults(<CURRENT>).TEventID
.pxInsName = UploadPage.pxResults(<CURRENT>).TEventID
3.5) Call svcAddWorkObject Step Page = svcAddWorkObject
FlowType = pyStartCase
workPage = FinalTUWorkPage
3.6) Call UpdateStatus Step Page = FinalTUWorkPage
*StatusWork = OPEN-NOTSTARTED
3.7) Call commitWithErrorHandling Step Page = FinalTUWorkPage
3.8) Call Save Step Page = TUDeliverables
3.9) Call CommitData Step Page = TUDeliverables
4) Page-Remove Step Page = UploadPage
Thank you!! Will see you all in next blog post 😊.
Comments
Post a Comment