![]() |
VOOZH | about |
The CData Cmdlets for Blackbaud FE NXT 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 Blackbaud FE NXT.
The Cmdlets are not only a PowerShell interface to Blackbaud FE NXT, but also an SQL interface; this tutorial shows how to use both to create, retrieve, update, and delete Blackbaud FE NXT data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Blackbaud FE NXT. To access Blackbaud FE NXT data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Blackbaud FE NXT.
Once you have acquired the necessary connection properties, accessing Blackbaud FE NXT data in PowerShell can be enabled in three steps.
Blackbaud Financial Edge NXT uses the OAuth authentication standard. To authenticate using OAuth, create an app to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties.
See the Getting Started guide in the CData driver documentation for more information.
Install the module:
Install-Module FinancialEdgeNXTCmdlets
Connect:
$financialedgenxt = Connect-FinancialEdgeNXT -SubscriptionKey "$SubscriptionKey" -InitiateOAuth "$InitiateOAuth"
Search for and retrieve data:
$modifiedby = "System" $accounts = Select-FinancialEdgeNXT -Connection $financialedgenxt -Table "Accounts" -Where "ModifiedBy = `'$ModifiedBy`'" $accounts
You can also use the Invoke-FinancialEdgeNXT cmdlet to execute SQL commands:
$accounts = Invoke-FinancialEdgeNXT -Connection $financialedgenxt -Query 'SELECT * FROM Accounts WHERE ModifiedBy = @ModifiedBy' -Params @{'@ModifiedBy'='System'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Blackbaud FE NXT\lib\System.Data.CData.FinancialEdgeNXT.dll")
Connect to Blackbaud FE NXT:
$conn= New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTConnection("SubscriptionKey=MySubscriptionKey;InitiateOAuth=GETANDREFRESH;")
$conn.Open()
Instantiate the FinancialEdgeNXTDataAdapter, execute an SQL query, and output the results:
$sql="SELECT AccountId, AccountNumber from Accounts"
$da= New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.accountid $_.accountnumber
}
Update-FinancialEdgeNXT -Connection $FinancialEdgeNXT -Columns @('AccountId','AccountNumber') -Values @('MyAccountId', 'MyAccountNumber') -Table Accounts -Id "MyId"
$cmd = New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTCommand("UPDATE Accounts SET ModifiedBy='System' WHERE Id = @myId", $conn)
$cmd.Parameters.Add((New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTParameter("@myId","10456255-0015501366")))
$cmd.ExecuteNonQuery()
Add-FinancialEdgeNXT -Connection $FinancialEdgeNXT -Table Accounts -Columns @("AccountId", "AccountNumber") -Values @("MyAccountId", "MyAccountNumber")
$cmd = New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTCommand("INSERT INTO Accounts (ModifiedBy) VALUES (@myModifiedBy)", $conn)
$cmd.Parameters.Add((New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTParameter("@myModifiedBy","System")))
$cmd.ExecuteNonQuery()
Remove-FinancialEdgeNXT -Connection $FinancialEdgeNXT -Table "Accounts" -Id "MyId"
$cmd = New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTCommand("DELETE FROM Accounts WHERE Id=@myId", $conn)
$cmd.Parameters.Add((New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTParameter("@myId","001d000000YBRseAAH")))
$cmd.ExecuteNonQuery()
CodeProject
Download a free trial of the Blackbaud FE NXT Data Provider to get started:
Download NowLearn more:
👁 Blackbaud Financial Edge NXT IconRapidly create and deploy powerful .NET applications that integrate with Blackbaud Financial Edge NXT account data including Accounts, Budgets, Projects, and more!