Tuesday, September 29, 2020

MSCRM+ on premise plugin error + could not find default endpoint element that references contract

 Hi All,


If you get error with could not find default endpoint element that references contract


while trying in Plugins or Workflow Activity

Please use below code in your code


BasicHttpBinding myBinding = new BasicHttpBinding();

                myBinding.Name = "BasicHttpBinding_Service";

                myBinding.Security.Mode = BasicHttpSecurityMode.None;

                myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;

                myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;

                myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;


                // Endpoint Address defining the asmx Service to be called.

                EndpointAddress endPointAddress = new EndpointAddress(@"http://yourwebservice.com/sms_ws/Service.asmx");


                // Call to the Web Service using the Binding and End Point Address.

                SendSMS.ServiceSoapClient myClient = new SendSMS.ServiceSoapClient(myBinding, endPointAddress);

Monday, September 21, 2020

HttpClient + GUID Create Record Mscrm C#

 HttpClient httpClient = GetHttp().Result;

            //var appSettings = ConfigurationManager.AppSettings;

            String apiUrl = "https://ORG.crm4.dynamics.com/api/data/v9.1/";

            JObject idea = new JObject();

  idea.Add("admin_BusinessPoint@odata.bind","/systemusers("+ getUserGuid.Result.ToString().Replace("}","").Replace("{","") + ")");


PASS CRM FIELD INSTED LOGICAL NAME

response.Content.ReadAsStringAsync().Result - retrieve values

Convert 


var retrievedcontact1 = response.Content.ReadAsStringAsync().Result;

                dynamic data = JObject.Parse(retrievedcontact1);

                RootObject objects = JsonConvert.DeserializeObject<RootObject>(response.Content.ReadAsStringAsync().Result);


public class Value

        {

            [JsonProperty("@odata.etag")]

            public string etag { get; set; }

            public string systemuserid { get; set; }

            public string ownerid { get; set; }

        }


        public class RootObject

        {

            [JsonProperty("@odata.context")]

            public string context { get; set; }

            public List<Value> value { get; set; }

        } 

Thursday, September 10, 2020

Trigger Workflow MSCRM c#

var executeWorkflowRequest = new ExecuteWorkflowRequest()  

{  

  WorkflowId = Guid.Parse(""), // Guid of workflow  

  EntityId = Guid.Parse("") // Guid of record  

};              

var executeWorkflowResponse =(ExecuteWorkflowResponse)orgService.Execute(executeWorkflowRequest); 

Saturday, July 25, 2020

Preimage is Null / Entity PreImage on Plugins C# MSCRM/CDS

Get values of Preimage

PreImage name : "AccountPreImage"


EntityReference requistionContext = (EntityReference)context.InputParameters["Target"];
Entity preImageEntity = (context.PreEntityImages != null && context.PreEntityImages.Contains("AccountPreImage")) ? context.PreEntityImages["AccountPreImage"] : null;

Thursday, July 16, 2020

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Use the ASP.NET IIS Registration Tool ("aspnet_regiis.exe") to register the correct version of ASP.NET.

Steps:
1. Logon to the Controller application server as a Windows administrator
2. Launch a Command prompt
3. Type the following commands:
    cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

    aspnet_regiis.exe -iru

Saturday, July 4, 2020

Enable Sideloading of apps

Prerequisites :
Site should be created using developer template.
2-Steps Solution:
1) Download and install SharePoint Online Management Shell
2) Execute the script below. (Note that the Sideloading Feature ID is harcoded in SharePoint, as are many other OOTB features)
#CODE STARTS HERE
$programFiles = [environment]::getfolderpath("programfiles")
add-type -Path $programFiles'\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll'
Write-Host 'Ready to enable Sideloading'
$siteurl = Read-Host 'Site Url'
$username = Read-Host "User Name"
$password = Read-Host -AsSecureString 'Password'
 
$outfilepath = $siteurl -replace ':', '_' -replace '/', '_'
 
try
{
    [Microsoft.SharePoint.Client.ClientContext]$cc = New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)
    [Microsoft.SharePoint.Client.SharePointOnlineCredentials]$spocreds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
    $cc.Credentials = $spocreds
    $site = $cc.Site;

    $sideLoadingGuid = new-object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D"
    $site.Features.Add($sideLoadingGuid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);
     
    $cc.ExecuteQuery();
     
    Write-Host -ForegroundColor Green 'SideLoading feature enabled on site' $siteurl
    #Activate the Developer Site feature
}
catch
{ 
    Write-Host -ForegroundColor Red 'Error encountered when trying to enable SideLoading feature' $siteurl, ':' $Error[0].ToString();
}

#CODE ENDS HERE
In your SPO Management Shell enter the url of the site you want to deploy the solution, the administrator username and the password. The powershell will take care of the rest.

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...