Quantcast
Channel: CRM Development 論壇
Viewing all 10280 articles
Browse latest View live

open recurrence window in appoinemtn form on appointment load in mscrm 2011

$
0
0

Dear all;

i want to open appointment recurrence window when i open a appointment form in mscrm 2011 automatically is that possible????


how to insert signature templete in the email body

$
0
0

I need to in insert the signature template on the onload event on the email form. I have this function which calls for the right signature template. Everything appears fine apart from the name of the sender (in place of which I get some an expected characters). I think that is only because the name of the sender is dynamically obtained  on the signature template I get after my call, while the name of the company, email, phone etc. are not dynamically obtained on the template.

The result looks something like:

    Regards,

    Unexpected characthers

    Name Team

   Company, email, phone etc.

How could I insert the senders name in the template before it is loaded in the email boady? If this is what needs done.  If not how should I go about to get this working fine.

Any suggestion is welcomed.

The function is:

 function Signature2(companyTemplateId)  {
            emailIframe = document.all.descriptionIFrame;
            var emailBody;
            var odataSelect = document.location.protocol + "//" + document.location.host + "/" + Xrm.Page.context.getOrgUniqueName() +"/xrmservices/2011/OrganizationData.svc/TemplateSet?$select=Body&$filter=TemplateId eq guid'"+companyTemplateId+"'";
            var retrieveReq = new XMLHttpRequest();
            retrieveReq.open("GET", odataSelect, false);
            retrieveReq.setRequestHeader("Accept", "application/json");
            retrieveReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");		
			retrieveReq.onreadystatechange = function () {
			if (retrieveReq.readyState == 4) {
				if (retrieveReq.status == 200) {
					var retrieved = parent.JSON.parse(retrieveReq.responseText).d;
					//alert("retrieved");
					//alert(retrieved);
					emailBody = retrieved.results[0].Body;
					//alert(emailBody);
					emailIframe.contentWindow.document.body.innerHTML = emailBody;

				}
			 }
           };
		
        retrieveReq.send();
	}

Thank you

creating the partylist through javascript in the appointment requiredattendees field

$
0
0

Dear all ;

i am trying to create party list in the requiredattendees field of appointment through java script it is creating the party list but the last value of the partylist here is my code

    

if(Xrm.Page.getAttribute("requiredattendees").getValue()!=null)
{

 var party = Xrm.Page.getAttribute("requiredattendees");
    var partyList = party.getValue();

    for (var idx = 0; idx < partyList.length; ++idx)
    {

        var activityParty = new Object();
        activityParty.PartyId = { Id: partyList[idx].id, LogicalName:partyList[idx].entityType  };
        activityParty.ActivityId = { Id: chk.ActivityId, LogicalName: "appointment" };
        activityParty.ParticipationTypeMask = { Value: 5 };
createEntity(activityParty, "ActivityParty", "");
    }
}

function createEntity(ent, entName, upd) {
            
            var jsonEntity = JSON.stringify(ent);
            var createEntityReq = new XMLHttpRequest();
            var ODataPath = Xrm.Page.context.getServerUrl() + "/XRMServices/2011/OrganizationData.svc";
            createEntityReq.open("POST", ODataPath + "/" + entName + "Set" + upd, false);
            createEntityReq.setRequestHeader("Accept", "application/json");
            createEntityReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
            createEntityReq.send(jsonEntity);
            var newEntity = JSON.parse(createEntityReq.responseText).d;



            return newEntity;
        }

MS CRM 2011: Filter a lookup value from another lookup value on a form

$
0
0

Hi,

I want to filter a lookup 'abc' depending on another lookup 'xyz' value existing on a form in an OOB fashion.

I can filter this by using 'Related Records filtering' feature.

But, if I try to select a value in 'abc' lookup without any value in 'xyz' lookup, it shows all possible records of abc lookup.

