0

I have a following problem: I have a tableA (standard FO table) that has a fieldA (string) with the Allow Edit property set to to No. Now the user would like to have several fieldA values changed with an added suffix, for example: FOO -> FOO_bar.

Can I do some sort of an CSV import that has old and new values or what would be the best way for start solving this?

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
mrsalonen
  • 343
  • 2
  • 15

1 Answers1

1

You can by code update the field irrespective of the fields AllowEdit property. This only affects its use in forms.

You can import a file as described here.

public  void UploadFileData()
{    
    var fileUpload = File::GetFileFromUser() as FileUploadTemporaryStorageResult;
    var file = AsciiStreamIo::constructForRead(fileUpload.openResult());
    if (!file || file.status())
    {
        throw error("@SYS52680");
    }
    file.inFieldDelimiter(',');
    file.inRecordDelimiter('\r\n');
    for (var record = file.read(); !file.status(); record = file.read()) 
    {
        record = file.read();
        if (record)
        {
            info(strFmt("%1 - %2",conPeek(record,1),conPeek(record,2)));
        }
    }
}
Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50