0

I am using Sugar Enterprise 6.4.0 and want to display a uneditable field in a custom module Edit and Detail view. This id need to be generated automatcially and need to be displayed in the interface when user click to create a new record in the custom module.

Because i am new to Sugar can anyone help me out in performing this task. Any ideas?

Sheikh Rahat Ali
  • 1,293
  • 8
  • 37
  • 61

2 Answers2

1

You can set the readonly property on the field itself in the vardefs for the module...

$dictionary['<<module>>']['fields']['<<fieldname>>']['readonly'] = true;

Then, add some logic in the custom/modules/<>/views/view.edit.php which does the autogeneration for you.

jmertic
  • 2,208
  • 1
  • 13
  • 8
1

I just did this, using an after_save_hook with code like(not exact):

$bean->name = $bean->id;

as soon as you save a record in sugar an id is generated automatically. Then I don't include the ID in the editview at all, just the detail and list views. I don't see any point in including it in the edit view as it is not editable.

Daniel Jonker
  • 844
  • 10
  • 21