Forwarding to editor view when an element is opened

Hello,

As soon as I want to open an element, the edit view should be opened.
Thats my code so far. But it isn´t working.

if (fd.formType == 'Display'){
var listId = fd.spFormCtx.ListAttributes.Id;
var itemId = result.Id;

          result.RedirectUrl = "https://collaboration.connect.buzziunicem.com/groups/00074/SitePages/PlumsailForms/Create%20BP/Item/EditForm.aspx?item="+ itemId;
          
 }

Best regards
Sternchen

Hello @Sternchen,

Please use this code to redirect users from display to edit form:

var itemId = fd.itemId; 
var listID = fd.spFormCtx.ListAttributes.Id;
window.location.href = 'https://domain.sharepoint.com/sites/sitename/_layouts/15/listform.aspx?PageType=6&ListId=' + listID + "&ID=" + itemId;

I tried your code but I don´t know what to change in the url.
Thats the URL when I edit an element.
https://collaboration.connect.buzziunicem.com/groups/00074/SitePages/PlumsailForms/Change%20BP/Item/EditForm.aspx?item=15
So I changed your code to this. I don´t us the ListID.

window.location.href = 'https://collaboration.connect.buzziunicem.com/groups/00074/SitePages/PlumsailForms/Change%20BP/Item/EditForm.aspx?item=' +itemId;

@Sternchen,

I updated the code for you:

var itemId = fd.itemId; 
var listID = fd.spFormCtx.ListAttributes.Id;
window.location.href = 'https://collaboration.connect.buzziunicem.com/groups/00074/_layouts/15/listform.aspx?PageType=6&ListId=' + listID + "&ID=" + itemId;