Manage the ID of a custom action item in SharePoint

I added a custom action to the CustomList type. For testing purposes, I would like to use my new custom actions with our test harness. Unfortunately I don't know how I can create an ID for my custom menu item.

Here is an example (XPath expression) for the Delete Item option:

/body/div/div/table/tbody/tr[@id='mp10_0_2']/td/table/tbody/tr/td[@id='ID_DeleteItem']/label/div/span[1]

      

And here's what for my custom action:

/body/div/div/table/tbody/tr[@id='mp13_0_6']/td/table/tbody/tr/td[@class='ms-MenuUILabel']/div/span[1]

      

As you can see, the second example (my custom action) contains the @class attribute, but no @id (which I would like to set when setting my custom action).

How can I specify the id attribute (which is displayed in HTML) for my custom action?

0


a source to share


1 answer


If it's just for testing, you probably don't want to dig into the internals of SharePoint to gain control over the identity. You should be testing for the presence of an item labeled "Delete Item", not one with a specific ID.



+2


a source







All Articles