Skip to main content
Solved

Updating a Barcode field with a string in a script

  • June 7, 2020
  • 2 replies
  • 12 views

Forum|alt.badge.img

Hi all, I have tried for over 2 hours to get this to work, but can’t seem to.

I am trying to update a barcode primary key field. but the closest I got was this error message:

Type ‘string’ is not assignable to type ‘{ text: string; type?: string; }’.(2322)

Best answer by Hamish_Ahern

oh I figured it out, you have to put it inside an extra object with { } and use the text: property. so that you can update barcode fields.

    await table.updateRecordAsync(record, {
        'Barcode field Name': { text: prefix + nextnumber, },
    });

2 replies

Forum|alt.badge.img
  • Author
  • New Participant
  • 3 replies
  • Answer
  • June 7, 2020

oh I figured it out, you have to put it inside an extra object with { } and use the text: property. so that you can update barcode fields.

    await table.updateRecordAsync(record, {
        'Barcode field Name': { text: prefix + nextnumber, },
    });

Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • 4647 replies
  • June 17, 2020

Glad to know that you were able to find a solution! If you would, please mark your latest comment as the solution to your question. This helps others who may be searching with similar questions. Thanks!