So, if select one of them, then select 'xyz' lookup value, value of 'abc' lookup remains there as it is, which corrupts the data.

Can anyone help me out in this.

Thanks and Regards,

Arun

Internal Web Services calls broken in latest CRM Online UR12

$
0
0

First off, I'm not a JavaScript expert and am trying to patch this code written by a former dev, so please forgive me if this is an "obvious" fix. I've spent the last 2 hours searching the web for a solution. We're using CRM Online and this error popped up about 2 weeks ago, so we're assuming it is UR12 related.

The following code is in the OnSave event of a CRM custom entity we created. It has worked for the past 6 months (we moved to CRM Online back in August). All it does is calls a web service we have in-house and gets a single XML doc back containing a new ID value which we then insert into the CRM record during the save process. The code below now throws an "Access is Denied" error on the xmlHTTP.open line (inbold). However, if I access the same web service via IE, not from within CRM, the web service returns the requested XML (the exact output is "<?xml version="1.0" encoding="utf-8"?> <string xmlns="http://tempuri.org">1141</string>") 

I've put the server hosting the web service into IE's "Local Intranet" security group and set "Allow data sources across domains" to enabled. Dynamics CRM's url is also in our Trusted Sites with the allow data sources across domains" enabled.

   // Call audit web service to create an audit id
    var  xmlHttp=new XMLHttpRequest();

    xmlHttp.open("GET", "http://XXXXX:8080/YYYY/AuditWS.asmx/CreateAudit?name=" + Xrm.Page.getAttribute("new_auditname").getValue()+ "&start_date=1%2F1%2F1900&end_date=1%2F1%2F1900&description=" + Xrm.Page.getAttribute("new_auditname").getValue() + "&ins_user=" + Xrm.Page.getAttribute("ownerid").getValue(), false);

    xmlHttp.send();

why can I not edit an template form?

$
0
0

Is it possible to edit the form associated with a template for an entity?

The scenario I have is that we add fields to entities. When we create a new instance of that entity we are asked to select from one of a number of templates which will prepopulate the new entity with some data. We also want to prepopulate our new fields. So, for example, if I add a language property to an article then I want to be able to edit the articletemplate to include that language property and so prepopulate it (*). So how do I do that? Or if I can't then why can I not?

(*) that's just an example so don't berate me if articles already have a language field. ;-)

Possible to link to a view with a filter?

$
0
0

Is it possible to get the url for a view that filters on a field? I know about url addressable views, but I would like to also filter on a field. Example: A view with list of open opportunities filtered on country = "Namibia". Or is it the best to create a report that I can link to?

Send Reminder 21 days after Date

$
0
0

I want to send a reminder email 21 days after a record has been created if its Status has not been set to Closed.

Anyone know how to do a workflow for this?

Thanks.


Referencing field in Case header using JScript

$
0
0

Hi All,

I have put an input field in the header of the Case form which is named createdon. I would like to access this using JavaScript and change the color. Does anyone now how I would reference this?

Regards,

Dan

BIDS Report...

$
0
0

Hi there. I have created a form type of report using BIDS 2008 which allows me from within CRM (the report has been imported) to print off individual Contracts showing the Contract and Contract Lines information. This works fine until I had a requirement to print the Customer Address on the report ie Line1, Line2, Line3, City, Province & Postcode. When I add the table CustomerAddressBase and select the fields I require, no data is returned from within the Query Designer.

This is the statement which works (before I add the table):

SELECT        CRMAF_FilteredContract.customeridname, CRMAF_FilteredContract.activeon, CRMAF_FilteredContract.expireson,
                         CRMAF_FilteredContract.billingfrequencycodename, CRMAF_FilteredContract.new_contracttypename, CRMAF_FilteredContract.new_contracttermname,
                         ContractExtensionBase.New_PAVContractNo, ContractExtensionBase.new_periodbillingamount1, CRMAF_FilteredContract.title,
                         ContractDetailBase.ProductSerialNumber, ContractDetailBase.InitialQuantity, ContractDetailBase.Title AS Expr1,
                         ContractExtensionBase.new_frequencybillingamount, CRMAF_FilteredContract.statecodename, CRMAF_FilteredContract.contractservicelevelcodename,
                         CRMAF_FilteredContract.new_comments, AccountBase.AccountNumber
