openForm syntax
What is the proper syntax if I want to use openForm(filename, queryParams) and pass an ID as a query param?
fd.openForm('fd_meetingMinutes_DisplayForm.aspx', ID:9);
fd.openForm('fd_meetingMinutes_DisplayForm.aspx', 9);
With ID as variable: fd.openForm('fd_meetingMinutes_DisplayForm.aspx', ID: myID);
What components are necessary to open a DisplayForm from a different list? and what would the syntax look like?
*Note: the two forms are in different lists!
fd.openForm('fd_meetingMinutes_DisplayForm.aspx', ID:9);
fd.openForm('fd_meetingMinutes_DisplayForm.aspx', 9);
With ID as variable: fd.openForm('fd_meetingMinutes_DisplayForm.aspx', ID: myID);
What components are necessary to open a DisplayForm from a different list? and what would the syntax look like?
*Note: the two forms are in different lists!
var CRID = 1;//or some other way of getting the id for your list item
fd.openForm('path to the list/list name/DispForm.aspx',{ID:CRID, Source:document.URL});
So to sum up:
1. if the form is on another list, don't forget to specify path to the list (relative, or absolute)
2. I doubt your form is named "fd_meetingMinutes_DisplayForm.aspx", It's probably something like "fd_Item_3205351f-1848-4d32-99da-37fde391ec26_Display.aspx", but you can use generic Sharepoint name "DispForm.aspx", and let forms designer open correct form based on user privileges
3. put your parameters into {}. Separate them with "," if there's more than one
Here's an example:
fd.openForm('../Cost Record Log/EditForm.aspx',{ID:CRID, Source:document.URL});
}
fd.openForm('path to the list/list name/DispForm.aspx',{ID:CRID, Source:document.URL});
So to sum up:
1. if the form is on another list, don't forget to specify path to the list (relative, or absolute)
2. I doubt your form is named "fd_meetingMinutes_DisplayForm.aspx", It's probably something like "fd_Item_3205351f-1848-4d32-99da-37fde391ec26_Display.aspx", but you can use generic Sharepoint name "DispForm.aspx", and let forms designer open correct form based on user privileges
3. put your parameters into {}. Separate them with "," if there's more than one
Here's an example:
fd.openForm('../Cost Record Log/EditForm.aspx',{ID:CRID, Source:document.URL});
}
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Please, specify application-relative URL of your form and pass ID in the object:
fd.openForm('/Lists/Custom/DispForm.aspx', {ID: 17})
Open form in a dialog:
fd.openFormInDialog('/Lists/Custom/DispForm.aspx', {ID: 17})
Please, specify application-relative URL of your form and pass ID in the object:
fd.openForm('/Lists/Custom/DispForm.aspx', {ID: 17})
Open form in a dialog:
fd.openFormInDialog('/Lists/Custom/DispForm.aspx', {ID: 17})
You are a Rock Star! Thank you.
My working code:
window.myFunc = function(){
var myID = fd.field('idOfMM').control()._el().text();
var mySource = "https%3A%2F%2Fprivacy%2Esharepoint%2Ecom%2Fsites%2Fmgh%2FLists%2FMeeting%2520Minutes%2FAllItems%2Easpx"
fd.openForm('/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx', {ID:myID, Source:mySource});
}
My working code:
window.myFunc = function(){
var myID = fd.field('idOfMM').control()._el().text();
var mySource = "https%3A%2F%2Fprivacy%2Esharepoint%2Ecom%2Fsites%2Fmgh%2FLists%2FMeeting%2520Minutes%2FAllItems%2Easpx"
fd.openForm('/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx', {ID:myID, Source:mySource});
}
Randomly i start getting this error
Sorry, something went wrong
No item exists at https://private.sharepoint.com/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx?FDSource=https://private.sharepoint.com/sites/mg ... c2bc643d5a. It may have been deleted or renamed by another user.
which is not true.
Sorry, something went wrong
No item exists at https://private.sharepoint.com/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx?FDSource=https://private.sharepoint.com/sites/mg ... c2bc643d5a. It may have been deleted or renamed by another user.
which is not true.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
It seems you didn't pass the ID, I don't see it in your URL. Please, make sure that myID is not empty in your code:
fd.openForm('/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx', {ID:myID, Source:mySource}); }
fd.openForm('/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx', {ID:myID, Source:mySource}); }
I verified with an alert, and received the same error
No item exists at https://hidden.sharepoint.com/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx?FDSource=https://hiddenforprivacy.sharepoint.com ... c2bc643d5a. It may have been deleted or renamed by another user.
No item exists at https://hidden.sharepoint.com/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx?FDSource=https://hiddenforprivacy.sharepoint.com ... c2bc643d5a. It may have been deleted or renamed by another user.
No item exists at https://private.sharepoint.com/sites/mg ... c2bc643d5a. It may have been deleted or renamed by another user.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Please, try to omit Source parameter, pass ID only:
fd.openForm('/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx', {ID:myID});
fd.openForm('/sites/mgh/Lists/Meeting Minutes/fd_meetingMinutes_DisplayForm.aspx', {ID:myID});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 9 guests