1

I know I can use {ItemId} to pass it to the URL like so:

<UrlAction Url="~site/_layouts/ConvertItem/ConvertItem.aspx?ListId={ListId}&amp;ItemId={ItemId}&amp;ItemUrl={ItemUrl}"/>

However, I am using JavaScript exclusively. Can I get the ItemID using JavaScript?

<UrlAction Url="javascript:function copyListItems() { res = SPListItemCopy.Resources[_spPageContextInfo.currentLanguage];var listItemID = {ItemId};var listId = {ListId};var context = SP.ClientContext.get_current();var list = context.get_web().get_lists().getById(listId);var item = list.getItemById(listItemID); ..."/>

1 Answer 1

1

I think the token should be getting replaced anyway, is you second example not working ? also you might nee to wrap the vars with single quotes like var listId = '{ListId}' also your JavaScript functions is not self calling, I think it should be javascript: function copyListItems(){}()

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.