Difference between Sandbox and developer edition in Salesforce

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags with 12 Comments on Difference between Sandbox and developer edition in Salesforce

Explains the basic difference in Sandbox and developer edition of Salesforce

A test environment for salesforce.com is crucial to change control. Salesforce.com provides the tools needed to test anything in a test environment before you implement it in your live instance. You can either test in a Sandbox environment or in a Developer environment. What is the difference? I will share what I know…

Sandbox

The salesforce.com Sandbox environment is an exact copy of your salesforce.com instance. You can copy your live instance to a sandbox environment (but you have to perform manually from sandbox to developer edition) where you can test any changes, implementations, AppExchange apps or updates. It can also be your hands-on training environment without risking your live data.

You can either copy your configuration and data into a sandbox environment or just the configuration. It acts exactly like your live instance, but be careful if you have workflow rules or automations because they will work in the sandbox as well.

I know that this sounds wonderful and if you don’t have it, you are dying to know how to get it. The problem is the cost. If you are on Unlimited Edition, then cost is not a problem because it comes included. But for Enterprise, Professional or Group Editions, you have to pay… and the price is hefty; anywhere between 25k-50k per year. For a lot of companies, that is more than they are paying for their live salesforce.com instance. So how do you test salesforce.com without Sandbox?  It is always suggested to develop application in sandbox instance then go for LIVE.

Developer Edition

Developer Edition was an edition created for development of integrations and apps, specifically for the AppExchange. It is also a great tool for testing/training in salesforce.com. What makes this a great tool is the fact that it is free. Anyone can get a Developer Edition of salesforce.com. It is a standard Enterprise Edition with very limited storage space. You cannot copy your configuration or data onto the Developer Edition, but you can customize it to match your instance’s look and feel. Once it is customized, you can use it for training, testing or anything else you want. It takes a little bit of work, but you can make it act and feel just like your live instance. The work is well worth it for the free price.

To get a copy of Developer Edition for yourself or your company go here. Play around with it. Get apps from the AppExchange. Do anything and everything that you have been scared to do your live system. If you come up with a clever way of using the system, post it on AppExchange and share your knowledge.

Create Cron job to run PHP Script in Cpanel

Author posted by Jitendra on Posted on under category Categories Linux and tagged as Tags , , with 1 Comment on Create Cron job to run PHP Script in Cpanel

Hi All,

Today i just want to share that how to create  a cron job in Cpanel to run the PHP script.

I hope everyone knows that what is Cron job : it is the task schedule in Linux which will run on predefined time interval. its same concept like schedule tasks in Windows OS.

To create the cron job, open the Cpanel and select “cron jobs”.

Select Cron job in Cpanel

You can see that in drop down list there are lots of common schedules of crone job, you can select it, or create your own schedules.

Common settings in Cpanel

In Command text box, write the PHP program path and file to be executed like:

/usr/local/bin/php -q /home/<username>/script.php


to find the path to php,
log on to the server with SSH, then run this command:
“”””””””””””-
which php
or
whereis php
“”””””””””””””-
This will give you the path to the php executable, probably:
/usr/local/bin/php

Dos command to close and open port

Author posted by Jitendra on Posted on under category Categories Tech Tips and tagged as Tags , with 3 Comments on Dos command to close and open port

Dos command to close and open port in Windows XP, Windows 7 and Windows Server

1)Type  netstat -a -o -n in command prompt.

Netstat command in DOS
Netstat command in DOS

2) find the PID number for that port number (as shown in above image).
3) goto task manager and end process the corresponding PID number.

Close Open Port from Task manager in Windows xp
Close Open Port from Task manager in Windows xp

If  PID is not visible in task manager then goto View->Select Column and select PID column.

How to Install java on Ubuntu 10 and Ubuntu 11

