Populate field automatically

Hello,

I have a sharePoint list with a field called CheckListID (single text)

I need to set unique value onload for Example
EI-01
EI-02
EI-03

I try with this

Blockquote
fd.rendered(function(){
fd.field("CheckListID").value = 'EI';
fd.field('CheckListID').disabled = true;
});

But it does not work

Dear @eterrazas,
Please, try the following for SharePoint:

fd.spRendered(function(){
  fd.field('CheckListID').value = 'EI';
  fd.field('CheckListID').disabled = true;
});

Thanks for your help, it work.

What about the random number , any ideas?
Basically is to generate an Unique ID before save the form.

Dear @eterrazas,
While it's not possible to generate IDs in order, you can instead generate a GUID like this:

function uuidv4() {
  return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
    (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
  );
}

fd.spRendered(function(){
  fd.field('CheckListID').value = 'EI_' + uuidv4();
  fd.field('CheckListID').disabled = true;
});