Method: Pass the parameters in the URL.
Step 1: Parameter Object
The parameter object attached to the Dashboard or Report Layout must be able to interpret the URL. This can be done in the AfterAdd handler method.
Example:
Protected Overrides Sub AfterAdd()
 Dim strMatterIndex As System.String
 
 ' call stock object after add code
 MyBase.AfterAdd()
 
 ' get matter number from url
 strMatterIndex = System.Web.HttpContext.Current.Request.Item("MatterIndex")
 
 ' if there is a matter index
 If Not String.IsNullOrEmpty(strMatterIndex)
 
  ' set matter index parameter
  Me.Matter.Value = CInt(strMatterIndex)
  
  ' auto submit parameters
  CType(Me, IParamObject).IsAutoSubmitParamObject = True
 Else
  ' don't auto submit parameters
  CType(Me, IParamObject).IsAutoSubmitParamObject = False
 End If
End Sub
Step 2: Launching Object
Create a URL Action on the launching Object and implement the Execute function.
Return the URL for the Dashboard or Report Layout with the required parameters appended.
Example:
Protected Overrides Function Execute() As System.String
 If Me.Owner.Matter.IsNull Then
  Return Nothing
 Else
  Return String.Format("{0}&SID={1}&MatterIndex={2}", _
   Me.UrlMgr.GetDashboardUrl("IM_ENQUIRY_MATTER"), _
   Me.UserMgr.SessionID, Me.Owner.Matter.Value)
 End If
End Function
Step 3: Action
Add the URL Action to a UI element.
 
No comments:
Post a Comment