Loading...

Sharing Results Between Custom Actions

Sharing Results Between Custom Actions

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #5485
      Anonymous
      Anonymous
      Participant

      Hi

      The ActionName is not the custom action class name, though it could be, but it should refer to the action name you specify when you configure the action item. This is illustrated in the screen shot below.

      action.png

      Hope this helps.

    • #5608
      Anonymous
      Anonymous
      Participant

      Thanks …

      I have updated my custom actions with the correct names as you have described but I am not seeing the expected URL in the second action…

      First Custom Action – Copy Doc Link (CopyLinkCustomActionName)

      actionResult.OutParameters["URLDocLink"] = System.Web.HttpContext.Current.Request.Url.ToString();

      Second Custom Action – Paste Doc Link

      object val1 = context.GetActionResult("CopyLinkCustomActionName.OutParameter.URLDocLink");

      Both actions are on the same qListForm…should it be possible to use this across different Forms?

      Regards

    • #5609
      Anonymous
      Anonymous
      Participant

      Hi

      The code you have looks good to me. I ran a quick test in my environment and find it is working fine. I basically copied the pleCustomActionEx.cs and made pleCopyCustomActionEx.cs and plePasteCustomActionEx.cs.

      The first action class Perform method is simple: just create an ActionResult, set the OutParameters and return the ActionResult.

      The second action class retreive the parameter the same way you did. Just make sure ActionName part matches what you defined when configuring the first action.

      As long as all chained actions within the same listform and in specific order (First action first which sets the action result and the second action follows to retrieve the parameter), this should work. It does not work across different forms.

    • #4511
      Anonymous
      Anonymous
      Participant

      Hi,

      I have two custom actions to create form doclinks – one to copy data such as the form URL and items and another that is used to paste it in to a rich text field.

      Using this section from QAPPS help guide I am trying to access the result data from the first action in the second action…I am not able to see the actionresult data in the

      second custom action…I have tried both RawData and OutParameters…is the name used for the ‘ActionName’ exactly as it is in the code…

      For example – my custom action starts with –

       

      public class PasteLinkAction : ICustomActionEx

      So is the ActionName I use should be – PasteLinkAction

      Regards

      /* The following code shows you how you can store the result from this action to be used by another action

      * in the chain of actions of the ActionItem. The lines are commented out because they are not really used

      * in this action. It is for illustration purpose only.

      *

      * You have two ways to store the data. First, you can store the data as RawData in the actionResult. Here is an example:

      actionResult.RawData = someData;

      * You can also store the data as key-value pairs in the OutParameters of the actionResult. Here is an example:

      *

      actionResult.OutParameters[“Name”] = someData;

      */

      /* The following code shows you how you can use the result from another action. The lines are

      * commented out because they are not really used in this action. It is for illustration purpose only.

      *

      * You can access the RawData that comes from another action the following name.

      * ActionName – this is the name of the action that stores the result.

      * RawData – use this specifier to get the RawData

      *

      object rawData = context.GetActionResult(“ActionName.RawData”);

      * You can also access the key-value pairs in the OutParameters by using the following specifier:

      * ActionName – this is the name of the action that stores the result.

      * OutParameter – use this specifier to get to the OutParameters key-value pairs

      * Name – the key for the value in the OutParameters key-value pairs

      object val = context.GetActionResult(“ActionName.OutParameter.Name”);

      */

      return actionResult;

    • #5610
      Anonymous
      Anonymous
      Participant

      Hi ,

      Thank you for the answer…although this now works I was trying to create doclink buttons across different forms using this method which as you point out is not possible.

      I will try to do something similar using a qListView…

      Regards

Viewing 4 reply threads

You must be logged in to reply to this topic.