Presentation is loading. Please wait.

Presentation is loading. Please wait.

Look Ma, No Hands! Automated Processes

Similar presentations


Presentation on theme: "Look Ma, No Hands! Automated Processes"— Presentation transcript:

1 Look Ma, No Hands! Automated Processes
Client Webinar Series Time to Reach New Heights Look Ma, No Hands! Automated Processes December 14, 2017

2 ATC: DUE ATC: CATCH ATC: SEND
ATC Workflow Scripts Are made up of ATC commands (little snippets of code) Can be triggered through routing or On Create or Save actions Can be used to do many tasks automatically Can be saved in the Workflow Script Library on the System Admin Dashboard More information about ATC Workflow Scripts can be found on support.spitfirepm.com ATC: ALERT ATC: SET ATC: CLOSE ATC: DUE ATC: CATCH ATC:ERRORIF ATC: SETHTML ATC: SEND ATC: TARGET

3 Fill in Fields Based on Who Creates

4 Fill in Fields Based on Who Creates

5 How It Was Done ATC: * The current user should auto fill the prepared by field ATC: SET ResponsibleParty = [DKEY_DocHeader_EditUser] ATC: * Put the first day of the next month into a variable ATC: DUE 0 DAY 1 INTO $StartOn ATC: IF UserHas WORK Purchaser ATC: * current user has the Purchaser responsibility, set appropriate defaults ATC: SET Subtype = PO ATC: SET Source = 10 ATC: * Calculate the end of a month about 60 days from now ATC: DUE 60 DAY 1 -1 INTO $EndOn ATC: * find the commitment date range ATC: TARGET DocDates WITH DocDateTypeKey = 'DED5B6FF-C747-4E96-AA4F-1A010E238214' ATC: * set the range to default to 2 months ATC: SET TargetRow.ActStart = $StartOn ATC: SET TargetRow.ActFinish = $EndOn ATC: ELSE ATC: * we assume a standard subcontract for all other users ATC: SET Subtype = FP ATC: SET DocRevision.CWRetention= 10 ATC: SET Source = 15 ATC: ENDIF

6 Fill in Names and Status

7 How It Was Done ATC: * While its better to have one script work with all projects, you can be very specific ATC: EXIT WHEN Project != GC011 ATC: * Here is a way to assign a person (by key) if they are not on the team ATC: SET SourceContact = f9e025b0-46c9-45e4-a42f-e117c284aad5 ATC: * this is Andy C. ATC: * Much better: use a team bookmark (works on any project) ATC: SET ResponsibleParty = [DKEY_SuperAddr_UserKey] ATC: * Set the status, save a click or two ATC: SET STATUS = O

8 Be Consistent with Fewer Keystrokes

9 How It Was Done ATC: SET $Update = 0 ATC: IF DocDate IsChanging ATC: SET Title = Report for [FddddbMMMbdcbyyyy_DocHeader_DocDate] ATC: SET $Update = 1 ATC: ENDIF ATC: IF DocRevision.csFlag IsChanging ATC: IF DocRevision.csFlag = 1 ATC: * reason is required for a lost day ATC: CATCH FOR 1 SHOW Adverse Condition is required for a lost day! ATC: ERRORIF WHEN Source = ? ATC: SET Title = [DocHeader_Title] (lost day) ATC: ALERT demo TITLE Another Lost Day!; See DFR for details.... ATC: IF $Update = 1 ATC: SAVE ATC: * The qAlias needs the latest values, so we forced the save above ATC: QUERY qFldRptInfo ATC: SET ExternalDocNo = [qFldRptInfo_WSummary] ATC: IF qFldRptInfo.WReadings != 0 ATC: SET DocRevision.RangeFrom = [qFldRptInfo_LowTemp] ATC: SET DocRevision.RangeThru = [qFldRptInfo_HiTemp] ATC: ENDIF ATC: SET DocRevision.csQty = [F0_qFldRptInfo_MTDLostDays] ATC: SET DocRevision.csNumber = [F0_qFldRptInfo_PTDLostDays]

