Please forgive me as I imagine this is straight forward for a lot of people, but I'm not from a technical background!
We have recently started using Plumsail Forms as an alternative to Forms Designer following some errors and issues.
In Forms Designer I had some code for OnClick in order to make a specified form open when clicking a button from a display form. The code was as follows -
This doesn't work in Plumsail Forms. We tried using the following to start with but I'm not sure what comes next -
fd.control('Button2').onclick
I can get the first part to work (for example, on click I can get a notification to pop up) but I cannot get it to open a specific edit form from a different form set.
Yes, openForm() function is not available in Plumsail Forms. Instead, you can use a simple redirection on a button click. Please paste this code in the OnClick setting of the button to open the appropriate form set:
//replace "https://domain.sharepoint.com/sites/sitename/subsite" with path to your site
var sitePath = 'https://domain.sharepoint.com/sites/sitename/subsite';
var listName = fd.listUrl.split('/')[2];
var itemId = fd.itemId;
//specify the form set ID
var formSetId = 'c46596f4-3325-43d5-86f9-77fc72d52ad4';
window.location.href = sitePath + '/SitePages/PlumsailForms/' + listName + '/Item/' + formSetId + '/EditForm.aspx?item=' + itemId;