How to move messages from dead-letter queue to its associated queue (Sequentially)

How to move pending code changes from one branch to another in TFS.

Pre-requisites:-

Make sure you’ve TFS power tools installed in your system. If not, you may download it from below links according to your TFS version

Scenario:-

Ever wondered how to move your pending code changes from one branch to another without manually replicating the changes? Let’s say you have a team project within which there are 3 branches (Main, Branch-v1 and Branch v2) as shown below. You’ve done a lot of code changes in Branch-v1, and now your requirement specification doesn’t allow you to commit the code in the same branch, instead your code is required to be checked-In in Branch-v2. Since the number of changes is high you would certainly want some automated approach to moving your changes to branch-v2 efficiently and accurately without performing a bunch of manual copy-paste operations. So to ease up your work you may follow the below steps.

Steps:-

    • Create a shelve set of all your pending changes.


    • Undo all changes on the current branch (Branch-v1) and ensure there are no pending changes left. (This is important to bypass undetermined workspace error). You may take a physical copy of your code if you’re afraid of losing it.

    • Start Visual Studio Command Prompt.
    • Set the path using “cd” command to the folder where target branch (Branch-v2) is mapped to.

      • Type the below command with appropriate values and hit enter.

 Usage:

tfpt unshelve [shelvesetname] [/source:serverpath] [/target:serverpath] [/migrate]

Example:

    • Shelveset details window appears, check the relevant files and click Unshelve.

    • Conflict window appears, click Auto-merge all or you may resolve it manually as well.

    • Once all conflicts are resolved, click Close.


    • Open the target branch solution in Visual Studio and verify merged changes.

Known issues:-

  • tfpt is not a recognized command

    1. Make sure to use the absolute path to the utility i.e. C:\”Program Files (x86)”\”Microsoft Team Foundation Server 2013 Power Tools”\tfpt
    2. Ensure there is no typo in the command “tfpt”
  • Unable to determine workspace

    1. Double check to set the initial path using “cd” command to the folder where target branch resides.
    2. Take the latest from your source control for both branches.

Please note branches can be spread across different team projects as well.

How to prevent accidental double clicks using Javascript

How to grant admin access in Visual Studio Online

    • Sign in to Visual Studio Online (youraccount.visualstudio.com) as the account owner.
    • On dashboard, select the appropriate team project as highlighted in the screenshot below

    • On team project dashboard, click on settings icon located at the top right bar.

    • Click on Default collection.
    • Navigate to Security tab and click on Users link followed by Member of link as highlighted

    • Search for the user by typing in the name to whom the permissions have to be assigned, and click Join group.
    • Select following two items from the list shown below and click on save changes.
    • Project Collection Administrators
    • Project Collection Service Accounts

Please note in case of multiple users, the same steps need to be followed for each one of them.

Cannot close stream until all bytes are written – C#

This error is raised when the position of stream or memory stream object is set at the end of stream. To resolve the issue either you can set the position to “o” as shown below.

If this doesn’t work, you can re-create the memory stream as shown below

How to create remote site settings through apex.

Step 1:

Create a new class for Metadata Service, and copy the contents of attached Metadata Service file. MetadataService

Step 2:

Add the following endpoints to your remote site settings, It is required to callout the web service.

https://c.ap1.visual.force.com

https://ap1.salesforce.com

Note:- Change sub domains of the endpoints according to your org.

Step 3:

Create a visual force page along with its controller class. And use the following code.

public with sharing class MetaController {

    
public static void createRemoteSiteSettings()
{   
    MetadataService.MetadataPort service = createService();
    MetadataService.RemoteSiteSetting remoteSiteSettings = new MetadataService.RemoteSiteSetting();
    remoteSiteSettings.fullName = ‘Test12345’;
    remoteSiteSettings.url = ‘http://www.google.com’;
    remoteSiteSettings.description=’ewf’;
    remoteSiteSettings.isActive=true;
    remoteSiteSettings.disableProtocolSecurity=false;
    MetadataService.AsyncResult[] results = service.create(new List<MetadataService.Metadata> { remoteSiteSettings });
    MetadataService.AsyncResult[] checkResults = service.checkStatus(new List<string> {string.ValueOf(results[0].Id)});
    system.debug(‘chk’ + checkResults );
}

 public static MetadataService.MetadataPort createService()
{
    MetadataService.MetadataPort service = new MetadataService.MetadataPort();
    service.SessionHeader = new MetadataService.SessionHeader_element();
    service.SessionHeader.sessionId = UserInfo.getSessionId();
    return service;
}

How to implement Parlay X in .NET

In this tutorial, I will explain how to implement Send SMS Interface of Parlay X 2.1 APIs using C#.

Before proceeding, I would like to tell you that Parlay X is a set of standard low-level SOAP based Web API’s used by many telecom service providers. The implementation of interfaces might differ from provider to provider. Before jumping onto the code, ask you telecom provider to share the WSDL’s and Endpoints of the services and their interfaces respectively.

Interface : sendSMS

This interface defines operations to send various types of SMS messages and to subsequently poll for delivery status. There are generally four properties defined in it.

  • addresses specifies the destination address of the short message.
  • senderName is optional and specifies the sender name. The value is a string that is displayed on the user’s terminal as the originator of the message.
  • charging specifies the charging information.
  • receiptRequest is optional and is specified when the application requires receiving notifications of the SMS delivery status. It is a SimpleReference structure that indicates the application endpoint and interface used for notification of delivery receipt, and a correlator that uniquely identifies the sending request.

Below is the sample SOAP request which needs to be generated and sent over. Only header portion has to be created manually, and rest of it would be generated automatically.

Read More