--SO 20014815

CREATE OR REPLACE PROCEDURE insertForAccessRight is
begin
insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'rbTax',
     sysdate);

insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'txtCertificateUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'btnGoUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'btnOpenUS', sysdate);
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'txtTaxExemptCodeUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'cmbCountyUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'cbCountyUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'cmbCityUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'cbCityUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblCertifRecDateUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'dfCertifRecDateUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblStateUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'cmbStatesUS', sysdate);
    
      insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    ((select fieldsperdialog_id from fieldsperdialog where field='txtCocNumber'), 'txtPnNumber', sysdate);
     
end insertForAccessRight;
/

execute insertForAccessRight;

drop procedure insertForAccessRight;