Author posted by Jitendra on Posted on under category Categories JAVA, Linux and tagged as Tags , , with Leave a comment on How to Install java on Ubuntu 10 and Ubuntu 11
Run below command on the terminal of ubuntu to install the JAVA.
Ubuntu 10 :
	$ sudo add-apt-repository "deb http://archive.canonical.com/lucid partner"
	$ sudo apt-get update
	$ sudo apt-get install sun-java6-jdk
	$ sudo apt-get install sun-java6-jre

Ubuntu 11:

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-jre
sudo update-alternatives --config java

Get Mouse Position in JavaScript for all browsers

Author posted by Jitendra on Posted on under category Categories Tech Tips and tagged as Tags with Leave a comment on Get Mouse Position in JavaScript for all browsers

 

Get Mouse Movement in Javascript
Get Mouse Movement in Javascript
function mouseXPos(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX)
return evt.clientX + (document.documentElement.scrollLeft ?
document.documentElement.scrollLeft :
document.body.scrollLeft);
else return null;
}

function mouseYPos(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
return evt.clientY + (document.documentElement.scrollTop ?
document.documentElement.scrollTop :
document.body.scrollTop);
else return null;
}

To use above function, just pass the mouse event.

Live Demo

Why Style.left does not work in Firefox, chrome and safari ?

Author posted by Jitendra on Posted on under category Categories HTML and tagged as Tags , with 3 Comments on Why Style.left does not work in Firefox, chrome and safari ?

During working on one of my project, i found that style.left does not work with Mozilla, chrome and safari but nicely works on internet explorer.

The code was :

var docStyle = document.getElementById("divAddPartnerAndProjectEntities").style;
docStyle.top = e.clientY;
docStyle.left = e.clientX-5;
docStyle .style.display = "";
And the simple solution is, append “px” at the end to work with other browsers.
and final code is:
var docStyle = document.getElementById("divAddPartnerAndProjectEntities").style;
docStyle.top = e.clientY+"px";
docStyle.left = e.clientX-5+"px";
docStyle .style.display = "";

Very Simple right ? 🙂

DataGrid Sorting and Paging Example – Part 2

Author posted by Jitendra on Posted on under category Categories ASP.NET and tagged as Tags , with Leave a comment on DataGrid Sorting and Paging Example – Part 2

For Part 1, visit This URL https://jitendrazaa.com/blog/?p=191

In this part, i will show that how to Sort the Datagrid Component of ASP.NET.

To sort Datagrid, we will need DataView and then assign Dataview as datasource to our Grid control.

We will need to change our code of Part 1.

Previously, we used DataSet as a Datasource. This time we will use DataTable and get the DataView from DataTable using below line.

DataView dv = dt.DefaultView; //Where dt id DataTable

So we have created a function, which will return the DataTable as shown below:

private DataTable GetTableFromDataBase()
{
SqlConnection con = null;
SqlDataAdapter adp = null;
DataTable dt = new DataTable();
try
{
con = new SqlConnection(conString);
con.Open();
adp = new SqlDataAdapter("Select * from Employee",con);
adp.Fill(dt);
return dt;
}
catch (CustomException ex)
{
ex.logException();
}finally{
con.Close();
}
return null;
}

we will need to create the function on Sortcommand of the DataGrid.

The format for sorting the grid is like:

SortExpression+”asc”

OR

SortExpression+”desc”

Below is the code snap used for the sorting:

protected void grdEmp_Sort(object source, DataGridSortCommandEventArgs e)
{
DataTable dt = GetTableFromDataBase();
DataView dv = dt.DefaultView;
string dir = string.Empty;
if (e.SortExpression.Length > 0)
{
if (Session["OldSortDir"] == null)
{
Session["OldSortDir"] = e.SortExpression;
}
else
{
string oldSortExp = Session["OldSortDir"].ToString();
if (oldSortExp == "asc")
{
dir = "desc";
Session["OldSortDir"] = "desc";
}
else
{
dir = "asc";
Session["OldSortDir"] = "asc";
}
}
dv.Sort = e.SortExpression+"  "+dir;
}
grdEmp.DataSource = dv;
grdEmp.DataBind();
}

