How to prevent user from cancelling a salesorder using js? - dynamics-crm

My mission is: after the user clicks on cancel order button, I need to check some data and if the data is true, I need to prevent from the button functionality to run and alert the user, where can I insert my code?
Mscrm.Form.salesorder.CancelOrder is a vanilla button and seems close to add or edit, how can I do that?

Either you can do a pre-update plugin, check the business logic and throw InvalidPluginExecutionException if it is satisfied
You can use custom action by customizing the OOB cancel button or by hiding it and introducing a custom cancel button to invoke custom action or script to alert

Related

How can I show new modal or update the existed one after an input submit in Slack via API?

I need to show new modal after the submit of the previous one, but I need a trigger_id for it, and there is nothing about it after the submit.
I can use views.update API only instead, and I have a valid response, but the submit button closes the window and nothing happens on the client side after it all.
Slack doesn't show an input in modals without a submit button, so I can't use alternative buttons in the modal too, because a user anyway can click on the submit button and it will be closed.
Is it possible to show or update the modal after an input submit? For example, I need to take a data from the input and show it in the modal after, is it possible?
You could try updating the view using the response_action. That needs to happen within 3 seconds, but doesn't require a trigger_id. Docs for that are here.

How do I stop my application express after submit process firing on page refresh?

I have an oracle application express process, written in PL/SQL and it fires off a confirmation email, supposedly when you click on the related button, (It is an after submit attached to the button) however, it is firing every time you refresh the page. Is there a different way of doing this so it only fires when you click the save changes button?
Take note of the execution point attribute. It will won't apply to page refreshes if it's either 'Processing' or 'After Submit'.
You can also associate these after-submit processes with specific buttons, using the 'when button pressed' property.
You may also wish to consider the 'Enable duplicate page submissions' page property.
If you're still having issues, you can build a demo at apex.oracle.com, and updated your question.

Button Click events with Dynamic actions in Oracle Apex

I have created an Edit button with associated Dynamic Action. In the dynamic action, set it to the Click event of the Edit button. I've created the actual action by reference to a JavaScript executing code. And then an update of the area.
In JavaScript code I wanted to enable items that are read only by pressing the edit button.
APEX_UTIL.PUBLIC_CHECK_AUTHORIZATION('ADMIN')
This was the check I made in the JavaScript code.
In this way I enabled edit mode for the region where I am applying.
ADMIN is a role.
How can I make the button click so that the items associated with the region that are just as read only, when clicking appear in an editable way?
In my opinion, you're reinventing the wheel.
OK, there's the ADMIN role (perhaps some other roles as well). If you know which user (identified by :APP_USER) has which role, then use
server-side condition (to decide whether to render (or process) certain page component (items, buttons, ...)
read only property (to decide whether user will be able to modify the value or not)
authorization scheme (under "Security")
So, there's no need for the EDIT button you currently have. Everything can be done declaratively by setting certain properties within Apex.
this function
APEX_UTIL.PUBLIC_CHECK_AUTHORIZATION('ADMIN')
is a plsql function, did you use it in your javascript code or as a server side condition?
you can make an ajax request to get the user role using that function and after getting the role in your javascript code you can disable/enable the items using the javascript api.
apex.item( "P1_ITEM" ).enable() ;

Execute custom code in CRM

Is there a way I can execute custom code in c# when a user clicks a button in the CRM application? I would like it a synchronous and asynchronous approach.
Actually something like when putting a button on a webform with a wired code behind click event handler.
And how can I add a button?
I want to display a list of report views the customer has assembled and access the report data in the CRM database.
It seems so complicated with CRM!
Here's an example of a custom workflow with a bunch of XAML. I dont know where they got it from.
Sample: Create a workflow in code
One way to go about it:
Use Ribbon WorkBench add add a button to the form. Only supported way of adding buttons to CRM is by editing ribbon XML.
Add an on click JavaScript Event Handler.
Call an Action which can be used to call a custom workflow where you can perform business logic.

kendo UI Scheduler Add but keep window open

I am using a template for adding/editing an event. What I would like to do is be able to add an event but keep the window open and retain the entered data so the user can change a couple of fields and save that other event. There are 2 save buttons, "SAVE", and "SAVE and ADD NEW". The first button will save the entered event and close the dialog window. The second button will save the entered event but will keep the window open, user changes one or more fields, then save that new event (repeat as necessary).
Any advice or pointing me in the right direction is appreciated.
You can try using the "save" event of the Scheduler to make copy of current event and then call the "addEvent" method of the Scheduler with it. Check the Scheduler API below:
Scheduler: API

Resources