Link to home
Start Free TrialLog in
Avatar of Arnold Layne
Arnold LayneFlag for United States of America

asked on

Hidding master page for forms

I have a very strange request I am getting from a contract job.  They want their users to be notified via email to approve an item on a form but they don't want the user to go on sharepoint and instead want the form embedded in the email itself. Strange.

It looks like I can actually send an edit form via email if I stick it inside an Iframe in the html of the email, and it first asks for authentication, and then will let them view the form as long as they are on the network when viewing. I was surprised it worked.

I also need to get rid of the master page. The problem is that when viewing it in SharePoint or even an email, when I use editform.aspx?dlg=0&id=1 (or whatever the id number is), it works great and gets rid of the master and submits it, but it shows a blank page rather than redirecting back to the allitems page.

So how do i get it to redirect to all items?
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Hi,
just a guess (as simulating the above works on my dev environment) but can you try to add an additional parameter to the iframe src url:
&source=urlencoded url of your view
like
&source=http%3A%2F%2Frainerj%2Emysharepoint%2Ede%2Ftest%2FLists%2FEEBooks%2FAllItems%2Easpx
where
%2F == /
%3A == :
%2E == .

HTH
Rainer
Avatar of Arnold Layne

ASKER

Yes, I have found that and it's a good answer as usual. It works if you do not invoke dlg=0 in the query string which is what I wanted to use to show the form without the master page. If I use dlg=1, there are no scroll bars for the form. dlg=0 gives scroll bars. Strange but true. But if I use dlg at all, it doesn't seem to understand the redirect, and I can only guess that this is because it thinks it's a dialog box. It works when I don't use dlg. I might even use the negative margin clipping capabilities of the Irame to hide the master page if necessary, but it looks a little bit strange because it clips off the button part of the scroll bars on the left and top. I could live with that I suppose.
Hi,
how do you send/create the email?
I used a local HTML file with an iframe element and it worked as expected.

Alternative solution(s):
Either
- create a second edit form and add add styling information to hide the unnecessary elements
- adjust the existing edit form to apply additional styling for the elements (display: none) if a custom url parameter like "frommail=" equals 1

HTH
Rainer
I only have gmail, so i can't test it because it doesn't translate html emails, but this will be used in outlook by the client, so i assume that it will work. I have been testing this strictly in the browser to get it to work there first. I am creating non default edit forms and their url will be used in the email or browser. I can do just about anything I want with the form fields, but if I lose the master, all styling for the form falls apart, and I don't feel like creating these forms and styling them from scratch.

If the source parameter worked in conjunction with the dlg parameter, I would be all set because dlg hides the master and works as a dialog, but that is probably what prevents the source redirection from working. I'm not sure. Can you get it to work with a dlg=0 or 1 parameter? Maybe I did something wrong, but after form submittal I just get a blank page. Without the dlg, it redirects back to allitems.aspx or whatever other address I want as expected.

I didn't understand what you meant about frommail, but I can merely create many custom edit forms and adjust the url in the iframe of the email based on who the workflow sends it to. This way, more and more fields will appear as the approval process moves along because a different form will be sent with more fields each time as additional approval is needed. So that part I'm fine with, and I usually don't like messing with the actual styles
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am using Firefox. I thought I tried dlg=0 and I did not get an error, just a blank page. If it works for you in firefox, then it must have been my error somewhere and I'll mark the question answered. Thanks.
Hi,
works on IE8 and FF23.
HTH
Rainer
OK. must have done something wrong. Thanks.