Fd.clear(); Not clearing form

We've just noticed an issue with a form that has been running well for months, is now not rendering correctly if we use fd.clear();

We show and hide fields based on class and from this morning, three of these 'show/hide' classes don't work if fd.clear(); is in the JS.

Is there another way to clear the form - I mainly use this so that if the page is refreshed, the form is cleared.

This is how I was using fd.clear

fd.spRendered(function() {

    fd.field('ITSupplier').ready().then(function () {
        // sort lookup values
        fd.field('ITSupplier').orderBy = { field: 'Title', desc: false };

Thank you

Hello @SClacherty1,

How do you show and hide fields? Are you using the code? Please share it so we could reproduce the issue.

Hi @mnikitina

I'm not 100% sure I am answering correctly.

 //Enter this invoice into Total Synergy
    function showHideTSNo() {                                                     
    if(fd.field('TSEntry').value === 'I need someone to do it') {                 
    else {
    //Is the invoice relating to a vehicle 
    function showHideVehicleY() {          
    if(fd.field('Vehicle').value === 'Yes') {
    else {

    // Calling functions on form loading

And then entering class into General on the display view
Plumsail screenshot 01022021

Also, clearly I have commented out the fd.clear(); because it stopped working. I had meant to remove the // when I posted :frowning:


Does the code that show/hides fields work fine without clearing the form with fd.clear();?

Are we talking about New or Edit form?

Hi @mnikitina

Yes, the show hide works fine without the fd.clear(); - it's currently functioning well - I would just like the form to empty when it is refreshed. It is on the New form.


Thank you for the details!

Developers confirmed that this is a bug. I will let you know as soon as it is fixed.


As a temporary workaround, you can use this code to clear the form:

fd.spRendered(function() {
    //Your code is here

Thank you @mnikitina
The workaround works :grinning:

1 Like