10 Create Docs When Appropriate

11 Create Docs When Appropriate

12 How It Was Done ATC: EXIT WHEN Reason = ? ATC: * nothing to do here ATC: IF Reason IsChanging ATC: * Leave if already have attached incident CatType = '04988BC A7FD-2C98AA1B0D13'; ATC: EXIT HAS DocAttachedFile WITH MailRoute='R' AND FileName LIKE 'Incident*'; ATC: COPY [Safety Incident] * NEW; WITH Link ATC: SET Subtype = [DocHeader_Reason] ATC: SET Title = Incident on [FddddbMMMbdcbyyyy_DocHeader_DocDate] ATC: SET STATUS = O ATC: * save the new doc with the subtype added ATC: SAVE ATC: BookmarkSource NEW ATC: SETHTML $HDR = Please complete the attached <a title="Open" class="sfDocHL" data-key="[DKEY_DocHeader_DocMasterKey]" data-permits="0" href="javascript:$PopDoc();">Safety Incident Report</a>! ATC: SELECT SOURCE ATC: BookmarkSource SOURCE ATC: ADD UIA UserNotification FYI: Safety document attached... ATC: * Top right ATC: ADD UIA DocHeaderMessage $HDR ATC: * popup with link ATC: ENDIF

13 Send Emails w/o Routing Based on a Choice
Presented by HimaBindu Angalakurthi from UC Davis

14 Presented by HimaBindu Angalakurthi from UC Davis
How It Was Done ATC: * If date is not approved, send to that effect ATC: IF REASON = N ATC: SETHTML $Body = Inspection Date Not Approved: [DocRevision_NoteEML] ATC: SEND TO TO DocMasterDetail.SourceContact CC 2 CC 30 SUBJ [DM_DocHeader_Location] Date Not Approved [FdddcbMxdxyybhhXmmbtt_DocHeader_Due]; BODY $Body ATC: ENDIF ATC: * If date is confirmed, send to that effect ATC: IF REASON = Y ATC: SETHTML $Body = Inspection Date Confirmed: [DocRevision_NoteEML] TO DocMasterDetail.SourceContact CC 2 CC 30 SUBJ [DM_DocHeader_Location] [Confirm Date [FdddcbMxdxyybhhXmmbtt_DocHeader_Due]; BODY $Body ATC: SET REASON = ? ATC: * Options TO * (for current Route SEQ), or TO RouteSeq 2 (for Route SEQ 2) Presented by HimaBindu Angalakurthi from UC Davis

15 Workflow in Routes ATC: * This workflow calls the script used to close the document. ATC: CALL OnDFRFinish ATC: CALL CloseDoc ATC: STATUS C

16 Save Extensions Pre-builds list of those likely to be on site from the commitment data! Really easy to just check who is present Can always manually add visitors Uses TSQL and SaveCustomDocExtn rules (see KBA and ) A small extract of the TSQL code follows…..

17 Save Extensions GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].czx_PopulateNewFieldReport') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].czx_PopulateNewFieldReport CREATE PROCEDURE dbo.czx_PopulateNewFieldReport @pDocKey as UniqueIdentifier, @pDocRevKey as UniqueIdentifier, @pUserKey as UniqueIdentifier AS <snip> INSERT SELECT dh.SourceContact ,dh.DocMasterKey ,vu.Company ,dh.DocNo ,'C' FROM dbo.xsfDocHeader dh LEFT OUTER JOIN dbo.xsfUser vu on vu.UserKey = dh.SourceContact WHERE dh.DocTypeKey -- commitments and dh.Project -- AND dh.Subtype = 'SUB' SELECTal.PrimeVendorKey ,al.DMK ,ISNULL(vu.company, ma.AttendeeName) ,al.CNO ,'L' FROM dbo.xsfMeetingAttendee ma al ON al.DMK = ma.DocMasterKey and al.PrimeVendorKey <> isnull(ma.UserKey ,'FF1975FD-76DE-486C-888B-54E8FCD880E0' ) LEFT OUTER JOIN dbo.xsfUser vu on vu.UserKey = ma.UserKey WHERE ma.UserKey is not null or ma.AttendeeName is not null INSERT INTO [dbo].[xsfMeetingAttendee] ([AttendeeKey] ,[DocMasterKey] ,[UserKey] ,[LinkedItemKey] ,[AttendeeName] ,[Reference] ,[Purpose] ,[Amount] ,[csAmount] ,[Resolved] ,[csString060] ,[Present] ,[IsRegular] ,[csCheck] ,[Note]) SELECT NEWID() as AttendeeKey as DocMasterKey ,al.PrimeVendorKey ,null as LinkedItemKey ,vu.Company as AttendeeName ,null as Reference ,null as Purpose ,null as Amount ,null as csAmount ,null as Resolved ,case when al.SourceType = 'L' THEN al.Company ELSE NULL END as csString060 ,0 as Present ,0 as IsRegular ,0 as csCheck ,null asNote al LEFT OUTER JOIN dbo.xsfUser vu on vu.UserKey = al.PrimeVendorKey

