Skip to main content

Cannot update field name from scripting automation

  • May 17, 2023
  • 3 replies
  • 52 views

Forum|alt.badge.img+2

I'm trying to update a field name in a table using the script below, but getting this error: "Cannot update field name from scripting automation at main on line 22".  Has anyone else run into this problem?

 

 

let table = base.getTable("tblxxxxxx");
let field1 = table.getField("fldrxxxxx");

let today = new Date();
let quarter = Math.floor((today.getMonth() + 3) / 3); // Get the current quarter
let year = today.getFullYear();

// Calculate the prior quarter
let priorQuarter = quarter - 1;
let priorYear = year;
if (priorQuarter === 0) {
  priorQuarter = 4;
  priorYear--;
}

// Calculate the date for the prior quarter's last day
let priorQuarterLastDay = new Date(priorYear, priorQuarter * 3, 0);

let priorQuarterDate = priorQuarterLastDay.toLocaleDateString();
console.log(priorQuarterDate);

await field1.updateNameAsync(priorQuarterDate)

3 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • May 17, 2023

Automation scripts cannot create or update field names or configurations. 


Forum|alt.badge.img+5
  • Participating Frequently
  • August 22, 2023

Automation scripts cannot create or update field names or configurations. 


Shouldn't that be mentioned in the API documentation even within 'Automations'? 

Is there any future roadmap to allow this? I'd request as a future update as it would be nice to make the field options flexible depending on what is happening on other tables and clean out any clutter that would just confuse the data.


Forum|alt.badge.img+2
  • Participating Frequently
  • December 17, 2023

Automation scripts cannot create or update field names or configurations. 


Can that be done via the then?