跳至主要内容
Adaptive Planning
上次更新时间 :2023-06-23
testConnection

testConnection

JavaScript 开发者必须根据您的用例修改此 CCDS 起始脚本。如果不进行修改,它将无法运行。
在 SAGE Intacct CCDS 中将以下代码块另存为脚本,并将其命名为 testConnection。
function testConnection(context) { //Get values from designer settings, and set other variables needed for Intacct API calls var dataSource = context.getDataSource(); var userID = dataSource.getSetting('Intacct UserID').getValue(); var userPassword = dataSource.getSetting('Intacct Password').getValue(); var companyId = dataSource.getSetting('Company ID').getValue(); var senderId = dataSource.getSetting('Sender ID').getValue(); var senderPassword = dataSource.getSetting('Sender Password').getValue(); var intacctURL = dataSource.getSetting('Intacct URL').getValue(); var authenticationRequest = '<request><control><senderid>' + senderId + '</senderid><password>' + senderPassword + '</password>' + '<controlid>AdaptiveTestConnection</controlid><dtdversion>3.0</dtdversion></control>' + '<operation><authentication><login><userid>' + userID + '</userid><companyid>' + companyId + '</companyid>' + '<password>' + userPassword + '</password></login></authentication></operation></request>'; var result = sendAndGetXML_Intacct(intacctURL,authenticationRequest); return result !== false; //result is an object or false, need to return a boolean value }