The code for the Pagination is written below. Consider Page Size as 3.

protected void grdEmp_Paging(object source,DataGridPageChangedEventArgs p)
{
grdEmp.CurrentPageIndex = p.NewPageIndex;
BindTable();
}

Download Source code

DataGrid Example – Part 1

Author posted by Jitendra on Posted on under category Categories ASP.NET and tagged as Tags , with 1 Comment on DataGrid Example – Part 1

For the basics of DataGrid please refer this post: https://jitendrazaa.com/blog/?p=188

In this example, i will explain the basics of DataGrid control like Theming, Databinding etc.

We will start our example with creating the SQL Express database of Employee which will contain the following fields : Id, FName, LName, Email.

Now create a stored procedure to insert the data into Table.

CREATE PROCEDURE dbo.AddEmployee
@FName varchar(50),
@LName varchar(50),
@Email varchar(50)
AS
INSERT INTO Employee (FName,LName,Email) values (@FName,@LName,@Email)

In ASPX page, write the code to input the Employee information.

First Name : <asp:TextBox ID="txtFName" runat="server"/><br />
Last Name :<asp:TextBox ID="txtLName" runat="server"/><br />
Email :<asp:TextBox ID="txtEmail"; runat="server"/><br />
<asp:Button ID="btnSubmit" Text="Add Record" runat="server" OnClick="btnSubmit_Click"/>

Go to the property of Employee.mdf and select connection string as shown in below image.

On the click event of the button write below function:

string conString = @"Data Source=.SQLEXPRESS;AttachDbFilename=""|DataDirectory|Employee.mdf"";Integrated Security=True;User Instance=True";
protected void btnSubmit_Click(object sender, EventArgs e)
{
SqlConnection con = null;
SqlCommand cmd = null;
try {
con = new SqlConnection(conString);
     con.Open();
     cmd = new SqlCommand("AddEmployee", con);
     cmd.CommandType = CommandType.StoredProcedure;
     cmd.Parameters.AddWithValue("@FName", txtFName.Text);
     cmd.Parameters.AddWithValue("@LName", txtLName.Text);
     cmd.Parameters.AddWithValue("@Email", txtEmail.Text);
     cmd.ExecuteNonQuery();
     showConfirmationMessage();
}
catch (CustomException ex) {
ex.logException();
}finally{
    con.Close();
}
}
 private void showConfirmationMessage()
{
      ClientScriptManager csMngr = Page.ClientScript;
      csMngr.RegisterStartupScript(Page.GetType(), "Success", "alert('Record Added succesfully');", true);
}

ASPX Code for data grid

<asp:DataGrid ID="grdEmp" runat="server">
<HeaderStyle CssClass="Header" />
<AlternatingItemStyle CssClass="AlternateItemStyle" />
</asp:DataGrid>

Write below code to bind the data into DataGrid.

private void bindData()
{
SqlConnection con = null;
SqlDataAdapter adp = null;
try
{
con = new SqlConnection(conString);
con.Open();
adp = new SqlDataAdapter("Select * from Employee",con);
DataSet ds = new DataSet();
adp.Fill(ds);
grdEmp.DataSource = ds;
grdEmp.DataBind();
}
catch (CustomException ex)
{
ex.logException();
}finally{
con.Close();
}
}

Final output:

Download Code

ASP.NET DataGrid basic questions

