Skip to main content
Known Participant
December 10, 2024
Question

Can't update a record, then my syntax is redundant

  • December 10, 2024
  • 4 replies
  • 7 views

= a!forEach(
  pv!documentos,
  'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta'(
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{9edd3c74-2a43-4d35-a34a-f15156e24008}nome': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{9edd3c74-2a43-4d35-a34a-f15156e24008}nome'],
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{c5c850df-96fc-4f05-acac-ce2ec64be9fe}descricao': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{c5c850df-96fc-4f05-acac-ce2ec64be9fe}descricao'],
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{a0bd41fc-ae6a-4d8d-a639-811ceb6223dc}uri_bucket': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{a0bd41fc-ae6a-4d8d-a639-811ceb6223dc}uri_bucket'],
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{d47966a5-2a85-4921-9950-56bda2595d30}criadoPor': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{d47966a5-2a85-4921-9950-56bda2595d30}criadoPor'],
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{d73e4b62-7b68-429a-b48a-2e861a9a79a5}dataCriacao': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{d73e4b62-7b68-429a-b48a-2e861a9a79a5}dataCriacao'],
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{061962e7-7b4c-40ac-a241-8859811ac37c}modificadoPor': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{061962e7-7b4c-40ac-a241-8859811ac37c}modificadoPor'],
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{6403b911-5ec8-4442-8ee1-6989437932e3}dataAlteracao': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{6403b911-5ec8-4442-8ee1-6989437932e3}dataAlteracao'],
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.relationships.{b1179d0c-8b69-4c12-8191-feecf9a5edfe}criadoPorUser': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.relationships.{b1179d0c-8b69-4c12-8191-feecf9a5edfe}criadoPorUser'],
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.relationships.{565d913a-c85d-4b61-88b0-889e404348d6}modificadoPorUser': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.relationships.{565d913a-c85d-4b61-88b0-889e404348d6}modificadoPorUser'],
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{389973d7-a3f2-4ce3-aafb-9c2021e72ce9}propostaId': pv!idProposta,
    'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.relationships.{7e39ce72-e568-45ea-b1da-d6b570e1aec9}gcTipoDocumento.fields.{9bc7b5d8-be3a-474a-8b87-40e8118629e7}id': fv!item['recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.relationships.{7e39ce72-e568-45ea-b1da-d6b570e1aec9}gcTipoDocumento.fields.{9bc7b5d8-be3a-474a-8b87-40e8118629e7}id']
  )
)

a!update is not working properly for me, I am recieving this:

The input "Records" cannot insert or update a record which is referring to different referenced records via propostaId at the same time. To create a reference to a related record, include either a relationship reference or the required common field value for "propostaId". Location of conflicting changes: GC Proposta[1].documentoProposta[1]

4 replies

mathieud0001
Brainy
December 11, 2024
sandhyab4212
Known Participant
December 11, 2024

Hi [mention:66e7f986653d4e6ba7ac15249a9a5776:e9ed411860ed4f2ba0265705b8793d05] 

Why didn't you use a!update() function to update any reasons?

prasantap0900
Participating Frequently
December 11, 2024

Where are you using a!update? Can you please clarify?

stefanhelzle0001
Brainy
December 11, 2024

This is not a problem with how you update or modify your data, but with what you are actually trying to write to the DB.