To display a ribbon button using work bench in MS Dynamics CRM only when an existing record is loaded and not on new one.
In this example I will be creating a button and calling a html web resource by clicking a button.
First thing we need to do is load our unmanaged solution where we have a required entity. Once loaded select Ribbon tab and then from the drop down menu at the top right corner select Form
![](https://365rack.com/wp-content/uploads/2015/07/img_55b75c56c48e8.png)
then drag and drop a button to empty column
![](https://365rack.com/wp-content/uploads/2015/07/img_55b75cb24dec5.png)
Next we need to add a new command
![](https://365rack.com/wp-content/uploads/2015/07/img_55b75cfb7bd12.png)
Next on the right side click on look up Action field and Add a new action of type ‘Open URL Action’
In address field type something like $webresource: your_web_resource_name
In parameter type if you want to pass current record id select values as below
![](https://365rack.com/wp-content/uploads/2015/07/img_55b75daa7cdbb.png)
Once all values are entered it should look like below
![](https://365rack.com/wp-content/uploads/2015/07/img_55b75e0ea8d01.png)
Next we need to create display rules
![](https://365rack.com/wp-content/uploads/2015/07/img_55b75e3d3cf69.png)
Click on Add rules and select Form State Rule
Set values as below
![](https://365rack.com/wp-content/uploads/2015/07/img_55b75e8bc16a1.png)
Now publish your changes. Above display rules will make sure button only appears for existing records and by clicking button will open a HTML web resource.