One of the DSP's superior data solutions in terms of governance is dspCompose. Not only does it allow users to connect and post to an ERP system without prior working knowledge of the system, but it is also powerful and flexible enough to perform in-line data correction and streamline a user's experience into a flawless, easy-to-use interface. Part of that interface is the delegation of duties, in the form of roles, which perform data management and remediation functions separately. The last role that is performed, the Post Role, has two tasks: posting, or loading the data into the ERP system and finishing the remediation request by updating the local copy of the ERP data.
Users may have noticed that the interface for the Post role allows for implementing the Finish portion, prior to posting to the system. Though rare, this can be problematic to new users, who may not be familiar with the precise order of doing things. This tutorial will outline the process required to disable the button that processes the finish functionality, thereby avoiding needless errors in the process. The programming outlined below will also include what would be needed to enable the finish button after a successful posting has occurred.
Two stored procedures will need to be added to the cMass_Data database. The first is used to disable the finish button initially:
USE [cMass_Data]
GO
/****** Object: StoredProcedure [dbo].[webRequestRole_FinishButton_MakeTrueUpd] Script Date: 11/26/2018 4:07:12 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[webRequestRole_FinishButton_MakeTrueUpd]
@RequestID int
AS
BEGIN
SET NOCOUNT ON;
UPDATE [cMass].[dbo].[ttRequestRole]
SET
[Finished] = 'True'
WHERE
RequestID = @RequestID AND
RoleID = 'Post'
END
The second will be used to enable the Finish button after Posting has occurred. NOTE: It will only be activated only if there were no errors in posting.
USE [cMass_Data]
GO
/****** Object: StoredProcedure [dbo].[webRequestRole_FinishButton_MakeFalseUpd] Script Date: 11/26/2018 4:09:33 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[webRequestRole_FinishButton_MakeFalseUpd]
@RequestID int
AS
BEGIN
SET NOCOUNT ON;
DECLARE @p_error int;
SET @p_error = (SELECT TOP 1 [PostError] From [dbo].[ttINSERT TARGET TABLE NAME HERE] Where RequestID = @RequestID);
IF @p_error = 0
UPDATE [cMass].[dbo].[ttRequestRole]
SET
[Finished] = 'False'
WHERE
RequestID = @RequestID AND
RoleID = 'Post'
END
NOTE: the template's target table (tt[TEMPLATE NAME]) would change, depending on the name of the actual target table being used.
Once those two procedures are in place, it is just a matter of registering the two procedures in the correct places. The first procedure to DISABLE the finish button would occur after the last Review role has approved, or finished, the data in its realm of responsibilities. Therefore, the first stored procedure would be registered as a Finish Role Level Event.
The second procedure that ENABLES the finish button would be registered at the TEMPLATE level. Why is this? Because we only want it to be available upon a successful posting; only AFTER the request has posted. There is no post event at the Role Level in a template. It must therefore be registered as a template level request post event.
With the amazing flexibility of the dspCompose tool, this added functionality can be easily removed simply by removing the two events for each respective procedure. NOTE: These procedures are to be used in conjunction with each other and not separately.
BackOffice Associates offers professional, instructor-led training in an interactive hands-on style. To view the latest schedule of classes currently offered, visit http://www.boaweb.com/company/product-training/
Comments
0 comments