Author: STW Services LLP

  • Calling component by navigation props : Part 12

    Calling component by navigation props- So first open App.js . In this file we have called Index component so now we will call this using navigation here

    So make a function renderIndex before render() function and call it in return

    1. renderIndex() {
    2. this.props.navigation.navigate(‘Index’);
    3. }

    And in return () function after header component replace <Index /> with

    1. { this.renderIndex() }

    So now our Index component from Index.js component will load by navigator

    So remove import Index from ‘./src/components/Index’; from this App.js

    Now we will do same for VideoList component which is called in Index.js

    So again i will create a function in components/Index.js file

    1. renderVideoList() {
    2. this.props.navigation.navigate(‘VideoList’, {
    3. playlistid: ‘LLA34Z3lq8FozSQzDHsSLcmQ’
    4. });
    5. }

    And now i should replace VideoList with this function

    1. { this.renderVideoList() }

    And remove import from this file 

    import VideoList from ‘./VideoList’;

    Here you can see I am passing a props of playlistid which i will get on VideoList page like this now

    Find this line

    const playerid = this.props.playlistid

    & change with

    1. const playerid = this.props.navigation.state.params.playlistid

    To get navigation props value we use this.props.navigation.state.params.propsname

    Now in further step we will make a new page to play video and link that page to this navigation . After linking this page to navigation we will call that page on button click and pass a props as video id . After that on View video page we will display video by youtube video id

  • Creating component to display video : Part 13

    Creating Component To Display Video – So I added further now we wil make a new file in components folder ViewVideo.js

    Now we will start adding code in that so first import React and Component

    1. import React, { Component } from ‘react’;
    2. import { View, Text } from ‘react-native’;
    3. class ViewVideo extends Component {
    4. render() {
    5. return (
    6. <View>
    7. <Text>We will play video here…</Text>
    8. </View>
    9. );
    10. }
    11. }
    12. <span style=”font-weight: 400;”>export default ViewVideo;</span>

    Now we will create screen on navigation and call this page. So open index.js on root

    So first import  ViewVideo on index

    1. import ViewVideo from ‘./src/components/ViewVideo’;

    Not add screen for this so add after comma

    1. …….
    2. YoutubeVideo: {
    3. screen: YoutubeVideo
    4. },
    5. Index: {
    6. screen: Index
    7. },
    8. VideoList: {
    9. screen: VideoList
    10. },
    11. ViewVideo: {
    12. screen: ViewVideo
    13. }
    14. ……

    Now our screen is ready to call as navigator. we have button on each video as View. So we will call on Press function to pass props and video id and send to ViewVideo page.

    Open VideoList.js file and find code where <Button /> added

    Add onPress function in it

    1. <Button onPress={() => this.props.navigation.navigate(‘ViewVideo’, { vidid: video.id })}>

    this.props.navigation.navigate this function call screen and send to that screen which is added in ‘ ‘ second parameter is props . i have taken vidid as props and assigned video id value to it

    So now we will refresh simulator 

  • Passing Navigation props to screen : Part 14

    Passing Navigation props to screen – Open View Video.js file and get props video id . so our code should be to get value.

    this.props.navigation.state.params.vidid;

    so add

    1. const videoId = this.props.navigation.state.params.vidid;

    Now we can call { vidid } and use to display videoid which is clicked on VideoList page. So to check it 

    Now in return we will call vidid in Text

    So change Text like this

    1. <Text>{vidid}</Text>

    Now refresh simulator and click on button of any video you will see that video id on that page

    Now import WebView from react-native

    WebView use to embed any url on page . It is same like we use iframe in normal html code. So we will use youtube embed url to embed video here using this component

    Now in return add this code

    1. <WebView
    2. source={{ uri: ‘https://www.youtube.com/embed/’ + videoId }}
    3. />
  • Modifying Navigation & Header : Part 15

    Modifying Navigation & Header – Copy api key and add in ViewVideo youtube parameter which was null. Now your code is ready to play video.

    But you can see a arrow in header of page. If you would like to remove it you nee to pass a option in navigator.

    So add this new code

    const options = {

     header: null

    };

    And now we will call this navigation option in StackNavigator so your code should look like this

    const AppNav = StackNavigator({

       YoutubeVideo: {

         screen: YoutubeVideo

       },

       Index: {

         screen: Index

       },

       VideoList: {

         screen: VideoList

       },

       ViewVideo: {

         screen: ViewVideo

       }

     },

       {

         navigationOptions: options

       }

    );

    Final code of screen in index.js

    1. import { AppRegistry } from ‘react-native’;
    2. import { StackNavigator } from ‘react-navigation’;
    3. import YoutubeVideo from ‘./App’;
    4. import VideoList from ‘./src/components/VideoList’;
    5. import Index from ‘./src/components/Index’;
    6. import ViewVideo from ‘./src/components/ViewVideo’;
    7. const options = {
    8. header: null
    9. };
    10. const AppNav = StackNavigator({
    11. YoutubeVideo: {
    12. screen: YoutubeVideo
    13. },
    14. Index: {
    15. screen: Index
    16. },
    17. VideoList: {
    18. screen: VideoList
    19. },
    20. ViewVideo: {
    21. screen: ViewVideo
    22. }
    23. },
    24. {
    25. navigationOptions: options
    26. }
    27. );
    28. AppRegistry.registerComponent(‘youtube_video’, () => AppNav);

    Now you can see we have blank page when go back , it is because we have Index screen to load then video list screen to load, So now we will do some modifications to use navigator header and remove Index component

    Final touch

    Now open VideoList.js and change variable with this code

    1. const url = ‘http://www.youtube.com/feeds/videos.xml?playlist_id=LLA34Z3lq8FozSQzDHsSLcmQ’;

    Now you can see i have directly added playlist id in const url

    Well, Now we will create a function to render navbar header

    1. renderNavBar() {
    2. return (
    3. <View style={styles.navBar}>
    4. <TouchableOpacity style={styles.logo} >
    5. <Text style={styles.text}>Pankaj Bhadouria Masterchef</Text>
    6. </TouchableOpacity>
    7. </View>
    8. );
    9. }

    and call this function in render function of component where header is called, So remove Header component and add

    1. render() {
    2. return (
    3. <View>
    4. { this.renderNavBar() }
    5. <ScrollView>
    6. {this.renderthumbnails()}
    7. </ScrollView>
    8. </View>
    9. );
    10. }

    If you want to show video title of youtube on view video page so pass video.title props in onPress function so change like this

    1. <Button
    2. onPress={() => this.props.navigation.navigate(‘ViewVideo’, { vidid: video.id, vidtitle: video.title })}
    3. >

    and finally open ViewVideo.js and call this props like this

    1. import React, { Component } from ‘react’;
    2. import { View, WebView } from ‘react-native’;
    3. import NavBar from ‘../common/NavBar’;
    4. class ViewVideo extends Component {
    5. render() {
    6. const videoId = this.props.navigation.state.params.vidid;
    7. const videoTitle = this.props.navigation.state.params.vidtitle;
    8. return (
    9. <View style={{ flex: 1 }}>
    10. <NavBar
    11. navigator={this.props.navigation}
    12. title={videoTitle}
    13. />
    14. <WebView
    15. source={{ uri: `https://www.youtube.com/embed/${videoId}` }}
    16. />
    17. </View>
    18. );
    19. }
    20. }
    21. export default ViewVideo;

    Now our application is ready to play youtube video . If you need to find code you can find it on GIT

    In this tutorial we learned how to install react native , create component, create design , navigation and parse video xml of youtube

    Hope you enjoyed it !!

  • Steps to upgrade Online CRM to Dynamics 365

    Steps to upgrade Online CRM to Dynamics 365 – Microsoft Dynamics 365 CRM out into the market and to use new features like field services etc, you have to upgrade online CRM to 365. Upgrading online CRM is very confusing as users have not full control over instance and have fear to lose data or customizations. To give Dynamics CRM upgrade a clear view you can refer this article.

    Step1: Setup Sandbox instance of your Online CRM.

    Dynamics CRM Sandbox account is useful for development and to test customizations before publishing on a production instance. It’s also useful for upgrade process from lower version to upper version.

    Sandbox instance as can be purchased as add-on subscription or with 25 user’s subscription licenses. To setup, sandbox instance using production instance, select production instance and click on copy icon.

    Dynamic 365

    It takes to Copy instance window.

    The properties you need to care about are:

    1. Target Instance: In the current case, it will be production instance.
    2. Copy Type: Recommended type is a Minimal copy.
    3. Name: should be the name of Sandbox instance.

    And click on Copy. It will take a while to update sandbox account copy of production.

    update sandbox account copy of production

    Step 2: Test upgrade of sandbox instance

    When a copy of production as sandbox instance, is ready to test CRM instance upgrade process using sandbox CRM instance.

    One thing you need to know that is when production instance is ready for an upgrade, to let that know go to Admin Center > Dynamics CRM.

    Admin Center Dynamics CRM

    Instances that are eligible to update will see Update is Available. You can see along with your CRM instance.

    Select updates tab and schedule upgrade for sandbox instance.

    Dynamics Online CRM

    The process you have to follow for a lower version to upper version upgrade is:

    To Upgrade

    1. Dynamics Online CRM To Dynamics Online CRM Update 1
    2. Dynamics Online CRM Update 1 To Dynamics 365 CRM

    After scheduling dynamics CRM upgrade process, it will be updated on your scheduled time. It might be possible, current customizations are not supported by updated version. Upgrade process gets failed. So you have to reset sandbox back to old version and fix all those issues in sandbox instance and again follow the same process of schedule sandbox instance upgrade to the target version.

    Dynamic 365

    Step 3: Upgrade Production Instance

    Once your sandbox instance is upgraded, approve upgrade. Same process you need to follow to upgrade production instance upgrade. Also, keep in mind your instance upgrade will not be upgraded till you approve upgrades.

  • Adding Content Templates to Editor in Kentico 9

    Adding Content Templates to Editor in Kentico 9 – It’s handy to adding site typography as content templates in Kentico CKeditor. Follow steps given below to add and customize CKeditor toolbar and include new content templates.

    Important : Must check Kentico CKeditor version to download content templates from given link http://ckeditor.com/addon/templates.

    Step1: Download sample content template from http://ckeditor.com/addon/templates. Extract downloaded zip folder and copy template folder in \CMS\CMSAdminControls\CKeditor\plugins. It should look like example image.

    Content Template Plugin

    Step 2: Adding config properties  – Open config.js file under CKeditor folder and add these lines on top of file along with other properties-

    config.extraPlugins = ‘templates’;

    /* CMS */

    config.plugins += ‘,showborders’;

    /* Templates */

    config.plugins += ‘,templates’;

    It should be like image example.

    Kentico Template

    Step3: Customize toolbar : Add template after source in toolbar_FULL

    config.toolbar_Full = [

    [sourceName, ‘-‘, ‘Templates’],

    [‘Cut’, ‘Copy’, ‘Paste’, ‘PasteText’, ‘PasteFromWord’, ‘Scayt’, ‘-‘],

    [‘Undo’, ‘Redo’, ‘Find’, ‘Replace’, ‘RemoveFormat’, ‘-‘],

    [‘Bold’, ‘Italic’, ‘Underline’, ‘Strike’, ‘Subscript’, ‘Superscript’, ‘-‘],

    [‘NumberedList’, ‘BulletedList’, ‘Outdent’, ‘Indent’, ‘Blockquote’, ‘CreateDiv’, ‘-‘],

    [‘JustifyLeft’, ‘JustifyCenter’, ‘JustifyRight’, ‘JustifyBlock’, ‘-‘],

    ‘/’,

    [‘InsertLink’, ‘Unlink’, ‘Anchor’, ‘-‘],

    [‘InsertImageOrMedia’, ‘QuicklyInsertImage’, ‘Table’, ‘HorizontalRule’, ‘SpecialChar’, ‘-‘],

    [‘InsertForms’, ‘InsertPolls’, ‘InsertRating’, ‘InsertYouTubeVideo’, ‘InsertWidget’, ‘-‘],

    [‘Styles’, ‘Format’, ‘Font’, ‘FontSize’],

    [‘TextColor’, ‘BGColor’, ‘-‘],

    [‘InsertMacro’, ‘-‘],

    [‘Maximize’, ‘ShowBlocks’]

    ];

    It should be like:

    Kentico

    Step4: Setup toolbar_Full, At bottom of config file change value –

    config.toolbar = config.toolbar_Full;

    Now ckeditor is ready to use templates and can do testing after login in CMSDesk. Open editable page. Ckeditor should show template icon along with source.

    Kentico Template

    After clicking in template icon, it will show all available content templates.  You can select any of these templates and insert in editable part and modify accordingly. You don’t need to be worried about styling content text. It helps non technical person to make pages and style it easily.

    capture5

    Next part is,  how to add new templates in editor. Open default.js file under CKeditor/plugins/templates/templates/default.js

    capture6

    Default.js already has some inbuilt templates, you can add more templates using same structure. Using example I added youtube responsive video template at bottom of default.js file.

    {

    title: ‘Responsive YouTube Video (with controls)’,

    //image: ‘template1.gif’,

    description: ‘Responsive YouTube Video (with controls)’,

    html: ‘<div class=”youtube-container”><div class=”youtube-player” data-controls=”1″ data-id=”h6w0uEgMXuQ”><div class=”play-button”> </div></div>’ +

    ‘\r\n</div><div style=”color:red;”>You must view source, edit the data-id and replace value with YouTube video id (then delete this line)</div>\r\n’

    }

    capture7
  • Connection from PHP to Microsoft Dynamics CRM

    Connection from PHP to Microsoft Dynamics CRMThis time we will learn how to connect Microsoft dynamics CRM using PHP code. Microsoft dynamics CRM soap service can be a way to make calls from PHP source code. A valid soap header is required to execute soap request. Let’s see how to create a valid header using PHP code:

    To get valid soap request, first need to create token1, token2, and keyIdentifer which can be created using online user name and password.

    Soap enavlop for getting token1, token2, ekyidentifer:

    $xml = “<s:Envelope xmlns:s=\”http://www.w3.org/2003/05/soap-envelope\” xmlns:a=\”http://www.w3.org/2005/08/addressing\” xmlns:u=\”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\”>”;

    $xml .= “<s:Header>”;

    $xml .= “<a:Action s:mustUnderstand=\”1\”>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:Action>”;

    $xml .= “<a:MessageID>urn:uuid:” . $this->newGUID () . “</a:MessageID>”;

    $xml .= “<a:ReplyTo>”;

    $xml .= “<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>”;

    $xml .= “</a:ReplyTo>”;

    $xml .= “<a:To s:mustUnderstand=\”1\”>https://login.microsoftonline.com/RST2.srf</a:To>”;

    $xml .= “<o:Security s:mustUnderstand=\”1\” xmlns:o=\”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\”>”;

    $xml .= “<u:Timestamp u:Id=\”_0\”>”;

    $xml .= “<u:Created>” . gmdate ( ‘Y-m-d\TH:i:s.u\Z’, $now ) . “</u:Created>”;

    $xml .= “<u:Expires>” . gmdate ( ‘Y-m-d\TH:i:s.u\Z’, strtotime ( ‘+60 minute’, $now ) ) . “</u:Expires>”;

    $xml .= “</u:Timestamp>”;

    $xml .= “<o:UsernameToken u:Id=\”uuid-” . $this->newGUID () . “-1\”>”;

    $xml .= “<o:Username>” . $username . “</o:Username>”;

    $xml .= “<o:Password>” . $password . “</o:Password>”;

    $xml .= “</o:UsernameToken>”;

    $xml .= “</o:Security>”;

    $xml .= “</s:Header>”;

    $xml .= “<s:Body>”;

    $xml .= “<trust:RequestSecurityToken xmlns:trust=\”http://schemas.xmlsoap.org/ws/2005/02/trust\”>”;

    $xml .= “<wsp:AppliesTo xmlns:wsp=\”http://schemas.xmlsoap.org/ws/2004/09/policy\”>”;

    $xml .= “<a:EndpointReference>”;

    $xml .= “<a:Address>urn:” . $urnAddress . “</a:Address>”;

    $xml .= “</a:EndpointReference>”;

    $xml .= “</wsp:AppliesTo>”;

    $xml .= “<trust:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</trust:RequestType>”;

    $xml .= “</trust:RequestSecurityToken>”;

    $xml .= “</s:Body>”;

    $xml .= “</s:Envelope>”;

    In response, you will get element “CipherValue” which has both tokens which you can fetch from response. See sample code:

    $response = curl_exec ( $ch );

    curl_close ( $ch );

    $responsedom = new DomDocument ();

    $responsedom->loadXML ( $response );

    $cipherValues = $responsedom->getElementsbyTagName ( “CipherValue” );

    $token1 = $cipherValues->item ( 0 )->textContent;

    $token2 = $cipherValues->item ( 1 )->textContent;

    Next is to get KeyIdentifier value which you can get using “KeyIdentifier” element name from response.

    $keyIdentiferValues = $responsedom->getElementsbyTagName ( “KeyIdentifier” );

    Now need to get online header using token1, token2 and KeyIdentifier. Below you can see example of header xml for Soap request:

    $xml = “<s:Header>”;

    $xml .= “<a:Action s:mustUnderstand=\”1\”>http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute</a:Action>”;

    $xml .= “<Security xmlns=\”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\”>”;

    $xml .= “<EncryptedData Id=\”Assertion0\” Type=\”http://www.w3.org/2001/04/xmlenc#Element\” xmlns=\”http://www.w3.org/2001/04/xmlenc#\”>”;

    $xml .= “<EncryptionMethod Algorithm=\”http://www.w3.org/2001/04/xmlenc#tripledes-cbc\”/>”;

    $xml .= “<ds:KeyInfo xmlns:ds=\”http://www.w3.org/2000/09/xmldsig#\”>”;

    $xml .= “<EncryptedKey>”;

    $xml .= “<EncryptionMethod Algorithm=\”http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p\”/>”;

    $xml .= “<ds:KeyInfo Id=\”keyinfo\”>”;

    $xml .= “<wsse:SecurityTokenReference xmlns:wsse=\”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\”>”;

    $xml .= “<wsse:KeyIdentifier EncodingType=\”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\” ValueType=\”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier\”>” . $keyIdentifer . “</wsse:KeyIdentifier>”;

    $xml .= “</wsse:SecurityTokenReference>”;

    $xml .= “</ds:KeyInfo>”;

    $xml .= “<CipherData>”;

    $xml .= “<CipherValue>” . $token1 . “</CipherValue>”;

    $xml .= “</CipherData>”;

    $xml .= “</EncryptedKey>”;

    $xml .= “</ds:KeyInfo>”;

    $xml .= “<CipherData>”;

    $xml .= “<CipherValue>” . $token2 . “</CipherValue>”;

    $xml .= “</CipherData>”;

    $xml .= “</EncryptedData>”;

    $xml .= “</Security>”;

    $xml .= “<a:MessageID>urn:uuid:” . $this->newGUID () . “</a:MessageID>”;

    $xml .= “<a:ReplyTo>”;

    $xml .= “<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>”;

    $xml .= “</a:ReplyTo>”;

    $xml .= “<a:To s:mustUnderstand=\”1\”>” . $url . “XRMServices/2011/Organization.svc</a:To>”;

    $xml .= “</s:Header>”;

    CRM URN Address based on the Online region of customer. You can use this function to get correct URN:

    function GetUrnOnline($url) {

    if (strpos ( strtoupper ( $url ), “CRM2.DYNAMICS.COM” )) {

    return “crmsam:dynamics.com”;

    }

    if (strpos ( strtoupper ( $url ), “CRM4.DYNAMICS.COM” )) {

    return “crmemea:dynamics.com”;

    }

    if (strpos ( strtoupper ( $url ), “CRM5.DYNAMICS.COM” )) {

    return “crmapac:dynamics.com”;

    }

    if (strpos ( strtoupper ( $url ), “CRM6.DYNAMICS.COM” )) {

    return “crmoce:dynamics.com”;

    }

    if (strpos ( strtoupper ( $url ), “CRM7.DYNAMICS.COM” )) {

    return “crmjpn:dynamics.com”;

    }

    if (strpos ( strtoupper ( $url ), “CRM9.DYNAMICS.COM” )) {

    return “crmgcc:dynamics.com”;

    }

    return “crmna:dynamics.com”;

    }

    Using header you can connect Dynamics CRM from PHP code. See example code lines to get list data from PHP code:

    / Get Dynamics CRM Online Header

    $url = “https://org.crm.dynamics.com/”;

    $username = “user@dynamics.net”;

    $password = “password”;

    $dynamicsCrmHeader = new DynamicsCrmHeader ();

    $authHeader = $dynamicsCrmHeader->GetHeaderOnline ( $username, $password, $url );

    // Get Dynamics CRM Online Header

    Soap request for getting list:

    $xml .= “<s:Envelope xmlns:s=\”http://www.w3.org/2003/05/soap-envelope\” xmlns:a=\”http://www.w3.org/2005/08/addressing\”>”;

    $xml .= $authHeader->Header;

    $xml =”<s:Body>”;

    $xml .=”<Execute xmlns=\”http://schemas.microsoft.com/xrm/2011/Contracts/Services\” xmlns:i=\”http://www.w3.org/2001/XMLSchema-instance\”>”;

    $xml .=”<request i:type=\”a:RetrieveMultipleRequest\” xmlns:a=\”http://schemas.microsoft.com/xrm/2011/Contracts\”>”;

    $xml .=”<a:Parameters xmlns:b=\”http://schemas.datacontract.org/2004/07/System.Collections.Generic\”>”;

    $xml .=”<a:KeyValuePairOfstringanyType>”;

    $xml .=”<b:key>Query</b:key>”;

    $xml .=”<b:value i:type=\”a:QueryExpression\”>”;

    $xml .=”<a:ColumnSet>”;

    $xml .=”<a:AllColumns>true</a:AllColumns>”;

    $xml .=”<a:Columns xmlns:c=\”http://schemas.microsoft.com/2003/10/Serialization/Arrays\”>”;

    $xml .=”</a:Columns>”;

    $xml .=”</a:ColumnSet>”;

    $xml .= “<a:Criteria>”;

    $xml .= “<a:Conditions />”;

    $xml .= “<a:FilterOperator>And</a:FilterOperator>”;

    $xml .= “<a:Filters />”;

    $xml .= “</a:Criteria>”;

    $xml .=”<a:Distinct>false</a:Distinct>”;

    $xml .=”<a:EntityName>list</a:EntityName>”;

    $xml .=”<a:LinkEntities />”;

    $xml .=”<a:Orders />”;

    $xml .=”<a:PageInfo>”;

    $xml .=”<a:Count>0</a:Count>”;

    $xml .=”<a:PageNumber>0</a:PageNumber>”;

    $xml .=”<a:PagingCookie i:nil=\”true\” />”;

    $xml .=”<a:ReturnTotalRecordCount>false</a:ReturnTotalRecordCount>”;

    $xml .=”</a:PageInfo>”;

    $xml .=”<a:NoLock>false</a:NoLock>”;

    $xml .=”</b:value>”;

    $xml .=”</a:KeyValuePairOfstringanyType>”;

    $xml .=”</a:Parameters>”;

    $xml .=”<a:RequestId i:nil=\”true\” />”;

    $xml .=”<a:RequestName>RetrieveMultiple</a:RequestName>”;

    $xml .=”</request>”;

    $xml .=”</Execute>”;

    $xml .=”</s:Body>”;

    $xml .= “</s:Envelope>”;

    You need to make soap call and convert response as  DomDocument.

    $client = new DynamicsCrmSoapClient ();

    $response = $client->ExecuteSOAPRequest ($xml, $url );

    //echo $response;

    $responsedom = new DomDocument ();

    $responsedom->loadXML ( $response );
    Please find code sample here: https://github.com/stw-services/Dynamics-CRM/tree/master/PHP-MSCRM

    🙂

    Thanks for reading 

  • Dynamics CRM 2015 setup a demo Virtual Machine.

    Dynamics CRM 2015  setup a demo Virtual Machine.

    With most MicroSoft  products this is pretty easy to setting up, but Dynamics has a more heavier requirements list.

    The prerequisites include:

    let’s get started:

    Step 1: First Install Windows 2012 R2 Standard Edition

    I’m using VMWare (but you could use HyperV, Virtual Box as well).

    1. Create a new Virtual Machine, assign 4GB RAM, 40 GB HDD, 1 CPU (it’s only a demo environment so these specs should be fine)
    2. Attach the Windows 2012 ISO and do a vanilla installation

    Step 2, Run the Active Directory wizard

    CRM needs Active Directory, so run the Active directory wizard:

    Figure: Configure Active Directory

    1. In Server Manager select ManageAdd Roles and Feature
    2. Installation Type | Roles-based or Feature-based installation 
    3. Server RolesActive Directory Domain Services
    4. Select Add Features
    5. Proceed through the wizard and then select Install
    6. Once completed select Promote this server to a domain controller

    Figure: Promote Domain Controller

    1. Deployment Configuration | Add new forest and enter your Root domain name which is Demo.Local
    2. Select Windows Server 2012 R2for forest and domain function level
    3. Set Password for Directory Services Restore Mode
    4. Click on Next, Install
    5. Now sit back and wait, after a reboot you will be able to login in to the domain

    Note: It’s a good idea to have a static IP address on this machine, but it’s only a warning at this stage.

    Step 3, Windows Server Prerequisites

    • Indexing Service
    • IIS Admin
    • World Wide Web Publishing
    1. Server Manager | Manage | Add Roles and Features
    2. Server Roles:
      1. Application Server
      2. Web Server (IIS)
    3. Features:
      1. .Net Framework 3.5 Features
      2. .Net Framework 4.5 FeaturesNET 4.5
    4. Web Server Role (IIS) | Role Services:
      1. Application Development | ASP.NET 3.5
      2. Application Development | ASP.NET 4.5
    5. Install

    Step 4, Install SQL Server

    I’ll be installing SQL Server 2014 Developer Edition with the following options:

    Feature Selection:

    1. Database Engine Services
    2. Full-Test and Semantic Extractions for Search
    3. Reporting Services Native
    4. Management Tools Basic
      1. Management Tools – Complete

    Step 5,Database Engine Configuration:

    1. Select Mixed Mode (personal preference)
    2. Specify SQL Server Administrators| select Add Current User 

    Step 6 ,Reporting Services Native Mode:

    1. Select Install Only

    Install using all other defaults.

    Step 7, Configure Reporting Services Native Install

    Run SQL Server 2014 Reporting Services Configuration Manager and set-up the Native Reporting Services installation.

    This is should pretty much be a next, next, apply thing,

    Mine fired up straight away by just using the defaults:

    Figure: Reporting Services Configuration Manager
    Figure: Reporting Services Home Page

    Step 8, Now Install CRM 2015 finally..!!

    Figure: CRM Installation

    1. Get Recommended Updates| select Get Updates (Which is optional)
    2. Enter your license key
    3. Accept the EULA
    4. At this point you may have a bunch of missing required components, install them (We will take a while, also you may need to reboot system)

    Figure: Install Required Components

    1. Select Default Installation Path
    2. Specify Server RolesSelect All Options

    Figure: Server Roles

    1. Specify Deployment Options| Enter SQL Server Hostname ie: CRM2014Demo
    2. Select the Organizational UnitEnter the Organizational Unit
      1. At this point it’s probably a good idea to jump into Active Directory Users and Computersand create an OU for CRM

    Figure: Create CRM OU
    Figure: Assign CRM OU

    1. Specify Service Accounts, Now we’ll need to specify our service accounts for the various CRM Services, since we don’t have any accounts setup, we’ll end up jumping back and forth between Active Directory Users and Computers and the CRM Installation wizard, As this is a DEMO environment I’m going to use NETWORK SERVICE for the accounts.

    Figure: Service Accounts

    1. Select Website | Default Website
    1. Email Router Setting | EmptyOrganization Settings| Populate with your Organisation Name and other settings
    1. Report Server URL |Should be pre-populated check the URL

    Click next wizard button and install CRM.

    After installation of MS CRM it will auto start reporting in service setup.

    Click Do not get updates and click next button. In next screen accept line cne and click next.

    Select server server computer name and click next

    Select database name

    Click next wizard button and install, finally you will get finish screen.

    Figure: CRM Install Finished
    And finally let’s start CRM 2015, wow worked first go!

  • How to create theme in Magento 2

    How to create theme in Magento 2

    How to create theme in Magento 2-

    1. Install magento 2.
    2. Go to admin panel and login.
    3. Now you may see this window ( links not working )

    4. To solve the issue, open your xampp shell

    5. Specify your path

    6.  Run following command from Magento root:
    php bin/magento setup:static-content:deploy

    7. Go to admin panel and check if the issue has fixed. You can see the admin panel like this.

    8. Now you can start with creating your custom theme.
    9. At first, create your folder in C:\xampp\htdocs\Magento2_new\app\design\frontend\ and create your folder within

    10. Add or copy from an existing theme.xml to your theme directory app/design/frontend/

    11.  Add a composer.json file to the theme directory and register the package on a packaging server.

    12. To register your theme in the system, in your theme directory add a registration.php file with the following content:

    13. Copy a media folder from an existing theme to your theme directory.
    14. Create directories for static files. Your theme will likely contain several types of static files: styles, fonts, JavaScript and images. Each type should be stored in a separate sub-directory of web in your theme folder:

    15. At this point your theme file structure looks as follows:

    16. Your theme is created now. Login to admin panel and go to Stores -> Configuration -> Design, you can see your theme. Select your theme and save it.

    17. Run the following commands for static content deployment and database update from your root directory
    php bin/magento setup:static-content:deploy
    php bin/magento setup:upgrade
    18. You can customize your site now, using your own theme.