How do we add custom properties to a Google Drive file (PDF) using Google AppScript?

addCustomProperty (fileId) function {
property var = {
key: & # 39; department & # 39 ;,
Value: & # 39; Sales & # 39 ;,
visibility: & # 39; PUBLIC & # 39;
};
Drive.Properties.insert (property, fileId);
}enter the description of the image here

google sheets – Add column checkbox format using AppScript

Trying to add the check box format to a column using AppScript to this working formula

sales.getRange("I2").setFormula("=IF(COUNTIF(B:B,B2)=COUNTIFS(B:B,B2,E:E,TRUE),TRUE)");      
    var fillDownRange = sales.getRange (2, 9, salesLR);
           sales.getRange("I2").copyTo(fillDownRange);

I tried to do it this way without success:

sales.getRange("I2").setFormula("=IF(COUNTIF(B:B,B2)=COUNTIFS(B:B,B2,E:E,TRUE),TRUE)");      
var fillDownRange = sales.getRange (2, 9, salesLR);
       sales.getRange("I2").copyTo(fillDownRange).newDataValidation().requireCheckbox().build();

I also tried this without success:

sales.getRange("I2").setFormula("=IF(COUNTIF(B:B,B2)=COUNTIFS(B:B,B2,E:E,TRUE),TRUE)");      
      var fillDownRange = sales.getRange (2, 9, salesLR);
      sales.getRange("I2").copyTo(fillDownRange).insertCheckboxes();

google apps script – How can I create a function in Appscript that allows me to control that a user modifies a cell once in spreadsheets?

I have the following query regarding Appscript:

How can you create a function in Appscript that allows you to control that a user only allows you to modify a cell once in a spreadsheet, but if authorization is granted, you can modify it again.

Thank you so much.