18 ATC: QUERY ATC: QUERY qFldRptInfo
QueryConfig and WordTemplateConfig rule group: qxxxx:Alias Runs a TSQL query Hint: Use stored procedures Acts a lot like little reports you can write in Microsoft Word using templates Fields become bookmarks eg [qFldRptInfo_LowTemp] See KBA and KBA and links therein A small extract of the TSQL code on the next slide…..

19 ATC: QUERY … the Query DECLARE @AllowedSummaryLen INT
create procedure pqa_DaySummary @pDocMasterKeyUniqueIdentifier AS -- intended for consumption by word template "qAlias" points to a Daily Field Report doc dh.Project dh.DocDate FROM dbo.xsfDocHeader dh WHERE dh.DocMasterKey declare @summary varchar(999) = '', @cnt int = 0, @min int = 999, @max int = 999 select @cnt + 1 , @min = case when Temperature then Temperature WHEN FeelsLike then FeelsLike end , @max = case when Temperature then Temperature WHEN FeelsLike then FeelsLike end + case when CHARINDEX(wr.Conditions ) = 0 THEN case when > 0 then ', ' ELSE '' END + wr.Conditions ELSE '' END from dbo.xsfWeatherReading wr join dbo.xsfWeatherLocation wl on wr.WeatherLocationKey = wl.WeatherLocationKey join dbo.xsfProject xp on xp.Zip = wl.LocationCode where project and = 0 = 0 BEGIN = 'No readings today' END INT = 56; IF = ,'Light ','Lt.') IF = ,' ','') IF = as as as as WSummary , count(*) as PTDReports , SUM(case when IsSameMonth = 1 then 1 else 0 end ) as MTDReports , SUM( DaysLost ) as PTDLostDays , SUM( case when IsSameMonth = 1 THEN DaysLost else 0 end ) as MTDLostDays FROM ( select dh.DocMasterKey ,case when ISNULL(section,'') <> '' AND ISNUMERIC(section) = 1 then cast( section as money) when vv.csFlag = 1 THEN 1 ELSE 0 end as DaysLost ,case when DateDiff(month,DocDate ) = 0 then 1 else 0 end as IsSameMonth FROM dbo.xsfDocHeader dh join dbo.vsf_RevisionInfo vi on vi.DocMasterKey = dh.DocMasterKey join dbo.xsfDocRevision vv on vv.DocRevKey = vi.DocRevKey WHERE DocTypeKey = 'FE43472F-5FBD B-216FC34370F0’ and project and DocDate ) dfrSummary

20 (Note that we are taking a break in January)
Next Topic Follow the Money… February 8 1:00 pm EST (Note that we are taking a break in January)


Download ppt "Look Ma, No Hands! Automated Processes"

Similar presentations


Ads by Google