"Close" custom entity button - dynamics-crm-2013

I've built a custom entity in Dynamics CRM. I'd like it to have functionality similar to the opportunity entity, Close as Won or Close as Lost, only this language would be Approved or Denied.
Approved button would set the status to "Approved" and make the entity read only.
Denied button would set the status to "Denied" and make the entity read only.
I've done some research and looked into ribbon workbench, but I've got no idea on how to actually make it lock the entity when the button is pressed. The only tutorial I've found makes it open a webpage, and I'm not sure how to hack that into doing what I want it to do.
Any suggestions or places to read up on how to do this? Thanks!

the request is a little bit generic. I'll try to help. First of all, when people "accept" or "denied" the new entity you created, do you want to deactivate the record? In crm when an opportunity is closed it becomes not editable because it's deactivated. To achieve that you should use the internal status, "active" or "Inactive". So you can catch the event with a plugin and set the status to disable/enabled.
You can managed this case client side too, you can read the field that you are setting as "enable/disable" and put all the fields on the form in read only.
The third option is to use a synchronous workflow, read a specific field, put a condition and change the status of the record based on that condition.
Whatever road you choose a little bit of work is involved :)

I think your question is fine. Instead of having the button open a webpage you can have it call a plugin (using javascript) which updates the instance of the entity that you are viewing. Intuitively it might make sense to just set your record to inactive when the "Denied" button is pressed which also has the side effect of disabling fields.
In this related post the second option is what I am referring to.

Related

Adding a "New Button" option on Access form

Please forgive me if this question is too vague or extensive. I have limited experience with Access, SQL, and VBA and have a problem at work that I just can't solve. I'm trying to add a "new button" button to the user interface on our Access database.
I would like it to maybe bring up another form that allows you to input a query you want to make into a quick link on the home page. Obviously this would only be accessible to certain users but I can handle that part.
I don't necessarily need the code written, just an idea of where to start. So far all I've been able to do is hard code a new query or link into a button each team I want to make one. I want this process to be simplified so that anybody can make a button even if they don't know how to use Access very well.
Again, any help would be greatly appreciated and feel free to tell me to get lost if this is too vast or general a question.
I would like it to maybe bring up another form that allows you to input a query
The above seems very confusing. You are asking how a form can be used or launched or displayed to allow the user to add a new record. Then you toss in this VERY unrelated concept of some query? What does some query have to do with adding a new record?
If you want to add a new record, and you are in a form that is displaying current records, then behind the button, you can execute this line of code to jump to a new record ready for data entry:
DoCmd.GoToRecord , , acNewRec
So, that is one line of code.
If you want to launch an existing form and have it start out with a new clean fresh record, then use this:
DoCmd.OpenForm "frmCustomers", , , , acFormAdd
The above will launch the given from in "add mode" and thus you are again on a new fresh record ready for data entry.
The issue(s) of some query etc. for the user What does that have to do with wanting the user to add a new record? So that part does not seem to apply to the basic idea of presenting a form with a new record which allows the user to add that record in question.
You have to explain what all the hub bub about this magic query issue but to jump a form to a new record for the user? Just use the first line of code behind a button.
And if you need to launch a form in "add mode", then use the 2nd example one line of code behind the button in question. None of this has really anything to do with some "query" in regards to you wanting the user to add a new record. You can expand on what you mean by some user query, but you have several options to jump an existing form to a new record, or launch a form in "add mode" to allow adding of a record. In these cases, you don't need nor want to write or deal with some SQL query.

Not open popup for action

I'm using Apache Isis v1.16.2.
I created an edit action but when my action is invoked Isis opened the associated form into a popup. I tried to set the property isis.objects.editing to false but in this way the user have to edit each property and click 'Ok' for each one. Which action Isis call to create default edit form? My goal is: the user open the form, edit all properties and click 'Save' once. Is there a way to do it? Thanks in advice.
currently the only way to do this is with an action that takes all the arguments for the properties that you want to change.
We do have a JIRA ticket to allow such an action be associated with a fieldset rather than a property, so that when invoked would "replace" the fieldset (similar to how, today, an action associated with a property temporarily replaces just that one property).
That said, the Apache Isis framework is not intended to be a simple CRUD framework (even though people often mistake it as that). Rather than let the end-user edit all properties in a single operation, instead identify why the fields need updating. This will lead to a richer domain model that encapsulates meaningful business rules, rather than being some sort of glorified spreadsheet.
Still, the Wicket viewer is extensible though. If you absolutely need an edit form yourself, see http://isis.apache.org/guides/ugvw/ugvw.html#_ugvw_extending_replacing-page-elements.
Alternatively, for that particular use case, consider developing a custom viewer and leverage Isis' REST API.
HTH

Setting up recycle bin functionality in Archer GRC

When deleting records within the platform, this action is not reversible via the front end. Is there a way to allow users to remove a record from their view without actually deleting the record?
You can simulate recycle bin functionality within Archer GRC by adding a record permission field that grants read access to "Everyone". If read access is no longer required then an editor of the record can go in and change "Everyone" to a group called "Recycle Bin."
Please note that if there are other record permission fields in the application, users or groups may still have access if they are selected in those fields. Perhaps You can set up a dropdown status field for the user to select "Recycle Bin" and use this condition for automatic record permissions to revoke permission to the record depending on the requirements or workflow of the application.
Solution shared by Igritte might be somewhat confusing for end users.
End user will see greyed out "Delete" button in the top toolbar, but he has to select "Recycle Bin" in the form. This solution was not accepted by my business owner at some point.
As a work around for "Soft delete", I wrote a custom object overriding "Delete" button functionality.
1. User doesn't have delete access to the record, so JavaScript code will make "Delete" button look like active and available.
2. Once the button is clicked, custom object will populate value in the
hidden value list and simulate the click on the "Save" button.
Update: Note that Custom object needs to hide the value list first once the page is loaded. Here you will need to use a JavaScript and do the following: [a] locate the value list DOM object and [b] set display attribute to none. I used jQuery library to do both. This way your value list is not displayed, but you still can use it to control data driven events.
3. With hidden value populated and submitted, record permission will hide this record from the end user.
Note that custom object hides one value list on the layout as well.
If for some reason JavaScript doesn't load properly, user simply will not be able to click on the grayed out "Delete" button.
Update: Hidden value list can be populated by custom object using JavaScript code as well. You need to identify the form tag "input" in HTML code of the page and set attribute "value" to the desired state. I used jQuery library to do this as well.
I have this solution in production working fine with IE11, FF and Chrome.
I can't share the code, but with WC3Schools JavaScript guides and 4 hours you can write and test it yourself with very little JavaScript skills.
Sometimes you have to use custom objects when you want to get a user-friendly solution of not available functionality.
Good luck!

ASP.NET Keep fileupload after postback

I'm writing an intranet ASP.NET page using VB.NET. I've run into a particularly nasty problem dealing with handling file uploads. I'll do my best to explain the problem, and perhaps someone can help.
My problem is almost a duplicate of this one, or this one, except (other than the filename) I don't care about sending the file to the server until the other data has been reviewed.
Here's the situation:
Joe Q. Dataentry inputs some data into several fields. The first 3 are drop down, and when he changes the selection, a postback event is fired that queries a database for valid entries for the other drop down selections. After selecting the values, he inputs some other data, chooses a file to accompany the data and clicks the "Update" button. When he hits the button, it fires a postback event that sends the current data to the server to be validated. The data will create a change in the database, so he is presented with a view of the current state, and what it will look like when his changes are made. He can now either confirm or cancel the operation for whatever reason.
Part of the data he will see involves the extension of the file which may be a PDF, or could also be some image file or other document.
Now here's where my problem is - on each postback event, the fileupload dialog is cleared. I was getting around it by creating a temporary file on the first postback and then renaming if he clicks OK or deleting on Cancel... but I need to do a variety of things, based on the previous state of data and the filename. I've tried to keep some session variables to retain the filename, and that works OK for just renaming the file, but for what I need to do it gets unwieldy.
What I want to do is be able to have the postback event to present the changes, and then when the user clicks "OK", submit the file. Is there any possible way to do that?
One of my thoughts was to do some of the validation client-side (I'm already re-validating server side so I'm not too worried about data security there), but I don't know how I could get the information from the database query.
Thanks for any help, and reading my slightly convoluted story/situation!
EDIT:
It appears that what I want to do is prevent a certain button from firing a full postback. Is there any way to do that?
EDIT II:
I have an update panel on the page already - is there any way for the button to only post what's in the update panel?
What you might want to do is place your drop-downs inside of an ASP.NET AJAX UpdatePanel, and keep your file upload control out of that.
Your update panel will do the post backs and allow your validation logic to happen without submitting the file, then when you hit your final "Save" button (which is also outside of your UpdatePanel) the entire form will be submitted back and you can work with your file then.

Check if a DataGridView/BindSource have changed data

I have a WinForms app with a datagridview and a bindingsource. I want the user to confirm changes before I save them to the database.
I don't want to pop up the confirmation dialog unless I know the user has made changes. So I need a way to check if changes have been made. Any suggestions?
You should be able to use BindingSource.ListChanged to rig a crude test - set a flag when the event is fired (you'll probably have to clear the flag once binding has completed).
But what is the data? For example, LINQ-to-SQL and DataTable both offer ways of querying for changes... (DataTable.GetChanges() and DataContext.GetChangeSet()). Most DAL-based mechanisms will usually have a way to do this too.
if you're (ultimately) binding to a datatable you can check the rowstate for Changed or Added