FROM            FilteredContract AS CRMAF_FilteredContract INNER JOIN
                         ContractExtensionBase ON CRMAF_FilteredContract.contractid = ContractExtensionBase.ContractId INNER JOIN
                         ContractDetailBase ON ContractExtensionBase.ContractId = ContractDetailBase.ContractId INNER JOIN
                         ContractDetailExtensionBase ON ContractDetailBase.ContractDetailId = ContractDetailExtensionBase.ContractDetailId INNER JOIN
                         AccountBase ON CRMAF_FilteredContract.accountid = AccountBase.AccountId

This is the statement that does not work (with the table added): 

SELECT        CRMAF_FilteredContract.customeridname, CRMAF_FilteredContract.activeon, CRMAF_FilteredContract.expireson,
                         CRMAF_FilteredContract.billingfrequencycodename, CRMAF_FilteredContract.new_contracttypename, CRMAF_FilteredContract.new_contracttermname,
                         ContractExtensionBase.New_PAVContractNo, ContractExtensionBase.new_periodbillingamount1, CRMAF_FilteredContract.title,
                         ContractDetailBase.ProductSerialNumber, ContractDetailBase.InitialQuantity, ContractDetailBase.Title AS Expr1,
                         ContractExtensionBase.new_frequencybillingamount, CRMAF_FilteredContract.statecodename, CRMAF_FilteredContract.contractservicelevelcodename,
                         CRMAF_FilteredContract.new_comments, AccountBase.AccountNumber, CustomerAddressBase.Line1, CustomerAddressBase.Line2,
                         CustomerAddressBase.Line3, CustomerAddressBase.City, CustomerAddressBase.StateOrProvince, CustomerAddressBase.PostalCode
FROM            FilteredContract AS CRMAF_FilteredContract INNER JOIN
                         ContractExtensionBase ON CRMAF_FilteredContract.contractid = ContractExtensionBase.ContractId INNER JOIN
                         ContractDetailBase ON ContractExtensionBase.ContractId = ContractDetailBase.ContractId INNER JOIN
                         ContractDetailExtensionBase ON ContractDetailBase.ContractDetailId = ContractDetailExtensionBase.ContractDetailId INNER JOIN
                         AccountBase ON CRMAF_FilteredContract.accountid = AccountBase.AccountId INNER JOIN
                         CustomerAddressBase ON ContractDetailBase.ServiceAddress = CustomerAddressBase.CustomerAddressId

I am not doing any filtering within Query Designer, so all records are returned at this stage.

Any help would be appreciated

Thanks


BM

How to get GUID for entity

$
0
0

When I create some kind of entity such as a contact, I get a GUID as a return parameter. My problem is, when I have an identity that already exists, how can I get the GUID for it?

I had this working in CRM 4.0, but the code I used doesn't work with CRM 2011 / CRM online.

CRM 2011 - How to create an XML or JavaScript Language file for Multiple Languages

Insert Muliple select value in MSCRM 2011 using CRM SDK 2011

$
0
0

Hi everyone,

I am trying to insert multiple values in multiple select value field in CRM using web service and CRM SDK 2011.

Please suggest.

Create ServiceAppointment with RegardingObjectId in Silverlight

$
0
0

I have developed a Silverlight application with Telerik ScheduleView. I am creating a ServiceAppointment however, I am unable to assign the RegardingObjectId. My code is below, I have removed some pieces to save space.

