Forum Discussion

Davy's avatar
Davy
Contributor
3 years ago

view the POV of the datacell executing BusinessRule.DashboardStringFunction XFBR business rule?

How do I view the POV of the datacell executing BusinessRule.DashboardStringFunction XFBR business rule? I think I can run this statement: Dim viewMember As ViewMember = ViewMember.GetItem(api.Pov....
  • ChristianW's avatar
    ChristianW
    3 years ago

    It is an UD8 member formula and it has to be used together with a text view member like annotation:

     

     

    The member formula might look like this:

    ' Test if the cell is a text-based dataCell.
    If api.View.IsAnnotationType() Then
    	'Has the cell a cell text or an attachement?
    	If Not api.Data.HasDataAttachments("O#Forms:V#Periodic:Ud8#None") Then
    		'Retrieves the cells to test		
    		Dim amount As DataCell = api.Data.GetDataCell("O#Top:V#Periodic:UD8#None")
    		Dim budget As DataCell = api.Data.GetDataCell("O#Top:V#Periodic:UD8#None:S#BudgetV2")
    		'Calculate the variance percent
    		Dim variance As Decimal = (amount.CellAmount - budget.CellAmount  ) / budget.CellAmount
    
    		'Is there a negative variance?
    		If variance < 0 Then
    			Return "<== Explantion Required"
    		Else 
    			Return Nothing
    		End If
    	Else
    		Return Nothing		
    	End If
    End If
    
    Return Nothing