Passing data to html web resource via code, crm 2011 - dynamics-crm-2011

I've put an html web resource on my contract form and would like to pass via the data= parameter some information that comes from a plugin that is registered for PostRetrieve. I know how to set static info for the web resource, but I can't find in the SDK how to set it dynamically from a plugin. Is this possible?
Background info
I'm new to developing for CRM so it's quite possible that I'm not taking the most effective route in building this project. Let me give you some more detail: when a contract is opened in CRM, my plugin retrieves some business information from a different sql server and fills in a few of the contract fields. This is working fine. However, I would also like to display a table of usernames and links that come from the remote sql server on the crm contract form. Because I did not want to save this info in the contract entity and because there are links I want the user to click on, I thought a web resource displayed on the form was the best implementation.
My thought was to pass all the data to the web resource via the data= parameter and then parse and build a table using javascript in the web resource.

What seemed to work best:
The plugin retrieves the info from the remote sql server, serializes the generic list to json and puts it in a hidden text field on the form.
The html web resource gets the content of the hidden field, does an eval, and builds a table.

Related

How to dynamically pass sql in query in Launch in context?

I need to have a button in custom Location app, upon clicking which will take me to workorder application list tab with all the workorders created on the assets of the particular location.
I am using launch in context.
I tried using WF, but the workorder is opening in main tab instead of List tab.
Work flow used
Interaction Node details
after routing, wotrack is opening like "http://hostname/maximo/ui/?event=loadapp&value=wotrack&additionalevent=changetab&additionaleventvalue=List&uniqueid=72&uisessionid=35&_tt=6e2h84jnc2qpnu9tohvo04qpdp"
how it is fetching workorder with unique id 72?
I think Launch in Context is the wrong tool. Launch in Context is used for launching the user from Maximo into some external website / application, using some data from Maximo to provide some context to that application.
Instead, it sounds to me like you should use a Workflow process with an Interaction Node. In the Interaction Node, you can specify the Application and tab to take the user to and the Relationship from the Main Object of the current app to use to find the record(s) that should be loaded in the destination app for the user.
I don't remember how to set up Launch in Context, but this web page on the URL parameters you can use should help on that part at least.
http://maximodev.blogspot.com/2012/04/maximo-urls.html
Specifically, the example using the SQL query is probably what you need, since you want to display the records (workorders) associated with the records (assets) associated with the record (location) you have. (The earlier outline of the article has the wrong URL values for the "Perform a query using a where clause" section, but the example near the bottom has the correct setup.)
http://localhost/maximo/ui/maximo.jsp?event=loadapp&value=wotrack&additionalevent=sqlwhere&additionaleventvalue=status%20in%20('WAPPR')
I think if you give the Launch in Context the part of that URL after the hostname, it will try to load it as a page at the current, which would end up taking you to exactly where you want to be, regardless of the public hostname of the server.
maximo/ui/maximo.jsp?event=loadapp&value=wotrack&additionalevent=sqlwhere&additionaleventvalue=status%20in%20('WAPPR')

Server-side templates not displaying fields in embedded signing experience

This is complicated but I'll try to explain. I've written an API integration in PHP. With this module installed on my website, I'm able to call a web service (on my website), pass it a PDF, and a collection of requisite parameters including a specific template ID in my Docusign account, and get back an embedded signing link, which I can then use to redirect to the Docusign signing experience for that template/document combination.
The PDF document I'm passing is the exact same PDF in the selected template, but with data filled into some of the files, whereas the version in the template is blank. In the template, various fields are defined (signature tab, date signed, SSN, etc..). These are clearly visible and correctly configured. One can verify this by going into the account and editing the template in question from the Docusign web UI.
My problem is that of the 5 templates I have configured, only one is working as expected (PDF shows up, you fill in the fields and sign, and click "Finish"... callback web hook fires delivering the finished PDF back to my server... done.). The rest show none of the configured fields signers are supposed to interact with. You can click continue, but in the left sidebar, you get the tools for adding fields to the document, instead of the pre-configured ones displaying properly in the body of the PDF.
The template that's working, was broken two days ago with the symptoms described above. I've done nothing to the account or that template and it's magically working somehow. I called tech support on Friday and they told me that occasionally templates get corrupted on the docusign server, but that was tier 1 support and I'm not sure that's a valid comment.
That's about the best I can do to describe the problem. I'm unsure what specific information I could supply to help troubleshoot this, but I'll watch the thread and react as quickly as possible.
I'm observing the exact same behavior in both dev and live environments with the exact same group of templates. The one that works in the live environment is the same one that works in dev.
List of templates: (this is for the Dev implementation)
86841739-f12d-460e-9807-23a9b90cff6b (only this one works)
6c3fd328-6f2e-4de1-a9bc-f50df7761ec2
68ce0c9e-a892-4a15-b0f5-39f28aba4588
cd4e3b6d-a8ea-4c78-a0f8-602753996743
9278c78b-f703-429a-ac62-9361bd02f54a
The above represents the 5 templates I'm testing. Only the first one works as expected. I'll add the json later this evening, as I'm out of time at the moment.
Here's the json for each of the templates (zip file):
https://ufile.io/quo3j
Problem solved. It was indeed a discrepancy between the roleName of the template and that passed to the API during envelope creation. They must be the same. If you use a template with a different roleName than the one you pass when creating an envelope, you will get the exact behavior I've described.
The solution is to edit your templates on the Docusign website, and use the same roleName for them all, then make sure that's what you're passing the API when creating envelopes.

