Silverlight application can get a reference to the Xrm.Page Object instance using either of following approaches. 1. Using HTML bridge feature of Silverlight ScriptObject xrm = (ScriptObject)HtmlPage.Window.GetProperty(“Xrm”); ScriptObject page= (ScriptObject)xrm.GetProperty(“Page”); 2. Using Dynamic Language Runtime Using DLR you can utilize the dynamic language keywords which allow resolving method calls at runtime. dynamic xrm = (ScriptObject)HtmlPage.Window.GetProperty(“Xrm”); [...]
Archive for the ‘JScript’ Category
Interacting Silverlight with CRM Forms
Posted: December 27, 2011 in CRM 2011, CRM5, JScript, Microsoft Dynamics CRMTags: CRM2011, JScript, OData, Silverlight, Silverlight with CRM 2011, WCF, Xrm.Page
Populate lookup value on selection of another lookup
Posted: September 9, 2010 in FilteredLookup, JScript, Lookup, Microsoft Dynamics CRMTags: Auto Popolate Lookup Value, Auto Populate, Lookup
I had client requirement that on the selection of City (lookup), Region and Sub Region should be populated automatically which is read only field. To achieve this we mapped the city with region (lookup) and sub region (lookup) on the city entity. After writing below code I was getting following error. There was an error [...]
Filtering multiple custom CRM Lookup
Posted: September 8, 2010 in FetchXml, JScript, Microsoft Dynamics CRMTags: Custom Lookup, Dynamic Lookup, FilteredLookup, Filtering Lookup, Multiple Custom Lookup
Let me explain the scenario.. We have a Model lookup and a variant Lookup on Lead form. Every variant is associated with a particular model. i.e One model have multiple Variant. Eg. Model Varient Alto Alto LX Alto Alto Xcite Alto Alto LXI SX4 SX4 VXI SX4 SX4 ZXI Leather SX4 SX4 ZXI —————————- Now [...]
Using the Advanced Find for FetchXML builder
Posted: September 8, 2010 in Advance Find, FetchXml, JScript, Microsoft Dynamics CRMTags: Advance Find, Build Query, FetchXml
You can just open the Advanced find page and build the query as you like. Then run the query to see if it returns the data as you wish it should. If you are satisfied with the results and you want to know what query was sent into the CRM Framework, then press F11 to [...]
CrmService.Create Method Using JScript
Posted: September 2, 2010 in JScript, Microsoft Dynamics CRMTags: Create Record using Jscript, CrmService, JavaScript
Create record using JScript This sample shows how to use the CrmService.Create method using the same example provided in the Server Programming Guide: CrmService.Create method. To test this sample: Paste the following code into any Event Detail Properties dialog box. Save the form and then click Create Form on the Preview menu. When the event [...]
CRM 4.0: Use JavaScript execute/call/launch CRM Workflow
Posted: September 2, 2010 in JScript, Microsoft Dynamics CRMTags: JavaScript, Launch workflow through JScript, Workflow
Run a workflow through JavaScript /* the function */ ExecuteWorkflow = function(entityId, workflowId) { var xml = “” + “<?xml version=\”1.0\” encoding=\”utf-8\”?>” + “<soap:Envelope xmlns:soap=\”http://schemas.xmlsoap.org/soap/envelope/\” xmlns:xsi=\”http://www.w3.org/2001/XMLSchema-instance\” xmlns:xsd=\”http://www.w3.org/2001/XMLSchema\”>” + GenerateAuthenticationHeader() + ” <soap:Body>” + ” <Execute xmlns=\”http://schemas.microsoft.com/crm/2007/WebServices\”>” + ” <Request xsi:type=\”ExecuteWorkflowRequest\”>” + ” <EntityId>” + entityId + “</EntityId>” + ” <WorkflowId>” + workflowId + “</WorkflowId>” + [...]
CRM 4.0 IFrame: Show Advanced Find Result View
Posted: September 2, 2010 in JScript, Microsoft Dynamics CRMTags: Advance Find View, CRM, IFrame, Show Advance Find View using IFrame
How to show the Advanced Find result view in an IFrame? Instead of building a custom aspx page (dynamically passing parameters, see Adi’s solution), another method to share if you don’t need passing parameters into the query. 1. Build your Advanced Find query and save it, then copy the Shortcut. 2. Put a IFrame control [...]
CRM 4.0 IFrame: Show Entity’s Associated View
Posted: September 2, 2010 in JScript, Microsoft Dynamics CRMTags: Associated View, IFrame, show associated view using IFrame
It’s a common requirement to show entity’s associated view (1:N, N:N) in IFrame, the below code works for both 1:N and N:N relationship, it also works on both On-Premise and IFD deployment. All you need to do is find out (IE Developer Toolbar) the ID of the associated link. The 1:N relationship needs these parameters [...]
Show both active and inactive records in the lookup view
Posted: September 1, 2010 in JScript, Microsoft Dynamics CRMTags: Active, Inactive, Lookup, show active and Inactive record
CRM MVP Batistuta Cai already had a post about a plug-in solution. If the lookup entity is a system entity, you can also use this technique: Let’s start from an example: you have a custom entity call: MyEntity, you have setup a N:1 relationship between MyEntity and Opportunity, so the user can see an opportunity [...]

