web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Disable a custom button in contact form until a date filed is updated.

(0) ShareShare
ReportReport
Posted on by 235

Hello CS Experts,

I have placed a custom button in contact form using Ribbon Workbench and attached a Javascript on it. It is working as expected. However, I want the button to remain disabled when a contact record is created. This button will only get enabled after a date field in the form is updated.

I tried to create an Enable rule, but it is not working.

Here is the screenshot of the field that must be updated so that the button can get enabled: the GDPR Deletion Date should be updated, then the Revoke GDPR Consent button shall be enabled.

pastedimage1662010532525v1.png

Below is my Ribbon Workbench:

pastedimage1662010731456v2.png

Please help!

Best regards,

Jolas365

  • Suggested answer
    Rahuldubey Profile Picture
    105 on at

    You need to do a few tries as you have two enable rules

    1. if the record is created, this should be achievable through OOB rules, form type is 2 enable the button

    2. on the change of date field, you need to write custom js to check if the field is changed, which is checking if your date field is dirty, i suggest keeping a flag on the form and on the change of date field, mark this flag as yes and keep the enable rule to enable this button if the flag is turned to Yes also don't forget to mark flag any on save , so every time you open existing form by default flag stays no and button remains disabled

    also after marking flag yes, you need to refresh ribbon, below is pseudo-code

    Function onChangeDatefield()

    {

     update flag "enableribbonbutton" to Yes

     refresh form ribbon

    }

    Function onSave()

    {

     update flag "enableribbonbutton" to No

     refresh form ribbon

    }

    Hope this help to fix the functionality

  • Jolas365 Profile Picture
    235 on at

    Hello Rahuldubey ,

    Will the flag be a new field in the entity or a variable?

    The requirement has somewhat changed.

    On form load of Contact form, the custom button will not be visible.

    It will only get visible once the user updates the value of GDPR Deletion Date field, which is of type DateTime.

    However, I have a workflow that will update the Contact record after GDPR Deletion Date is filled up.

    Now, the question is: How do I update the datefield only? After this field is updated, the custom button will now become visible. Then I will click the button to update the other fields.

    Regards,

    Jolas365

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 58 Most Valuable Professional

#2
Travis South Profile Picture

Travis South 37

#3
ParthPatel249 Profile Picture

ParthPatel249 19

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans