Microsoft Dynamics CRM - changes on entity Iframe - unsaved notification - iframe

we have some custom Iframe on entities - when content of iframe is changed (user fill some data). and user is leaving changes, there is no notification, that there were made some changes. (no change on unsaved icons)
Is there some possibility to notify user, that there are unsaved changes?
One of my idea was to add hidden field on entity form and when there is some change in Iframe, trough javascript change value on this field. This is tested and working, but maybe there is some better way to do it.

Related

Dynamics crm + Detect changes in an embedded iframe on CRM Form

I have an iframe embedded on my crm Form, the changes made in the controls within the iframe is not detected and the Form does not show 'unsaved' message on the form. However data in the iframe gets saved on autosave. I would like to know if there is a way i can show 'unsaved' changes message on the form whenever data in the iframe is changed?
Any help would be appreciated.
On an entity form unsaved changes are only tracked for the entity attributes displayed on that form. When you need to track changes in iFrames an option to be considered would be to add a hidden attribute that is modified by a script when data in the iFrame is changed.

FullCalendar: is there still a viewRender event hook?

I need something like the viewRender event in order to persist the user's state. I'm building a UI where users will frequently jump in and out of the calendar, so preserving their view/range is essential for a pleasant experience. Does this exist in v5? The last mention I can find of it is from v3.
The only workaround I can think of right now is a direct click handler on every view control element, or a very heavy-handed MutationObserver. This is a React app so either one is going to be super awkward.
Thank you!
Edit 2021-02-11:
I looked at the available view render hooks but none of them address my problem. What I need is an event that will fire whenever the view state changes, including clicking between weeks/months/etc., so that I can persist the date range the user most recently viewed as well as the view they had selected.
viewDidMount is the closest to what I need, but it does not fire when the date range changes.
Edit 2021-05-26:
Another problem with using viewDidMount is that using it to enact side-effects is a bit overeager. The hook gets called whether or not the user has actually done anything, and the default view always gets passed as view inside the View Object. So there's no way to tell whether this mount event contains data I should persist or not.

Add an image to browser enabled infopath form

Instead of digitally signing a form, is it possible for users to attach an image with their signature to the form in InfoPath 2007. The other users who are viewing the form should also be able to view the image and not as an attachment.
Form is browser enabled!
Use a picture control and select "Included in the form" on the popup (instead of "as a link") and anything the user selects will show up directly in the form.
Note that using this as a signature does NOT ensure integrity/security. Any other user can remove that "signature" image and put their own (or put someone elses "signature" image in).

Saving/editing parent and child information on same webpage

This is a question related to how people are handling a situation in the user interface for a web application. I have a page which is displayed when a user wants to create/edit a Parent object. It has a few attributes related to this Parent object, as well as a Save button so the Parent can be saved. Each Parent object has a collection of Child objects (displayed in a grid on the same page), and on this same screen the user can add/modify/remove Child objects, similar to the following:
Parent Information:
ParentName: [textbox]
ParentDate: [datepicker]
Children Information:
ChildName ChildDate Delete
[textbox] [datepicker] [button]
[textbox] [datepicker] [button]
[textbox] [datepicker] [button]
[Add Child button]
[Save button] [Cancel button]
Notice that I really want to only have buttons when I need to: one Save button (to rule them all!). I am trying to enable the following scenario when the user is creating or editing a Parent object:
The user modifies Parent information (nothing saved to database yet)
The user adds/modifies/removes Child objects (nothing saved to database yet)
The user clicks Save (and all Parent and Child information is saved)
Through all kinds of fancy AJAX-ish stuff I can make this happen without page refreshes, but I am saving all the intermediate changes to the into the user's session on the web server each time in the meantime. For example: the user clicks "Add" button (to add a new Child object), so I go into the session, retrieve the Parent object I already had put there and add a new Child to the collection of Child objects, then bind this to the datalist. The next time the "Add" button is clicked, I have to save off the changes the user made to the first Child entry back into the object I retrieved from the session and repeat the process.
Is this crazy? Maybe I am trying to force "state" onto a "stateless" web application and shouldn't be doing that. I understand the concept of having per-lineitem editing in a grid, but that just seems silly for small screens where there's a couple of pieces of info for the Parent, a couple for each Child, and it's a lot of extra clicking for the user.
I think this question is technology independent, but just in case you need to know this is an ASP.NET web app.
I've done this sort of dynamic form generation work before also, and I tend to not save any of the user's input to the session. Sure, I'll query the server to ask about an object, but I won't expect the server to save any state information until I'm ready to post the form.
I don't think you're crazy, you're using a dynamic form and that's OK!

How do I - in ASP.NET save the info from a page when a user leaves the page?

In our CMS, we have a place in which we enable users to play around with their site hierarchy - move pages around, add and remove pages, etc.
We use drag & drop to implement moving pages around.
Each move has to saved in th DB, and exported to many HTML files. If we do that in every move, it will slow down the users. Therefore we thought that it's preferable to let the users play around as much as they want, saving each change to the DB, but only when they leave the page - to export their changes to the HTML files.
We thought of making the user click a "publish" button when they're ready to commit their changes, but we're afraid users won't remember to do that, because from their stand point once they've moved a page to a new place - the action is done. Another problem with the button is that it's inconsistent with the behavior of the other parts of the site (for example, when a user moves a text inside a page, the changes are saved automatically, as there is only 1 HTML file to update)
So how can we automatically save user changes on leaving the page?
You should warn the user when he leaves the page with javascript.
From http://www.siafoo.net/article/67:
Modern browsers have an event called window.beforeunload that is fired right when any event occurs that would cause the page to unload. This includes clicking on a link, submitting a form, or closing the tab or window.
Visit this page for a sample the works in most browsers:
http://www.webreference.com/dhtml/diner/beforeunload/bunload4.html
I think it's bad practice to save the page without asking the user first, thats not how normal web pages work.
Sample:
<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
<!--
function unloadMess(){
mess = "Wait! You haven't finished."
return mess;
}
function setBunload(on){
window.onbeforeunload = (on) ? unloadMess : null;
}
setBunload(true);
//-->
</SCRIPT>
The easiest way I can think of is to store the page info each time the user moves items around using Ajax (e.g. with an UpdatePanel, onUpdated event, let it fire some script that updates the users page config.
Alternatively - .Net's WebParts implementation does this automatically without intervention by the programmer (unless you want to change the storage engine, it uses a local mdb in by default.
Use a "Publish" checkbox/button and when the user interacts with the page in a way that causes them to navigate away ask them if they want to publish if that box is NOT checked/button not clicked. Be aware that there are actions (closing the browser, accessing their favorites menu, etc.) that you will probably not want or not be able to prompt the user.
I would force them to click a button such as publish. That is a 'training' issue.
Automatically saving changes when they leave could have other ramifications. For example if a user opens up a record and plays around with it and has no intention of changing it, they close it, like a word document, excel, etc. . . I would have your site mimic that model.
You also have to remember that the web is a disconnected environment and is not required all web applications run like a windows application.
If the user doesn't click the publish/save button then there changes are not saved and that is up to them to remember to do.

Resources