Hi Experts,
I am Importing csv file with salesid using runbase class and it should have dialog as well and if clicking ok then only the run method should trigger. Please find the below example of my code.
class MyRunBase extends RunBase
{
FileUploadTemporaryStorageResult fileUpload;public static void main(Args _args) { MyRunBase myrunbase = new MyRunBase(); myrunbase.prompt(); myrunbase.run(); } public boolean prompt() { this.fileUpload = File::GetFileFromUser() as FileUploadTemporaryStorageResult; return true; } public boolean getFromDialog() { return true; } public void run() { AsciiStreamIo file; Array fileLines; Counter counter = 0; str caseID; boolean header = true; try { file = AsciiStreamIo::constructForRead(this.fileUpload.openResult()); if (file) { file.inFieldDelimiter(','); file.inRecordDelimiter('\r\n'); } container rec; ttsBegin; while (!file.status()) { counter++; rec = file.read(); if (conLen(rec)) { if (header) { header = false; continue; } SalesId = conpeek(rec, 1); SalesTable salesTable; select forUpdate salesTable where salesTable.salesId == salesId; if (salesTable) { salesTable.SalesStatus = NoYes::Yes; salesTable.update(); } } } ttsCommit; info("Import Done"); } catch (Exception::Deadlock) { retry; } }
}
This code is working fine but I would like to add a dialog here before calling the run method. How can i add this?
Thanks in advance,
Mark