Monday, February 29, 2016

Set Always run as Admin permanently for any Program

In any Microsoft Windows version (including XP and Later), you have to right-click on the executable file (exe) and select "Troubleshoot compatibility".
  1. Select "Troubleshoot program"
  2. check "The program requires additional permissions"
  3. Click "Next", click "Test the program..."
  4. Wait for the program to launch
  5. click "Next"
  6. select "Yes, save these settings for this program"
  7. click "Close"
After doing this, No matter how many shortcuts you create for your program, those will be executed with Admin privileges if your current login has administrator privileges for your local environment, if not you will be prompted to enter the admin credentials. 

Wednesday, February 24, 2016

Configure WCF for IIS on Windows 8

I have encountered with this issue when I was trying to deploy a WCF service on a fresh Windows 8.1 machine.


My next action was to try registering ASP.Net applications for IIS using ASP.Net IIS Registration tool (aspnet_regiis -i) as all the IIS default components have been already installed and functioning.

I've installed the below options in .Net Framework 4.5 Advanced Services from the Windows Features (as described in this msdn blog) and my WCF service got up and running.


If you are a console lover, you can use these commands in command prompt to enable the HTTP Activation.

C:\> DISM /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation
C:\> DISM /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation45

Monday, February 22, 2016

First SAP Business One Add-On Project on Visual Studio 2013 using SAPBusinessOneSDK

In this post, I'm going to explain how I created my first SAP Business One Add-On Project using Visual Studio 2013.

Before progressing ahead you must verify the prerequisites mentioned in this SAP Community Page.

After you have installed the SAP Business One studio, make a search in the start menu.



- SAP Business One Studio (32-bit), is the SAP in-build IDE provided for Add-on development.


- SAP Business One Studio for Microsoft Visual Studio 2013 opens up the visual studio 2013


If you want to create the add-on from a Package generated by the "SAP Business One Studio" go ahead with the "SAP Business One Add-On Project From B1s File" project type and Visual Studio will prompt you to browse your 'b1s' file.

Select "SAP Business One Add-On Project", and you will get an SAP Business One to look and feel form as below.


When you start debugging the project you will be hit with the below exception.



The reason was I haven't opened up the SAP Business One Client (32-bit) before starting the debugging process.

I have updated the Title property of Form1 as "Hello Sap B1" and pressed F5.


1- My add-on is listed under the Modules of the Main Menu.
2- Form1 will be visible when you click on Hello_SAP_B1.
3-When Form1 is clicked, you could see your form inside the SAP Business One.

Then open the Menu.cs file, according to my understanding the code in this file controls how the add-on is shown in the SAP Business One Client.

I've done a few changes in the Menu.cs file with the intention of observing how it behaves.

I've changed the name of the package (removed underscore signs), added an extra code block to check and remove if my add-on it is listed in the Main Menu, and changed the display name of my form.


I've got the exact result that I wanted. Then I renamed Form1.b1f in the solution as "HelloB1.b1f" and set the same value for Unique ID. (Note::this change is indicated in the Menu.cs file code change by a red arrow).

oCreationPackage.UniqueID = "Hello_SAP_B1.HelloB1";

If you debug the project at this stage your form will be listed in the main menu but will not be popped out. Luckily I could find out what was the reason by observing the HelloB1.b1f.cs file.



Even I have renamed the Form from Solution Explorer, which has not renamed the name of the behind class and certain annotation properties. So I've altered "Form1" with "HelloB1", as a result, you even will get two compilation issues in SBO_Application_MenuEvent of Menu.cs class.

After doing the below amendments, I could see my form inside the SAP Business One.



These are the first few experiences that I had with the SAP Business One add-on development, and I believe this post will be informative for all the people who start it for the first time.

I'm pretty sure these PDFs will save a few days of your life.

How to Guide SAP Business One 9.0

SAP Business One – SoftwareDevelopment Kit (SDK)

Web site of  Mepa-Data AG

Sunday, February 21, 2016

SANA Configuration issue with SAP Business One during the initial SANA setup

I've recently come across with below error in SANA admin.

Retrieving the COM class factory for component with CLSID
{F3D77DAE-6C14-426E-B56F-C550BDE8B09D} failed due to the following error:
 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).



In my setup, Both Sana and SAP Business One (Test) were deployed in my local PC. After trying out several ways, finally got the correct response from Sap Community Network.

If the SAP Business One installation and SANA installation are on two nodes, you have to apply the below to the node where SAP Business One is installed.


1. Click Start --> Run
2. Enter DCOMCNFG and press OK. This will open the DCOMCNFG window.
3. Browse down the tree to Console Root -> Component Services -> Computers -> My Computer
4. Right-click on "My Computer" and select properties



5. Select the "Default Properties" tab set below :
  a. Enable Distributed COM on this computer - option is checked
  b. Default Authentication Level - Set to Connect
  c. Default Impersonation Level - Set to Identify




6. Select the "COM Security" tab
7. Click on Access Permissions ' Edit Default
     a. Add : "Anonymous", "Everyone", "Interactive", "Network", "System" with Local and Remote access permissions set.

8. Click on Launch and Activation Permissions ' Edit Default
    a. Add "Anonymous", "Everyone", "Interactive", "Network", "System" with Local and Remote access permissions set.
9. Click on OK
10. Close the DCOMCNFG window