hkhan
hkhan

Reputation: 863

auto generate a number in a field in dynamics crm 2011

I have a field in my form of a custom entity that I would like to be populated with an auto-generated number on form load. The number should start from 1000 for the first ever form record and for every new record it should increment like 1001, 1002 and so on.

I am not good with programming so I need help.

Regards

Upvotes: 1

Views: 3295

Answers (2)

Akram Fares
Akram Fares

Reputation: 1683

If you want to do it by code :

var i = 0;
var n = 0;
$("body input:text").each(function(){
  if(i==0) n = 1000;
  else n++;
  $(this).val(n);
  i++;
});

Demo : http://jsfiddle.net/ufJ56/2/

Upvotes: 1

Guido Preite
Guido Preite

Reputation: 15128

You can install one of the autonumbering solutions available on codeplex:

http://advcrm2011autonumber.codeplex.com/

http://crm2011autonumber.codeplex.com/

Personally I suggest the first one.

both are free

Upvotes: 1

Related Questions