Hello,
I’m trying to write data to text fields via scripting, right now I have a dataset in a memory tag, and what I’m doing is that through text fields I’m able to write data to them and I added a “Save” button, that once I click it it creates a new row in the dataset and copies the information written in the Text Fields, so right now what I want to accomplish is that once I write the values to my dataset I want the text fields to become blank again.
This is the code I’m using:
| tagPath = [default]ElCajon/Buildings/1940/Machines/FADAL4A/ProgramName/CNC Programs/ProgramList | |
|---|---|
| original_dataset = system.tag.readBlocking([tagPath])[0].value | |
| ProgramNumber = self.getSibling(Program Number).props.text | |
| FileName = self.getSibling(File Name).props.text | |
| Product = self.getSibling(Product).props.text | |
| Description = self.getSibling(Description).props.text | |
| PartsExpected = self.getSibling(Parts Expected).props.text | |
| PartsExpected2 = self.getSibling(Parts Expected 2).props.text | |
| PartsExpected3 = self.getSibling(Parts Expected 3).props.text | |
| SetupTime = self.getSibling(Setup Time).props.text | |
| SetupSheet = self.getSibling(Setup Sheet).props.text | |
| new_dataset = system.dataset.addRow(original_dataset, [ProgramNumber, FileName, Product, Description, PartsExpected, PartsExpected2, PartsExpected3, SetupTime, SetupSheet,Eduardo Echegaray,1,system.date.now()]) | |
| system.tag.writeBlocking([tagPath],[new_dataset]) |
Is there a way I can “refresh” the Text Fields via scripting?