Get all the twitter account in sharepoint

In SharePoint 2013 we have a about me for all the employees that work at our company.
I would like to get for example all the employees that have filled in a twitter account in their ABOUT ME page in SP2013.
So I could do something with their twitter account, all be storing it in a array.
Im using a sharepoint hosted app, so the preffered programing language is jscript.
The question is how to get this data out of the about me for all employees?
The "About Me" page in SharePoint is really just a UI layer for data specific to the User whose page you're on; for the data you describe, it sounds like your users have the ability to add to their User Profile their Twitter handle.
If that's the case, it's fairly straightforward to query data from the User Profile Service using the JSOM (JavaScript Object Model). This MSDN article should be more than enough to get you started: http://msdn.microsoft.com/en-us/library/office/jj920104%28v=office.15%29.aspx
A note of guidance; if your users are instead putting their Twitter handle inside some block of multi-line text, like say a "Summary" property on their User Profile, I would strongly recommend updating your User Profiles to include a custom property for storing their Twitter handle (reference here). SharePoint makes it fairly easy to add custom User Profile properties and so having to otherwise parse something like a Twitter handle out of a block of text would be unnecessarily complicated & likely perform worse.

Set field via URL

Is it possible to have a field in the current item be changed by clicking a URL? The field would be a choice field with predefined choices.
Such as if the item field is currently:
Status: 2
If a user clicks the link, the field would now be:
Status: 3
If not, is there any other way for a user to easily change a field in the current item without actually haveing to visit the item?
Thanks!
Not Out Of The Box (OOTB) - but you've a few options.
Write an ASPX page to do what you want
Use something like SPServices and javascript to update the list item via the web services.
Use the Client Object Model (2010 only)
By the way - changing stuff on a 'get' can be dangerous as you can do malicious things - for example imagine you have a page that deletes the users account without any prompting (exact example doesn't matter) - what if someone clicks on that link by mistake or even worse what about an email sent with an image with that page as source URL - simply viewing the email could delete the users account.
It's not possible by using a GET request, but SharePoint 2010 is offering a RESTful API to manage ListItems from any client
The REST API is located within the virtual WebServices folgder under each SharePoint Site.
http://YourSharePointSite/_vti_bin/ListData.svc.
To perform an update on SharePoint ListItems you have to create a PUT Request. For more information on SharePoints REST API you should have a look at this MSDN site, there are also a lot of samples linked from this article.
Thorsten

Is it possible to autocomplete fields in Sharepoint with user info?

I'm in charge of a Sharepoint collection, and a user asks this. Is it possible that when a user creates an item, some fields are automatically filled with some info, such as email address and location?
Authentication uses Active Directory, so every user is identified when using Sharepoint. The only issue is that, being in a big corporate company, I don't have any access to the server, so it must be feasible through configuration of said site/list or using Sharepoint Designer, but I can't and won't be allowed to deploy anything server side.
Any idea?
With your limitations, your best bet would be a combination of ajax (I suggest jquery) and sharepoint webservices (if necessary), you need to do a XmlHttpRequest in the userdisp.aspx page, if this page has all the info you need, then get it, otherwise, get the currently logged account and use it to query the webservices (this part I'm not sure if theres a method that will return this info).
This all works using only the browser (Content Editor WebPart) or the SharePoint Designer client.

Resources