1
votes

I need to open a new list item form on hyperlink, or button click, in a Sharepoint 2010 page. The page and the list are in different site collections. I must do this from the Sharepoint Designer, or directly editing the page in a browser, Visual studio project is not possible/allowed...

Can this be done, and how?

1

1 Answers

2
votes

P.S. Most safe way to address New form is to use ListForm.aspx page, as follows:

 /_layouts/listform.aspx?PageType=8&ListId={PUT-LIST-GUID-HERE}

(PageType value goes from PAGETYPE enumeration)

i think you should be work when use PAGE_NEWFORMDIALOG : New form for a file dialog box.Value=9 as describe on msdn. if New form is not open on model pop up than

Try this :

HyperLink

 <a href='javascript:;' onclick='Opendialog()'>New Item</a>

Opendialog is Javascript Function

   function Opendialog() {
       var options = SP.UI.$create_DialogOptions();
       options.resizable = 1;
       options.scroll = 1;
       options.url = SiteURLWhichExistList + "/_layouts/listform.aspx?PageType=8&ListId={PUT-LIST-GUID-HERE}";
       options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
       SP.UI.ModalDialog.showModalDialog(options);
   } 

Note : SiteURLWhichExistList pass your site collection url in where your list exist.

Hope it helps!!