Search This Blog

Monday, August 22, 2016

CRM Component name and thier corresponding Table Name

CRM Component name and thier corresponding Table Name:

NameTable Name
FormSystemForm
ViewSavedQuery
User viewUserQuery
Plugin Message(enable or disable)SdkMessageFilter
Accessing Webresource(enable or disable)Webresrouce- content column encoded as base64

Add new column/control in the phone call activity form in dynamics CRM

Add new column/control in the phone call activity form in dynamics CRM

When we click the "Add phone call" button in an account, It open the phone call with  minimum.


If you want to customize the form or add new column or control to form. Go to setting->Customization ->Entity->Phone Call->Forms->Phone call quick view.

When you open the phone quick view form is not an editable mode.



Solution:
Reason for form not able to editing "Customization" is set to false. To make it as "true".

 A simple trick but it would not work in CRM online.
Here's the SQL query to run against your Org_MSCRM database:
First, run this query to ensure that only 1 records are returned ( one for the Phone Call)
SELECT IsCustomizable, * FROM SystemForm WHERE Name = 'Quick Form' AND ObjectTypeCode IN (4210)

 I suggest taking a copy of the original FormXml from the SQL table before editing so that it can be reverted if something breaks, and a full database backup wouldn't hurt either.
At this point, you can save the results, including the FormXml column to file in case you need to revert any changes.

Then, to enable customisation of the forms:
UPDATE SystemForm SET IsCustomizable = 1 WHERE Name = 'Quick Form' AND ObjectTypeCode IN (4210)

I have tested in CRM 2015 and CRM 2016 it is working perfectly.

Friday, August 19, 2016

How Date time with time zone works in CRM

How Date time with time zone works in CRM


  • DateTime is saved in database as UTC time
  • DateTime queried directly from SQL table or base view returns UTC

  • DateTime in CRM UI is always shown based on user’s local time zone.



  • DateTime queried from filtered view returns users local time

Thursday, August 18, 2016

Change default base currency in CRM 2011

  1. Open Microsoft SQL Server Management Studio and connect to the SQL server hosting your CRM database.
  2. Find database with name [YourCompanyName]_MSCRM
  3. Backup that database!
  4. Open table [dbo].[TransactionCurrencyBase]
  5. The existing base currency is the first row. Ensure the target currency is there.
  6. Open table [dbo].[OrganizationBase] for edit. Find your organization there, most likely there will be just one row.
  7. Change CurrencySymbol, BaseISOCurrencyCode, BaseCurrencySymbol and BaseCurrencyId. The last field’s value you should take from TransactionCurrencyBase table, from the TransactionCurrencyId field.
That’s it. One thing you should bear in mind – if the conversion rate to base currency was used somewhere, the numbers may become incorrect. Like, if the sum was meant in base currency, but the base currency changed without recalculation.

Friday, August 12, 2016

The security timestamp is invalid because its creation time is in the future – Error CRM


 Error:
The security timestamp is invalid because its creation time is in the future – Error CRM

Reason:
  • There was difference in date and time settings between CRM Front end server and CRM DB Server.
  • There was difference in date and time settings between CRM server and plugin server.
  • There was difference in date and time setting between CRM server and AX connector or other integration tool.
Solution:
The Date and time must be same in the both server

Dynamics AX Connector with CRM adaptor settings

AX Connector:

CRM adapter:

CRM on premises:

CRM server time and dynamics adaptor running server time must be same. other wise you cannot connect crm adaptor.

In the CRM adaptor, we are going to use two user.

  • user1 (should not administrator in CRM)
  • user2(administrator in CRM as well as deployment administrator)




CRM on line:

Dynamics adaptor running server time must be correct time . other wise you cannot connect crm adaptor.

To connect CRM adaptor we are going to create two user.


  • user3@2016crm123.onmicrosoft.com(should not administrator in CRM)
  • user4@2016crm123.onmicrosoft.com

Note:
Once you create second user in the CRM online(office 365). Login the second user in CRM because at the time of first login of second user password need must be change. 



Tuesday, August 2, 2016

OData value get or set in CRM CRUD operation

OData Update: 

var objEntity =new Object();
Lookup:
 objEntity.RegardingObjectId =
    {
        Id: entityId,
        LogicalName: "incident",
        Name: subject
    };
Currency:
var objTotalValue = parseFloat(TotalValue);
 objEntity.QuoteTotalAmount =
    {
        Value: objTotalValue.toString()
    };
OptionSet:

var objTotalValue = 3;//OptionSet value not name
 objEntity.CustomerTypeCode=
    {
        Value: objTotalValue
    };
DateTime:
var dtDateTime= Xrm.Page.getAttribute('kti_datecheck').getValue();
//kti_datecheckvalue is a datetime control

 objEntity.kti_DateCheck=dtDateTime;
    
TwoOptions:

//kti_bIsAccountAddress is a twoOption date type control 
objEntity.kti_bIsAccountAddress=true;//value=false or true
OData Read:

Lookup:
var dGuid=Xrm.Page.data.entity.getId();
//Filter customer record in the contact 
var strFilter=$filter=ParentCustomerId/Id eq guid'"+dGuid+"'";
Currency:
//Credit limit is currency data type control 
var strFilter=$filter=CreditLimit/Value eq 1000;
DateTime:
var dtDateTime= Xrm.Page.getAttribute('kti_datecheck').getValue();
//kti_datecheckvalue is a datetime control

var strFilter=$filter=kti_DateCheck eq datetime'"+dtDateTime.toJSON()+"'";

//because ODate value filter supports universal format 2016-08-02T19:05:37Z
    
Option Set:
//Family status code is optionset data type control(value mention in the field) 
var strFilter=$filter=FamilyStatusCode/Value eq 3;
Two Option:


//Credit hold is two option data type control(value either true or false) 
var strFilter=$filter=CreditOnHold eq true;
Filter Guid:

//Credit hold is two option data type control(value either true or false) 
var strFilter=$filter=accountId  eq guid'37cd7ab5-a9ee-e611-80e8-3863bb34de80';

Filter Multiple Guid:

//Credit hold is two option data type control(value either true or false) 
var strFilter=$filter=accountId eq guid'37cd7ab5-a9ee-e611-80e8-3863bb34de80' or accountId eq guid'19b02e31-b4ef-e611-80e8-3863bb34de80' ;

Operator 'eq' incompatible with operand types 'System.Nullable`1[[System.DateTime

Operator 'eq' incompatible with operand types 'System.Nullable`1[[System.DateTime, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]' and 'System.String' at position 25.

In the OData filter you have to pass "datetime" (pass data type)

var strFilter ="$filter=kti_DateCheck eq datetime'2016-08-02T19:05:37Z'"