I am having a HTML Webresource on entity form which allows me to attach a file.
i am using below command to attach the file by using the object type code, and guid of the entity record
parent.Mscrm.RibbonActions.addFileToRecord(entityETC, entityID);
this works fine with classic interface but unfortunately it is not supported/working in Unified Interface.
is there any alternative to achieve the same in UCI.
In UCI this method is no more supported. The web resource which has the method addFileToRecord has been deprecated. Please check this post from the community for your reference.
https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/397475/javascript-and-ribbon-issues-post-migration-to-unified-interface
Related
I have an ASP.NET Web Api 2.2 project where I would like to take the response from all controllers and wrap it in a wrapper object with some metadata. Then I would like my custom Media Type formatter (particularly my custom JsonMediaTypeFormatter) to use that extra metadata to do some custom serialization.
I tried creating a DelegationHandler to do the wrapping, but that happens after the formatter in the pipeline. Is there another way to intercept the response from all controller actions, wrap the response in another object and then have the custom JsonMediaTypeFormatter process it?
Have You tried using an ActionFilterAttribute where you can override the OnActionExecuting/OnActionExecuted methods to process/generate the action response using the actionContext.
Have a look into this good article.
Also look at this question.
Hope that helps.
Has anyone had any success working with the Quick View forms and JavaScript in CRM 2013?
I'm attempting to get a value from the related entity. That value is on the quick view form. Inspection of the DOM means I can get to it via unsupported means...
document.getElementById("cardPatient_cardPatient_contact_birthdate").innerText
but I'd rather not.
All the information is there. I wonder if there's a way to get to it via supported methods. I'm currently hitting the OData service for the birthdate but it just strikes me as a waste when it's there already.
If you use OData call you already use supported way.
Quick forms attributes are accessible by calling getAttribute() from the control, as described here: http://msdn.microsoft.com/en-us/library/gg334266.aspx. Here's the example given on the page:
var quickViewMobilePhoneControl = Xrm.Page.getControl("contactQuickForm_contactQuickForm_contact_mobilephone");
if (quickViewMobilePhoneControl.getAttribute().getValue() == null)
{
quickViewMobilePhoneControl.setVisible(false);
}
I have a Web Service like ServiceA.asmx. What is the right way to consume it?
I have two ways to consume a service:
1)adding Service Refernce:
I have added Service Refernce of ServiceA.asmx ( Like in http://microsoftfeed.com/2011/part-14-how-to-consume-a-web-service-in-windows-phone-7) and i am able to call the Functions in Service like in the link i have given. If we use this way there is no need to parse the Result, Result returned in Objects(easy to use).
2)Hitting the URL and Calling asynchronously:
Here we can hit the URL, that function will call the asynchronous function that asynchronous function will return the response. But here response will be in XML here we have to parse that XML in to an Object.(not easy if any Big XML is there)
Please Guide me on this
Personally I would use the 'Add service reference' option. It's easy to use, and this option is added to Visual Studio especially for consuming web services. You can still use MVVM to build up your models/viewmodels.
I don't have the option to check it right now, but from my head the classes generated when adding the service reference also implement INotifyPropertyChanged. So you could probably use the object directly (if they are in the structure as you want to use it.) as your Model. Based on that model you can create your own ViewModel which you can bind to the UI.
To see how this works have a look at the code samples on MSDN:
Implementing the Model-View-ViewModel Pattern in a Windows Phone Application
Weather Forecast Sample
How would you suggest working with files that is stored on the note of a entity in Crm. Could you write a generic method that will enable you to access any type of file? Or would it be better to have a method for dealing with each type of file?
For example, we are going to be saving a mix of swf files and xml files on the entity, so would it make sense to have a method each for example:
GetXmlFilesOnAccount(accountid)
GetSwfFilesOnAccount(accountid)
When you upload an attachment to CRM the mimetype is also saved as part of the record information.
The following link contains a nice example of how to download the attachemt using a single method. http://crmscape.blogspot.com/2009/10/ms-crm-40-sending-attachments-to.html
The post is missing the actual query needed to retrieve the annotations but you can tell what columns are required from the method signature.
My suggestion using your methods:
* GetXmlFilesOnAccount(accountid)
* GetSwfFilesOnAccount(accountid)
Retrieve account activitypointers by regardingobjectid(in your case accountid guid)
Loop through returned activitypointers
Get attachments for each activitypointer (activitypointer.activityid = activitymimeattachment.activityid)
Store attachments (disk, etc)
You don't even need two methods. You can retrieve all attachment file types for a given note (annotation) with a single method.
Hope this helps.
I recently started an Open Source Project on CodePlex to accomplish exactly that. Feel free to check out the Project's Web Page at:
http://crmattachdownload.codeplex.com/
You can also view the source code under the "Source Code" tab of that same page.
Pete
I have created a custom entity in MS CRM 4.0 and am trying to update a couple of the attributes via a custom worflow in .Net. I have read through several of the forums and blog posts and am still confused on how to access the custom entity and update some of their attributes.
I created a custom entity to replace how CRM was doing allotments as our company has some specific business rules that CRM wasn't doing. When a task is completed on an incident I want to update an attribute in the custom entity with the task duration. Any help would be greatly appreciated.
Thanks
When using the CRM web service in a custom workflow, you'll need to use DynamicEntity objects. The workflow context webservice is just an ICrmService so it doesn't know about your specific customizations. There's a pretty sample here: http://www.stunnware.com/crm2/topic.aspx?id=CustomWorkflowActivity
I imagine you could also add the CRM web services as a web reference to your workflow project. Then you'd have strongly types objects for your custom entities. I've never done this for my custom workflows, but it works for other custom apps accessing CRM.
Choosing Dynamic Entities over WSDL in favour is always the better choice.
When you develop a piece of code, you are more flexible with your classes. You could use your piece of software in different contexts for different systems. That's the reason Dynamic Entities were invented.
It's very easy and you dont'have to use DynamicEntity. You have to go to Settings -> Customization -> Download WSDL. Take the wsdl and use it in your project. Now you have all your custom entities strongly typed. All you have to do is to write something like this:
Guid entityId = getEntityId();
new_yourCustomEntity entity = new new_yourCustomEntity();
entity.new_yourCustomEntityid = entityId;
entity.new_customProperty = "value";
CrmService crmService = new CrmService();
crmService.Update(entity);
Maybe what you really mean is Custom Workflow Activity? This involves writing your own .NET class to add functionality to the standard CRM WF in form of new step types. If what you want to do is just to update an attribute you don't really need this, even if it is on a custom entity. The Update record step does just this and allows dynamic values (coming from other entities) to be specified.
Hope it helps
Daniel