public void CreateServiceAppointment(myAppointment newAppt, Action callback) { // set fields // end set fields ServiceAppointment newSA = new ServiceAppointment();

newSA.ScheduledStart = ApptStart; newSA.ScheduledEnd = ApptEnd; newSA.ServiceId.Id = Utility.GetServiceGuid(Category.CategoryName); newSA.Subject = Subject; myContext.AddToServiceAppointmentSet(newSA); myContext.BeginSaveChanges(OnCreatedServiceAppointmentCompleted, newSA); } private void OnCreatedServiceAppointmentCompleted(IAsyncResult result) { try { myContext.EndSaveChanges(result); ServiceAppointment newAccount = result.AsyncState as ServiceAppointment; // customers ActivityParty custParty = new ActivityParty(); custParty.PartyId = new EntityReference() { LogicalName = "contact", Id = ContactId }; custParty.ActivityId = new EntityReference() { LogicalName = "serviceappointment", Id = newAccount.ActivityId }; custParty.ParticipationTypeMask = new OptionSetValue() { Value = 11 }; // customer myContext.AddToActivityPartySet(custParty); // resources ActivityParty resParty = new ActivityParty(); resParty.PartyId = new EntityReference() { LogicalName = "systemuser", Id = newAccount.new_PhysicianAssigned.Id }; resParty.ActivityId = new EntityReference() { LogicalName = "serviceappointment", Id = newAccount.ActivityId }; resParty.ParticipationTypeMask = new OptionSetValue() { Value = 10 }; //resource myContext.AddToActivityPartySet(resParty); // regarding ActivityParty regParty = new ActivityParty(); regParty.PartyId = new EntityReference() { LogicalName = "contact", Id = ContactId }; regParty.ActivityId = new EntityReference() { LogicalName = "serviceappointment", Id = newAccount.ActivityId }; regParty.ParticipationTypeMask = new OptionSetValue() { Value = 8 }; // regarding myContext.AddToActivityPartySet(regParty); newAccount.serviceappointment_activity_parties.Add(custParty); newAccount.serviceappointment_activity_parties.Add(resParty); newAccount.serviceappointment_activity_parties.Add(regParty); myContext.UpdateObject(newAccount); myContext.BeginSaveChanges(OnCreatedServiceAppointmentPartiesCompleted, newAccount); } catch (Exception ex) { } } private void OnCreatedServiceAppointmentPartiesCompleted(IAsyncResult result) { try { myContext.EndSaveChanges(result); if (doCallback != null) doCallback(); } catch (Exception ex) { } }


I am getting an error in the OnCreatedServiceAppointmentPartiesCompleted when I call myContext.EndSaveChanges(result);

The error is The 'Create' method does not support entities of type 'activityparty'

If I comment out the //regarding section, everything runs fine and the Customer and Resource fields of the ServiceAppointment are created perfectly. I've tried setting the RegardingObjectId but it says the RegardingObjectType cannot be null if the RegardingObjectId is not null.

How can I populate the RegardingObjectId through Silverlight when creating a ServiceAppointment?

Silverlight CRM 2011 QueryExpression Server SIde Paging?

$
0
0

I am new to this forum so thank you for your patience if this has been answered or if I am in the wrong place.

In Silverlight 4 and CRM 2011 w/ Rollup 11 I would like to implement server side paging using QueryExpression with

the IOrganizationService returned by SilverlightUtility (using Async call of course).

The example in the Walkthrough set the PagingInfo parameter of the QueryExpression but in the Callback

all it does is check if more records (results.moreRecords) and write a message if this is true.

My result set is variable in size and could be larger due to user input. How can this be implemented properly?

formQuery = new QueryExpression()
            {
                EntityName = "systemform",
                ColumnSet = new ColumnSet()
                {
                    Columns = new System.Collections.ObjectModel.ObservableCollection<string>(new string[] { "name", "formxml", "objecttypecode" })
                }
            };
formQuery.PageInfo = new PagingInfo { Count = recordsPerPage, PageNumber = currentPage, PagingCookie = null };
<!---
             the call
-->
OrganizationRequest request = new OrganizationRequest() { RequestName = "RetrieveMultiple" };
request["Query"] = formQuery;
IOrganizationService service = SilverlightUtility.GetSoapService();
service.BeginExecute(request, new AsyncCallback(GetFormsCallback), service);
<!--
and in the call back
-->
OrganizationResponse response = ((IOrganizationService)result.AsyncState).EndExecute(result);
EntityCollection results = (EntityCollection)response["EntityCollection"];  
if (results.MoreRecords)
            {
<!-- ???? what to do here --->
}


jscript error, CRM 2011

$
0
0

I have created a custom activity in CRM 2011 called Sample Request. Users create Sample Request activities for Contacts and I want to pass the contact info from the Contact record to the contact info fields of the new activity. I've added a script to the OnChange event of the Regarding field on the Sample Activity form (see script below). It works about 85% of the way, but I am getting the following error on a few lines - 

Line: 37 (and 39)
Error: Unable to get value of the property 'setValue': object is null or undefined

I've marked those lines below in the code. If I run IE in debug I can see the appropriate values (results) are there, but I can't seem to get them to pass to the form.

I am also having an issue with getting the email field to pass at all (no errors).

Any ideas? I appreciate all help. Thanks. 

function getContactDetails()
{
    var lookUpObjectValue = Xrm.Page.getAttribute("regardingobjectid").getValue();
    if ((lookUpObjectValue != null))
    {
        var lookuptextvalue = lookUpObjectValue[0].name;
 
        var lookupid = lookUpObjectValue[0].id;
        //alert(lookupid);
 
 
    var serverUrl = Xrm.Page.context.getServerUrl();
 
    //The XRM OData end-point
    var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
 
 
    var odataSetName = "ContactSet";
 
    var odataSelect = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "(guid'" + lookupid + "')";
 
    //alert(odataSelect);
 
    $.ajax({
        type: "GET",
        contentType: "application/json; charset=utf-8",
        datatype: "json",
        url: odataSelect,
        beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader("Accept", "application/json"); },
        success: function (data, textStatus, XmlHttpRequest) {
 
            var result_contact= data.d;
           
**37**                       Xrm.Page.getAttribute("ml_City").setValue(result_contact.Address1_City); 
                        Xrm.Page.getAttribute("ml_company").setValue(result_contact.ml_companynoacct);
**39**                        Xrm.Page.getAttribute("ml_ContactName").setValue(result_contact.FullName); 
                        Xrm.Page.getAttribute("ml_ContactEmail2").setValue(result_contact.EMailAddress1);
                        Xrm.Page.getAttribute("ml_Address1").setValue(result_contact.Address1_Line1);
                        Xrm.Page.getAttribute("ml_Address2").setValue(result_contact.Address1_Line2);
                        Xrm.Page.getAttribute("ml_Phone").setValue(result_contact.Address1_Telephone1);
                        Xrm.Page.getAttribute("ml_StateProvince").setValue(result_contact.Address1_StateOrProvince);
                        Xrm.Page.getAttribute("ml_ZIPPostalCode").setValue(result_contact.Address1_PostalCode);
                        Xrm.Page.getAttribute("ml_Country").setValue(result_contact.Address1_Country);
                       
        },
        error: function (XmlHttpRequest, textStatus, errorThrown) { alert('OData Select Failed: ' + odataSelect); }
    });
 
    }
 
   }

Response Option Set Values are not available in a Dialog Check Condition step

$
0
0

Hello,

I am creating a dialog that contains a Prompt and Response page called Integer Pick List Response that is configured as follows:

  • Prompt Text - "Pick One"
  • Response Type - Option Set (picklist)
  • Data Type - Integer
  • Log Response - Yes
  • Provide Values - Define Values
  • Response Values - Value = 0, Label = Zero | Value = 1, Label = One | Value = 2, Label = Two | Value = 3, Label = Three | Value = 4, Label = Four | [etc...]

My next step is a Check Condition in which I wish to check to see if the user selected either "Zero" or "One" or "Two" in the previous Prompt and Response step.  I can click to enter the condition on the step, select Local Values > "Integer Pick List Response" in the first field, select "Response Option Set Values" in the second field and select "Equals in the third field.  When I click on the elipsis "..." button in the fourth (enter values) field, the Select Values dialog comes up as expected.  However the response values that I entered in my Prompt and Response step above are not listed!?  The Available Values and Selected Values columns are both blank, preventing me from selecting the values I wish to compare to.

Does anyone know of a reason why the values are not listed?  Have I configured my Prompt and Response step or Check Condition step incorrectly?

Rollup 12 - Error in Older ISV Application

$
0
0

Hello,

We're just starting to evaluate Rollup 12 of Microsoft CRM 2011  After installing Rollup 12 on our POC environment (On Premise) we found an older ISV application we built for displaying data in IFRAMEs is generating the following error.  any ideas?  I found a similar post but unfortunately it's in Spanish.

Thanks for any ideas you may have.

Here is the error:

Server Error in '/ISV/IFrame' Application.
--------------------------------------------------------------------------------

Couldn't find type for class Microsoft.Crm.ServiceModelTraceRedirector, Microsoft.Crm.Core.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: Couldn't find type for class Microsoft.Crm.ServiceModelTraceRedirector, Microsoft.Crm.Core.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:


[ConfigurationErrorsException: Couldn't find type for class Microsoft.Crm.ServiceModelTraceRedirector, Microsoft.Crm.Core.]
   System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData) +8085747
   System.Diagnostics.TypedElement.BaseGetRuntimeObject() +110
   System.Diagnostics.ListenerElement.GetRuntimeObject() +938
   System.Diagnostics.ListenerElement.GetRuntimeObject() +875
   System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() +261
   System.Diagnostics.TraceSource.Initialize() +579
   System.ServiceModel.Diagnostics.DiagnosticTrace.UnsafeRemoveDefaultTraceListener(PiiTraceSource piiTraceSource) +45
   System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(TraceSourceKind sourceType, String traceSourceName, String eventSourceName) +127500
   System.ServiceModel.DiagnosticUtility.InitDiagnosticTraceImpl(TraceSourceKind sourceType, String traceSourceName) +55
   System.ServiceModel.DiagnosticUtility..cctor() +98

[TypeInitializationException: The type initializer for 'System.ServiceModel.DiagnosticUtility' threw an exception.]
   System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath) +59
   System.ServiceModel.Diagnostics.TraceUtility.SetEndToEndTracingFlags() +69
   System.ServiceModel.Diagnostics.TraceUtility..cctor() +8830

[TypeInitializationException: The type initializer for 'System.ServiceModel.Diagnostics.TraceUtility' threw an exception.]
   System.ServiceModel.Diagnostics.TraceUtility.SetEtwProviderId() +58
   System.ServiceModel.ServiceHostingEnvironment.EnsureInitialized() +35
   System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) +106
   System.ServiceModel.Activation.ServiceHttpModule.BeginProcessRequest(Object sender, EventArgs e, AsyncCallback cb, Object extraData) +175
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +115
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.276

How do you set a lookup field in CRM 4.0 from a Sequence Activity

$
0
0

I need to set a lookup field on one entity from another entinty when the checkbox from the first enity  is checked it calls a Sequence Activity  where a stored proc is called. The value of the stored proc gets the guid that is needed to set the lookup field on the second entity.  My code is below which does not work. Please help.


newjeep

CUSTOM FIELD ON APPOINTMENT TO RECURRING APPOINTMENT in mscrm 2011 online

$
0
0

Dear ALL;

i have a custom field on appointment form when i create recurrent appointment. i want my custom field to map with recurrent appointment as well i can i achieve this 

Viewing all 10280 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>