Custom Save buttons No Longer Working

I have tried to fix this and two other buttons, with no success. Plain text reformatting, as well as manually typing - still adding double quotes where single quotes are typed.

fd.spBeforeSave(function() {
fd.field('requestreview').value = 'SAVE - Come Back Later';
});

fd.save();

OnClickJSButton

UPDATE:

When I remove the fd.save(); the error, I can save without closing, but it I keep the fd.save(); in place, I get the longer error in the screenshot above, or this: "Cannot set property 'value' of undefined"

@shedev,

In button's Onclick you need to use return fd.save() to save the form. Please find the updated code below.

fd.field('requestreview').value = 'SAVE - Come Back Later';
return fd.save();

Margarita,

Thank you as always for your stellar help. You are appreciated.

I am still seeing the "Cannot set property 'value' of undefined" error. I am perplexed because this worked until recently (a few days ago), so I am trying to figure what conflicting field or code is causing the error.

Do you see any glaring issues with my settings/code?

ClickError

CSS_Styles

JS_Empty

I figured this out. I removed the field and replaced it. The custom save buttons are working now.

1 Like

Hello Shedev,

I am using Plumsail forms with SharePoint Online list.

I am facing similar kind of issue i.e. getting the same error "Cannot set property 'value' to undefined" when I click on save button (Default SharePoint button).

Please let me know your work around in detail.

Hello @Dil,

Do you have any custom code?

Are you getting errors in the browser console (F12)?
Please share the screenshot.

Hello @mnikitina,

Thanks for your reply.

Yes, I do have custom code.

In my case, I was receiving error because I did not add "SharePoint field" in Plumsail form and was trying to assign value while saving a form.

Plumsail form was unable to assign value to this filed as it is not added in form.

I have added the field in Plumsail form and disabled for editing, it worked for me.

1 Like

@Dil,

Yes, the field should be present on the form to change its value.

You can also hide the field using the code:

$(fd.field('Title').$parent.$el).hide();
1 Like