Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Will it be working using JavaScript and plugin.

(0) ShareShare
ReportReport
Posted on by 2

will this logic work .

1. create a contact record.

2. write a plugin on pre-operation and mask the contact details .

3. on the contact entity on save button write JavaScript which will be used to get back a field value from contact entity.

4. display this field value in alertdialog.

if the above logic is correct or working then i believe handling the JavaScript and plugin is possible.

*This post is locked for comments

  • EmployeeOcta Profile Picture
    EmployeeOcta 2 on at
    RE: Will it be working using JavaScript and plugin.

    Hello Guys,

    I was thinking to customize the save button with it's commands.

    in the script i will write save method and after that will will write fetch method .

    function ()

    {

    saverecord();  //Inbuilt function of xrm

    plugin will run here.

    fetchmethod(){

    alertdialog();

    }

    }

    hope you understand what i am trying to achieve.

    plugin will only mask the fields before saving.

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,477 on at
    RE: Will it be working using JavaScript and plugin.

    Hi,

     Not sure what that plugin is going to do. There is no way to mask on the server. You either let the data be stored in the database, or you don't. The list of fields that show up on the form is controlled by the form layout, not by the plugin.

     You might create a post retrieve plugin and mask attribute value in the entity so it will showd up as masked..

     However, if you still wanted to use js to read the actual value, you might need to embed some logic into that plugin(when to mask and when not to mask.. maybe based on whether there is another special column in the retrieve column list)

     Also, using that js in the onsave might end up being more difficult. If you are going to retrieve data from the server using web app in the onsave, that might not, really, work. You may have to cancel onsave, retrieve the data, then call save again from javascript(and , somehow, make sure you don't cancel it the second time)

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: Will it be working using JavaScript and plugin.

    the JavaScript would be executed when the onsave event on the form was triggered by the save button or autosave.

    Then I would say yes it is possible.

    I don't know if you aim towards the example mentioned here:

    neilparkhurst.com/.../javascript-prevent-save

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,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans