locked
JavaScript OData RESTEndPoint DataOperations vs Plugin Reliability RRS feed

  • Question

  • All,
    We have few JavaScripts that use RESTEndPoint DataOperations to modify fields on Account and Contact entity from commandbar. I think OData RESTEndPOint DataOperation works Asynchronously.
    So is it better to use it or fire plugin from commandbar?? What i mean is is there any advantage/disadvantage of using  OData RestEndpoint vs Plugin ??

    Thanks,
    Nick
    Tuesday, June 3, 2014 2:10 PM

Answers

  • Probably the biggest thing to take into account is the difference between client side JavaScript and a plugin on the server side. JavaScript is only going to work when the application is open. If you are ever importing or syncing records from Outlook, this all happens on the server and any JavaScript would not be executed - a plugin assures that the custom code will be fired regardless. The trade off is that most people would generally consider it more difficult to create and implement a plugin using .NET rather than JavaScript. 

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Tuesday, June 3, 2014 2:56 PM
    Moderator
  • It's reliable to a point - you need to take into account JavaScript runs on the client so if you have a long running process it is possible the user could close the record before the process completes leaving you with a potentially undesirable result. Usually long running processes are best created to run on the server via a plugin/workflow. Normal "quick" updates and such using JavaScript are totally supported and are commonplace. 

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    • Marked as answer by Nicksoft2011 Tuesday, June 3, 2014 5:32 PM
    Tuesday, June 3, 2014 4:41 PM
    Moderator
  • I agree with JLattimer. Plug-ins are most reliable in such scenarios. Also, you can have plug-ins fire asynchronously based on requirement so that you are not blocking user on the form. And so can be OOB Workflows.
    • Marked as answer by Nicksoft2011 Tuesday, June 3, 2014 8:04 PM
    Tuesday, June 3, 2014 6:34 PM

All replies

  • Probably the biggest thing to take into account is the difference between client side JavaScript and a plugin on the server side. JavaScript is only going to work when the application is open. If you are ever importing or syncing records from Outlook, this all happens on the server and any JavaScript would not be executed - a plugin assures that the custom code will be fired regardless. The trade off is that most people would generally consider it more difficult to create and implement a plugin using .NET rather than JavaScript. 

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Tuesday, June 3, 2014 2:56 PM
    Moderator
  • Thanks Jason for quick update.  so Does JavaScript OData Service Dataoperation, still be considered as Reliable, i mean, can we release some custom functionality to update/delete/create entity records using JavaScript oData RESTSDK into production environment or it is not good idea??
    Tuesday, June 3, 2014 3:20 PM
  • It's reliable to a point - you need to take into account JavaScript runs on the client so if you have a long running process it is possible the user could close the record before the process completes leaving you with a potentially undesirable result. Usually long running processes are best created to run on the server via a plugin/workflow. Normal "quick" updates and such using JavaScript are totally supported and are commonplace. 

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    • Marked as answer by Nicksoft2011 Tuesday, June 3, 2014 5:32 PM
    Tuesday, June 3, 2014 4:41 PM
    Moderator
  • Thank you Jason. I appreciate your quick technical details behind it. 

    http://en.wikipedia.org/wiki/Open_Data_Protocol

    Tuesday, June 3, 2014 5:11 PM
  • I agree with JLattimer. Plug-ins are most reliable in such scenarios. Also, you can have plug-ins fire asynchronously based on requirement so that you are not blocking user on the form. And so can be OOB Workflows.
    • Marked as answer by Nicksoft2011 Tuesday, June 3, 2014 8:04 PM
    Tuesday, June 3, 2014 6:34 PM
  • what about authentication for oData REST Endpoint in OnPremise version?? does that make difference in terms of How IIS Binding available for HTTP vs HTTPS??

    I mean if we have https binding then do we have to provide separate authentication to use oData REST Endpoint data operations??

    Tuesday, June 3, 2014 7:56 PM