What is the supported way to display an HTML webresource as a dialog ?
I have tried Xrm.Utility.openWebResource(webResourceName) but it's displayed as a webpage
Thanks
At the moment the only way to open your webresource in dialog mode is to use showModalDialog method of window. Check following url please - showModalDialog
If you're looking to display webpages inside a dialog in CRM 2013, as per my knowledge that is not possible.
However, in order to simulate what you're trying to achieve, you could design the entire dialog in HTML itself (having buttons like Next, and pages, etc.) and then display the HTML page as a popup using OpenWebResource. You can make use of the REST api of CRM to carry out the CRUD operations during the dialog progress.
Did you check the MSDN reference? You can control the width and height if that is what you are trying to achieve.
You can use:
Xrm.Internal.openDialog(address, settingsobject, null, null, return function)
var settingsobject=new Xrm.DialogOptions;
settingsobject.height = 420;
settingsobject.width = Xrm.Page.context.client.getClient() === Xrm.ClientNames.mobile ? 500 : 450;
Related
I'm working with Request Tracker and I would like to add a button when you visualize an open ticket that triggers a POST call to an external Java Server and it returns a PDF file with a report about the ticket. What is the best workaround?
There are many different ways to add this sort of customization. The easiest might be to write some Javascript to add the button by looking at the divs and ids RT writes to the ticket display page. You can drop the Javascript right in the styling box on the Theme Editor page.
If you can request the PDF via GET, you can just add a link in the Links section. Or, depending on what you're trying to do, you can also do dynamic things with custom field values as described in the External Custom Field docs.
I'm familiar with SharePoint but would like some guidance on developing a custom page.
I have 1 list and have created 3 different views.
On my Page, I have added a webpart to show the list.
I'd like to be able to add some form items - possibly radio buttons/ a picker/ or just text links at the top that would allow the user to switch views on the list below.
I'd like to add some other information and make the experience more intuitive for the user.
In short, is there a way to add a list web part and some options to choose the view of that list in another section of the page?
Sure, just do something like this
var dview = MyList.Views["YourViewTitle"];
dview.DefaultView = true;
dview.Update();
MyList.Update();
Each view has its own URL so you just need to use some HTML and JavaScript. When a box is checked or a button is clicked then you can load the URL of the view.
I have an Xpages application that pulls data from another .nsf file. I have a view panel linked to a view in that db. The view has documents with several different forms in it. I want to be able to open each document in it's own form(xpage).
How do I write a computed At Runtime, open selected document using: statement that will select the correct Xpage to present the document.
If you use the Data View component instead of a View Panel, you can compute the pageName attribute, referencing the var attribute to return a different value for each row based on the document that row represents. The flexibility of the Data View component also makes it easier to make your app look more like a modern web application and less like an Excel spreadsheet. As an additional bonus, the mobile theme invokes a renderer that makes each Data View instance look like a native mobile list, so using Data Views instead of View Panels simplifies mobile development.
You have 2 options:
use "use xpage associated with form" and edit the form's property
use a SSJS formula to compute the Form. You provide a variable name in the view control var to access a view row as XSPViewEntry. If the Form is in a view column even one you don't display you use .getColumnValue otherwise getDocument.getItemValueString
Does that work for you?
Maybe this mothed can help you: Unable to get document page name for
Hope this helps
Mark
I had a similar problem today. I use only one form but 3 different xpages for associated with this form. I have 3 different document types in the view. I used rowData the get the type of the document.
try{
var v=rowData.getColumnValue("form");
if(v.indexOf("x")> -1){var page ="x.xsp"}
else if(v.indexOf("y") > -1){var page = "y.xsp"}
else{var page = "z.xsp"}
}catch(e){
var page = "x.xsp"
}
So to your view you can create a column with the value of the form and you can use it.
I have used the extension library Dynamic View control which has an event you can code to get a handle to the NotesViewEntry which was selected. See the demo database page Domino_DynamicView.xsp and the Custom Event Handler tab for an example.
Note, in 8.5.3 (I have not upgraded yet) if you add or edit the eventHandler for onColumnClick it will be added to the XPages source as an xe:eventHandler. It needs to be an xp:eventHandler to work. The way to do it is to copy the code in the source from the exiting event and delete it. Recreate the event and update the code. Then go back into the source and change the tags within the eventHandler to xp:.
I am currently on a project redesigning an existing traditional domino web application to XPages. This application contains a web form with quite a lot of helper dialog boxes. Also notifications and validation and confirmation is done through dialogboxes.
I know I can create a custom control for each dialog box and add it to the Xpage and call the show. I even managed to load it dynamically using a dynamic content control with a facet for each dialog. Since the dialog cc contains a show() in the onClientLoad. It is easy to open a dialog by switching the content of the dynamic content control.
Still, adding all these custom controls to my XPages feels inefficient and really clutters the design tab. What's your take?
I would prefer setting the content of the dialog dynamically (Like in traditional domino you would define a form for each dialog). Is that possible?
If not is it possible to load a custom control dynamically (Like using a computed subform)?
Also for confirmation boxes I need the OK button to execute different code for each confirm. What would be the best way to implement that? Add custom parameter "functionOnOk" to the "dlgConfirm" custom control and evaluate that in the submit button?
PS: I am still using panels with dojoType=dijit.DialogBox, but will change those to extlib dialog boxes. For the confirm and messageboxes I am now using client side dijit.Dialogs with mark-up in code, but I would like the markup in XPages as well.
I know there are issues with panels with dijit.Dialog, because Dojo moves the dialog in the DOM, which prevents any SSJS in the dialog running. I don't know if that's also an issue with dijit.DialogBox, but I suspect it could be. Jeremy Hodge did some code to workaround that.
However, I would strongly recommend using the Extension Library control. Client-side dijit.Dialogs are likely to be much more difficult to code and will not allow any SSJS interaction. I'm not aware of any Dojo properties not available in the Extension Library control, and the Extension Library control also allows you to open or close the dialog both in CSJS or SSJS. It also allows you to specify an area to refresh on close.
In terms of the properties, preload is there purely to speed up showing. Are you using the refreshOnShow property? This ensures the URL or content is refreshed each time the dialog is shown. The Extension Library chapter on dialogs has a table covering all the properties. You can set the URL to point to another XPage or another web page. This may allow you to use the Dynamic Content control to pass parameters to switch the content that should appear.
In terms of the code behind the OK button, if you use the Extension Library dialog, you have all the functionality you would have outside the dialog.
Is it possible to embed an audio object (mp3, wma, whatever) in a web-enabled InfoPath form ?
If it is, how do you do it ?
#Martin
That works for local forms that open in InfoPath. Nathan was asking about web-enabled forms. ActiveX controls are disabled for web forms, as evidenced by the informational label at the bottom of the design controls when the form compatability has been set to the web.
Now, I will admit that I know nothing about the HTML tags to play audio in a browser, but I have something else that might work. I had an InfoPath form that I needed to dynamically load an image into for a web-enabled form. Similar to the ActiveX issue, the Picture control was also disabled. What I did was put some managed code behind the form and execute the following when the form loaded.
public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
string imgPath = "http://yoursite/yourimage.jpeg";
XPathNodeIterator xpni = MainDataSource.CreateNavigator().SelectSingleNode("/my:FormName/my:RichTextControlName", NamespaceManager).SelectChildren(XPathNodeType.All);
xpni.Current.InnerXml = "<img xmlns=\"http://www.w3.org/1999/xhtml\" src=\"" + filePath + "\" width=\"200px\" height=\"55px\" />";
}
I don't see why you couldn't take the same approach and load audio rather than an image.
It looks like you can't embed <object> tags in a richtext field. I'm getting nothing when I do it.
Have you tried manually modifying the XSL in order to generate HTML which embedds your audio file?
I don't think there is a way to do this using the InfoPath Designer, but if it ends up in the XSL; it may just get passed through to the web enabled form.
Edit: My apologies, I missed that the question was about Web forms - for which the below does not work. Must learn to read the question fully!
Go to menu View
Click on Design Tasks
Select Controls in the 'Design Tasks' Task pane
Click on the 'add or remove custom controls' button to install your custom
control
Click on the Add button and select ActiveX Control
Select the Windows Media Player control
Select the necessary properties for databinding and finish the wizard.
After you have added the control, you can drag and drop the control on your screen.
Right-Click on the control and select the 'Windows Media Player properties'
Fill in the URL to automatically embed the file to play.