Skip to main content
Participating Frequently
Jul 21, 2024 10:41 AM UTC
Question

Trouble with updating a specific row in my recordtype using a!update

I want to update a specific row in my recordtype with data in one of the columns as follows: 

Here I am using my id (the primary key of the table) to specify which row I wish to update, in this case i want to update case number 80 and update the casestatus column with "accepted", however upon doing so I get the following error: 

I am guessing that my syntax is incorrect, but I can't seem to figure out what I am doing wrong exactly.

4 replies

stefanhelzle0001
Brainy
Jul 21, 2024 11:47 AM UTC

Use the correct record type field reference syntax for the id field. Just like you do for the index parameter of a!update.

konduruc733182
Inspiring
Jul 21, 2024 6:05 PM UTC

In the update() the data parameter is configured incorrectly. You need to specify the variable in which your data is present. 

a!update(
  data: index(myVariable[fieldName],80,null),
  index: recordType.fieldName which you want to update,
  value: "accepted"
)

varuntejg243705
Inspiring
Jul 22, 2024 4:40 AM UTC

Hi [mention:5ca3724eac324319b36377f6e4fb404d:e9ed411860ed4f2ba0265705b8793d05] ,

you are trying to get the records by using id incorrectly,

Instead query the record type by using expression rule and put it in a local variable, then update the variable, if you don't use that record type rule input in that interface.


Follow the sample code :

a!localVariables(
  local!customer: rule!RMS_GetCustomerByCustomerId(customerId: 3),
  a!update(
    data: local!customer,
    index: RMS Customer.billAmount,
    value: 555
  )
  
)

davidj137213
Brainy
Jul 22, 2024 6:37 AM UTC

You are referencing the record index in a wrong way. Use one of the following sentences.

index(local!allUsers, recordType!yourRecordName.fields.yourField, {})
 local!allUsers[recordType!yourRecordName.fields.yourField]