Skip to main content
January 19, 2026
Solved

Throw error when Clear/Deleting file in WF Import using TR event handler

  • January 19, 2026
  • 2 replies
  • 0 views

Hi,

I have been playing around with TransformationEventHandler and one of the things I am trying to do is throw an error when an user tries to clear imported/stage data. I think I got the code but I only want it to run on specific WF. I tried to use below but for some reason not able to retrieve the WF profile name. Any idea why?

Case Is = BREventOperationType.Transformation.ParseAndTrans.StartClearData
 
Dim ScenarioName As String = BRApi.Finance.Members.GetMember(si, dimType.Scenario.Id, si.WorkflowClusterPk.ScenarioKey).Name
 
If ScenarioName = "Forecast" Then
 
Dim objTransformer As Transformer = DirectCast(args.Inputs(0), Transformer)
If objTransformer.WorkflowProfile.Name.XFEqualsIgnoreCase("AAAAA.BBBBB") Then
 
Throw New XFException(si, Nothing, Nothing, "Data cannot be deleted.....")
End If
 
End If
Best answer by rhankey

You can use the following to get the WF info while in the TrasformationEventHandler:

Dim WFInfo As WorkflowProfileInfo=BRApi.Workflow.Metadata.GetProfile(si,si.WorkflowClusterPk.ProfileKey)

 

2 replies

rhankeyAnswer
January 19, 2026

You can use the following to get the WF info while in the TrasformationEventHandler:

Dim WFInfo As WorkflowProfileInfo=BRApi.Workflow.Metadata.GetProfile(si,si.WorkflowClusterPk.ProfileKey)

 

MikkiAuthor
January 19, 2026

Thank you. Above worked.