首页 > 解决方案 > Processing \Animation in NetSuite

问题描述

I have this client script which copies the line number entered in Copy line# and creates new lines from number of lines entered in Copy #Times. This thing takes time when you increase the number of lines you require to copy. So can we give any processing animation till all the lines are set so user dont have to worry?copy line

I have tried giving dialog.create but it didnt work. I want the animation to stay until script is executing and after that stop.

var options = {
                    title: 'Alert',
                    message: 'Processing. Please wait.',
                     buttons: [{
                     label: 'OKK...',
                     value: 1
                     },
                     ]
                    };
                    dialog.create(options).then(success)
                    return (true);

success is a function I am calling.

标签: netsuitesuitescript2.0

解决方案


N/ui/dialog模块旨在显示可关闭的消息,并且不适用于进度条,因为您无法隐藏按钮,也无法通过代码关闭它。我建议查看第三方库。一个非常流行的是SweetAlert2,在 NetSuite Professionals 网站上有一些示例代码用于将它与 NetSuite 一起使用。

如果你只是想快速破解,你可以使用NetSuite 默认包含在所有页面上的Ext.js 库。但是,我强烈建议不要对任何生产代码这样做,因为 NetSuite 可以在以后的升级中随时更新或删除它。

var messageBox = Ext.MessageBox.show({
  title: 'Lines are being copied...',
  msg: 'This may take a couple minutes',
  wait: true,
  width: 250
});

// your work here

messageBox.hide()

推荐阅读