Forum Discussion

Krishna's avatar
Krishna
Valued Contributor
2 years ago

Current Selection Form in WF Profile

Hi - Is there an BRAPI to get the current form name from WF Profile ? I was able to get the list of Forms using the below code but I looking for when a user select the form it should return. Let me know if there any BRAPI functions 

 

Thanks

 

						Dim objBRApiForms As XFFormsForWorkflow  = BRApi.Forms.Metadata.GetForms(si,si.WorkflowClusterPk)
						
					
						'Get the List of Required Forms
						Dim listfrm As  List (Of XFFormSummaryInfo) = objBRApiForms.OptionalForms

 

  • The XFFormSummaryInfo should be the place where you can grab the name of the Form

    This class reveals the properties on the Form template that you can write logic against.  

     

    Hope this helps

    • RobbSalzmann's avatar
      RobbSalzmann
      Valued Contributor II

      Tony,  Can you show us where do we get the reference to the runtime instantiated XFFormSummaryInfo object?  The code above looks like it would yield an Object not set to a reference error.

      • Krishna's avatar
        Krishna
        Valued Contributor
        Dim wfClusterPk As WorkflowUnitClusterPk = BRApi.Workflow.General.GetWorkflowUnitClusterPk(si,"Act_GLLoad.Forms","Actual","2023M1")
        'Get Forms
        Dim objXFFormsForWorkflow As XFFormsForWorkflow = BRApi.Forms.Metadata.GetForms(si, wfClusterPk)
        'Get Required Forms
        Dim objlist As List(Of XFFormSummaryInfo) = objXFFormsForWorkflow.RequiredFor
        
        
        
        For Each objformlist As XFFormSummaryInfo In objlist
        objformlist.Name
        
        Next 
    • Krishna's avatar
      Krishna
      Valued Contributor

      Thanks I already getting the name but it will not change based on the selection. 

    • Kashinath's avatar
      Kashinath
      New Contributor II

      Tony , this code is creating an error , can you please give the reference for the runtime instantiated 'XFFormSummaryInfo' object?

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    Have you tried objBRApiForms..CurrentWorkflowStepStatus to see where you are in the process?

    • Krishna's avatar
      Krishna
      Valued Contributor

      Thanks I will try but I am looking to return the current form name