![]() |
VOOZH | about |
The CData Cmdlets for Sage Intacct are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time and bidirectional access to Sage Intacct.
CData provides the easiest way to access and integrate live data from Sage Intact. Customers use CData connectivity to:
Users frequently integrate Sage Intact with analytics tools such as Tableau, Power BI, and Excel, and leverage our tools to replicate Workday data to databases or data warehouses.
To learn about how other customers are using CData's Sage Intacct solutions, check out our blog: Drivers in Focus: Accounting Connectivity.
The Cmdlets are not only a PowerShell interface to Sage Intacct, but also an SQL interface; this tutorial shows how to use both to create, retrieve, update, and delete Sage Intacct data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Sage Intacct. To access Sage Intacct data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Sage Intacct.
Once you have acquired the necessary connection properties, accessing Sage Intacct data in PowerShell can be enabled in three steps.
To connect using the Login method, the following connection properties are required: User, Password, CompanyId, SenderId and SenderPassword.
User, Password, and CompanyId are the credentials for the account you wish to connect to.
SenderId and SenderPassword are the Web Services credentials assigned to you by Sage Intacct.
Install the module:
Install-Module SageIntacctCmdlets
Connect:
$sageintacct = Connect-SageIntacct -User "$User" -CompanyId "$CompanyId" -Password "$Password" -SenderId "$SenderId" -SenderPassword "$SenderPassword"
Search for and retrieve data:
$customerid = "12345" $customer = Select-SageIntacct -Connection $sageintacct -Table "Customer" -Where "CustomerId = `'$CustomerId`'" $customer
You can also use the Invoke-SageIntacct cmdlet to execute SQL commands:
$customer = Invoke-SageIntacct -Connection $sageintacct -Query 'SELECT * FROM Customer WHERE CustomerId = @CustomerId' -Params @{'@CustomerId'='12345'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Sage Intacct\lib\System.Data.CData.SageIntacct.dll")
Connect to Sage Intacct:
$conn= New-Object System.Data.CData.SageIntacct.SageIntacctConnection("User=myusername;CompanyId=TestCompany;Password=mypassword;SenderId=Test;SenderPassword=abcde123;")
$conn.Open()
Instantiate the SageIntacctDataAdapter, execute an SQL query, and output the results:
$sql="SELECT Name, TotalDue from Customer"
$da= New-Object System.Data.CData.SageIntacct.SageIntacctDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.name $_.totaldue
}
Update-SageIntacct -Connection $SageIntacct -Columns @('Name','TotalDue') -Values @('MyName', 'MyTotalDue') -Table Customer -Id "MyId"
$cmd = New-Object System.Data.CData.SageIntacct.SageIntacctCommand("UPDATE Customer SET CustomerId='12345' WHERE Id = @myId", $conn)
$cmd.Parameters.Add((New-Object System.Data.CData.SageIntacct.SageIntacctParameter("@myId","10456255-0015501366")))
$cmd.ExecuteNonQuery()
Add-SageIntacct -Connection $SageIntacct -Table Customer -Columns @("Name", "TotalDue") -Values @("MyName", "MyTotalDue")
$cmd = New-Object System.Data.CData.SageIntacct.SageIntacctCommand("INSERT INTO Customer (CustomerId) VALUES (@myCustomerId)", $conn)
$cmd.Parameters.Add((New-Object System.Data.CData.SageIntacct.SageIntacctParameter("@myCustomerId","12345")))
$cmd.ExecuteNonQuery()
Remove-SageIntacct -Connection $SageIntacct -Table "Customer" -Id "MyId"
$cmd = New-Object System.Data.CData.SageIntacct.SageIntacctCommand("DELETE FROM Customer WHERE Id=@myId", $conn)
$cmd.Parameters.Add((New-Object System.Data.CData.SageIntacct.SageIntacctParameter("@myId","001d000000YBRseAAH")))
$cmd.ExecuteNonQuery()
CodeProject
Download a free trial of the Sage Intacct Data Provider to get started:
Download NowLearn more:
👁 Sage Intacct IconComplete read-write access to Sage Intacct enables developers to search (Contacts, Invoices, Transactions, Vendors, etc.), update items, edit customers, and more, from any .NET application.