Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. import { LightningElement } from 'lwc';
  2. import { createRecord } from 'lightning/uiRecordApi';
  3.  
  4. import DET_USER from '@salesforce/schema/DCABM_obj_detalleConfiguracionABM__c.DCABM_fld_tipoUsuarioDetalle__c';
  5. import DET_ROL from '@salesforce/schema/DCABM_obj_detalleConfiguracionABM__c.DCABM_fld_rolDetalle__c';
  6. import DET_GROUP from '@salesforce/schema/DCABM_obj_detalleConfiguracionABM__c.DCABM_fld_grupoPublico__c';
  7. import DET_LICENSE from '@salesforce/schema/DCABM_obj_detalleConfiguracionABM__c.DCABM_fld_licencia__c';
  8. import DET_PROFILE from '@salesforce/schema/DCABM_obj_detalleConfiguracionABM__c.DCABM_fld_perfil__c';
  9.  
  10. import DET_OBJECT from '@salesforce/schema/DCABM_obj_detalleConfiguracionABM__c';
  11.  
  12. export default class DCABM_lwc_formularioSolicitudABM extends LightningElement {
  13.  
  14. let fields = {};
  15. let recordInput = {};
  16.  
  17. fields[DET_USER.fieldApiName] = 'value';
  18. fields[DET_ROL.fieldApiName] = 'value';
  19. fields[DET_GROUP.fieldApiName] = 'value';
  20. fields[DET_LICENSE.fieldApiName] = 'Salesforce';
  21. fields[DET_PROFILE.fieldApiName] = 'Standard User';
  22.  
  23. recordInput = { apiName: DET_OBJECT.objectApiName, fields };
  24.  
  25. createRecord(recordInput)
  26. .then(detConfig => {
  27. this.idDetalleControlador = detConfig.id;
  28. this.dispatchEvent(
  29. new ShowToastEvent({
  30. title: 'Success',
  31. message: 'Success',
  32. variant: 'success'
  33. }),
  34. );
  35. })
  36. .catch(error => {
  37. window.console.log("Error: " + error.body.message);
  38. this.dispatchEvent(
  39. new ShowToastEvent({
  40. title: 'Error',
  41. message: 'Error',
  42. variant: 'error'
  43. }),
  44. );
  45. });
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement