Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

JavaScript to remove the values on a partylist?

(0) ShareShare
ReportReport
Posted on by

Can anyone help me out with the code to clear the required attendees field on an appointment?  I have a workflow doing this, but I'd prefer to clear it when the appointment form loads since the workflow won't work for a recurring appointment.  I'm on 2016 online.

Thanks!

*This post is locked for comments

  • RE: JavaScript to remove the values on a partylist?

    Thanks to Tim, I did finally get this to work.  I had tried my script on the Appointment form but did the vast majority of my testing on the Recurring Appointment form.  After replicating Tim's script to the letter on the Appointment form, I was finally able to get it to work so there must have been a spacing issue none of us spotted.  However, when I added the same function to the Recurring Appointment form, it still throws an error so I think there is something with the behavior of the recurrence which interferes.  Since whatever is, or is not, present in the Required Attendees field will carry through to the Recurring Appointment form, I guess there is no need to have additional script there.  

    Thanks to all who chimed in with suggestions!

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: JavaScript to remove the values on a partylist?

    No problem, I just sent the video in a zip file. Let's take this offline.

  • RE: JavaScript to remove the values on a partylist?

    That would be awesome - thank you so much!  I'm beginning to think there is something in our system which I am not aware of which is preventing this from working properly so I hope I spot what is wrong.  please use bc109@bioventusglobal.com

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: JavaScript to remove the values on a partylist?

    I just tried it. Using Xrm.Page.getAttribute("requiredattendees").setValue(null) works just fine on the appointment form.

    What is your email address? I'll create a quick screen-capture video for you that shows you how to get this working.

  • RE: JavaScript to remove the values on a partylist?

    Nothing I have tried is working.  I continue to get the same script error message every time.  I would be really curious to know if anyone who is far more experienced than I at this type of thing could give it a try in their sandbox to see if they can get it to work.

  • Saroj Das Profile Picture
    Saroj Das 3,355 on at
    RE: JavaScript to remove the values on a partylist?

    HI Tim,

    Thank you for pointing out that. Yes, you are correct. I thought it as Html page.

    Thanks,

    Saroj

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: JavaScript to remove the values on a partylist?

    Saroj - Since he's adding jscript for a CRM form, he doesn't need the script tag at all. The code isn't working now because it looks like it's all within a comment block.

    Somewhere there has to be a simple step-by-step (screen by screen) example out there that he can follow. I don't have time right now to put that together but I'll try do it because it looks like there's a need.

    busybell, you're close on this, just look carefully at the sample code and SDK content on this topic. I'm not sure where you saw you needed the <script> tag but it's not necessary.

  • Suggested answer
    Saroj Das Profile Picture
    Saroj Das 3,355 on at
    RE: JavaScript to remove the values on a partylist?

    Hi,

    Everything in your script looks good except the line <Script language="Javascript". Remove the script tag and comment tags as it is not needed in CRM form. And try to execute.

    Thanks,

    Saroj

  • RE: JavaScript to remove the values on a partylist?

    Still no luck.  I'm still getting the same error no matter what I try. 

    test-3.PNG

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: JavaScript to remove the values on a partylist?

    Ok, I saw that now, thanks. The problem now is that your function, FormOnLoad, is not yet a function because it's missing "()". It should be FormOnLoad().

    Here's a page that looks helpful to get you up to speed on JavaScript functions.

    jennifermadden.com/.../functions.html

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans