Loading...

Custom qlist Action Button

Custom qlist Action Button

  • This topic is empty.
Viewing 16 reply threads
  • Author
    Posts
    • #5507
      Anonymous
      Anonymous
      Participant

      Hi Naman,

        Please check the installation folder and you'll see a folder called Sample Code that contains a fully working custom action Visual Studio solution.

      Please take a look, modify it accordingly to your scenario and try it out.

      Let me know how it goes.

    • #5553
      Anonymous
      Anonymous
      Participant

      Hello ,

      I am basicaly using a qlist view web part and I am able to get the ID's of selected items.

      I have added a custom action that now prints the message of selected id's.Now in that same Custom Action I want to add a new action item for e.g Go to URL and in that add parameter and select ReturnFromAction in the source.So in that what should be the value of Source and Name.

      I am storing the selected ID's like this

       

      actionResult.OutParameters[

      "SelectedIDs"

      ] = itemIDs;

      The Name of my custom action is ID,so I tried with 'ID' as Source and 'SelectedIDs' as Name which returned me an error of object refrence not set to an instance of object.

      Please guide further with this.

      Regards,

    • #5554
      Anonymous
      Anonymous
      Participant

      Hello ,

      Please find the attched the document containing scenario details.

      We have created a normal custom list having ID and Title column.

      Regards,

    • #5555
      Anonymous
      Anonymous
      Participant

      Can you please attach the wp and list template and a document where you describe your scenario in more details.

      Thanks,

    • #5557
      Anonymous
      Anonymous
      Participant

      Hi Naman,

        This is what did to make it work:

      – renamed the Toolbar Button ID from SelectID to MenuSelectID

      – renamed the 1st Action in the sequence from SelectID to ActionSelectID

      I did the above because you used the same ID for the menu and for the action and that can cause confusion.

      -for the 2nd action (GoToUrl) use the following for the source name ActionSelectID.RawData and then name is the url parameter that will be appended after the URL MyIDs you specify right after the Type of the action GoToURL

      I selected 1 item and then hit teh custom action menu option and that redirects me to http:../start.aspx?MyIDs=3;

      Please let me know how it goes.

    • #5556
      Anonymous
      Anonymous
      Participant

      Hello ,

      Please find attached the document containing all the details.

      We have created a normal custom list having ID and Title column.

      Regards,

    • #5563
      Anonymous
      Anonymous
      Participant

      Hi Naman,

        I double checked the scenario and I verified the configuration in my env. and indeed it works fine.

        What's your QuickApps and SharePoint versions?

    • #5558
      Anonymous
      Anonymous
      Participant

      Hello ,

      I hade tried the approach you have mentioned above earlier also.

      As mentioned by you I tried again by changing the ID of Toolbar button and changing the name of action also.

      But after I save the Quest qlist View web part it returns

      The following error occurs: Object reference not set to an instance of an object

      Regards,

    • #5559
      Anonymous
      Anonymous
      Participant

      Did you implement this part?

      -for the 2nd action (GoToUrl) use the following for the source name ActionSelectID.RawData and then name is the url parameter that will be appended after the URLMyIDs you specify right after the Type of the action GoToURL

      Also your code has an issue, move the line actionResult.RawData = itemIDs; out of the if statement where it is.

      Did you try to debug the code? Maybe the error is thrown in your code before hitting the web part.

      I can send you my web part and my list template.

    • #5560
      Anonymous
      Anonymous
      Participant

      Hello ,

      Yes I tried the approache mentioned by you.

      Yes I did debug the code.

      I was able to print the ID's of selected items when the button was pressed.

      I also trigerred the WF from the same code for the ID's selected.

      But when I add the second action of type ReturnFromAction I get this error.

      It would be great if you can share your web part and code snippet along with the list template.

      Regards,

    • #5561
      Anonymous
      Anonymous
      Participant

      This is the code

      public ActionResult Perform(CustomActionContext context, CustomActionCancelEventArgs evt)

              {

                  ActionResult actionResult = new ActionResult();

                  if (context.Items == null || context.Items.Count == 0)

                  {

                      evt.Cancel = true;

                      // you may construct a simple message for popup message or html text if message will be shown as inline

                      evt.Message = "There is no item to validate.";

                      return actionResult;

                  }

                  SPListItem item = null;

                  StringBuilder itemIDs = new StringBuilder();

                  IEnumerator enumerator = context.Items.GetEnumerator();

                  while (enumerator.MoveNext())

                  {

                      item = enumerator.Current as SPListItem;

                      if (item != null)

                      {

                          itemIDs.Append(item["ID"] + ";");

                      }

                  }

                 

                  actionResult.RawData = itemIDs;

                  return actionResult;

              }

      This is the custom action

      <CustomActions>

        <ContextMenu />

        <Toolbar>

          <ActionItem ID="SelectID1" Text="SelectID/Delete">

            <Action Name="Action1" Type="Custom" OpenURL="CurrentWindow" class="MyCompany.DevStudio.pleCustomActionEx, MyCompany.DevStudio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=451cac61f7ec4225" />

            <Action Name="Start" Type="GoToURL" URL="http://sp22:63/default.aspx" OpenURL="NewWindow">

              <Parameter Name="OrderID" Source="ResultFromAction" SourceName="Action1.RawData" />

            </Action>

          </ActionItem>

        </Toolbar>

      </CustomActions>

      and teh list is a custom list with no extra fields.

      Please let me know how it goes.

    • #5562
      Anonymous
      Anonymous
      Participant

      Hello NIc,

      I tried the same with above snippet still I am getting the same object Refrence not set to Instance of the object.

      Please gyuide further.

      Regards,

    • #5564
      Anonymous
      Anonymous
      Participant

      Hello ,

      We are having Sharepoint 2010 and Quest 5.7 Product version.

      Please provide suggestions on how to resolve this issue.

      Regards,

      .

    • #5565
      Anonymous
      Anonymous
      Participant

      I got the same error using 5.7.

      Do you have any plans to upgrade?

    • #5566
      Anonymous
      Anonymous
      Participant

      Hello ,

      Yes we are in the progress to update it product versiob 6.2

      Regards,

    • #4503
      Anonymous
      Anonymous
      Participant

      Hi Team,

      I was trying to create a custom qlist action button and store the result of the action and use it in another action that will be executed after that.

      But I am getting an error/exception that The key is not present in the IDictionary.

      I was following the below mentioned link.

      http://documents.software.dell.com/DOC18582

      It would be great if the team can provide any link or examples to the same topic for creating custom qlist action.

      Thanks,

    • #5567
      Anonymous
      Anonymous
      Participant

      I'm glad to hear that, I used 6.2 to recreate your scenario and it worked.

Viewing 16 reply threads

You must be logged in to reply to this topic.