Author posted by Jitendra on Posted on under category Categories ASP.NET and tagged as Tags , with 2 Comments on ASP.NET DataGrid basic questions
  1. What is datagrid? The DataGrid Web server control is a powerful tool for displaying information from a data source. It is easy to use; you can display editable data in a professional-looking grid by setting only a few properties. At the same time, the grid has a sophisticated object model that provides you with great flexibility in how you display the data.
  2. What’s the difference between the System.Web.UI.WebControls.DataGrid and System.Windows.Forms.DataGrid? The Web UI control does not inherently support master-detail data structures. As with other Web server controls, it does not support two-way data binding. If you want to update data, you must write code to do this yourself. You can only edit one row at a time. It does not inherently support sorting, although it raises events you can handle in order to sort the grid contents. You can bind the Web Forms DataGrid to any object that supports the IEnumerable interface. The Web Forms DataGrid control supports paging. It is easy to customize the appearance and layout of the Web Forms DataGrid control as compared to the Windows Forms one.
  3. How do you customize the column content inside the datagrid? If you want to customize the content of a column, make the column a template column. Template columns work like item templates in the DataList or Repeater control, except that you are defining the layout of a column rather than a row.
  4. How do you apply specific formatting to the data inside the cells? You cannot specify formatting for columns generated when the grid’s AutoGenerateColumns property is set to true, only for bound or template columns. To format, set the column’s DataFormatString property to a string-formatting expression suitable for the data type of the data you are formatting.
  5. How do you display an editable drop-down list? Displaying a drop-down list requires a template column in the grid. Typically, the ItemTemplate contains a control such as a data-bound Label control to show the current value of a field in the record. You then add a drop-down list to the EditItemTemplate. In Visual Studio, you can add a template column in the Property builder for the grid, and then use standard template editing to remove the default TextBox control from the EditItemTemplate and drag a DropDownList control into it instead. Alternatively, you can add the template column in HTML view. After you have created the template column with the drop-down list in it, there are two tasks. The first is to populate the list. The second is to preselect the appropriate item in the list “” for example, if a book’s genre is set to “fiction,” when the drop-down list displays, you often want “fiction” to be preselected.
  6. How do you check whether the row data has been changed? The definitive way to determine whether a row has been dirtied is to handle the changed event for the controls in a row. For example, if your grid row contains a TextBox control, you can respond to the control’s TextChanged event. Similarly, for check boxes, you can respond to a CheckedChanged event. In the handler for these events, you maintain a list of the rows to be updated. Generally, the best strategy is to track the primary keys of the affected rows. For example, you can maintain an ArrayList object that contains the primary keys of the rows to update.

You can find more questions on Datagrid at http://msdn.microsoft.com/en-us/library/Aa289519

Problems with parallel RFC servers in SAP

Author posted by Jitendra on Posted on under category Categories SAP and tagged as Tags , with 2 Comments on Problems with parallel RFC servers in SAP

 

Generally, the transaction RZ12  is used to create and edit RFC server groups for parallel execution of RFC enabled ABAP procedures and functions.  Using these parallel RFCs, we can reduce the overall execution time of long running jobs. 

Below are rare facts about the configuration of RFC servers in RZ12:

1. While configuring the resources which will be assigned to RFC servser groups; we will find that the “Determination of Resources” section allows to enter the preferences for the amount of system resources that will be allocated to the group.  Here, the problem is, the data entered  for these parameters is not RFC server group specific. Its actually application group wide, just like all the other profile parameters.  So, if we edit  RFC server group assignment row  and change its any field value, we change its corresponding application servers profile parameter and this change affects all RFCs running in the application server. This can be verified by opening any other RFC  server group.

 

2.  As we know the profile parameter  “rdisp/rfc_check”  enables the dispatcher check for asynchronous RFCs (checks whether the sufficient Dialogue work processes are available for processing the asynchronous RFC calls) and its default value is 2 but if we change it to 3 then the both Synchronous and Asychronous RFCs can be monitored. I would suggest to take a view of available Dialogue work processes and the documentation changing this value.

3.  If the parallel RFCs are being used to generate the periodic replacement list using transaction code EG88 then it calls the function EGTUR. In such a case, define the RFC group with name EGTUR and activate the same.