Linx
Linx 6
Linx 6
  • Get Started
  • Installing
    • Install Linx Designer
    • Install Linx Server
  • Main Concepts
    • Introduction
    • Plugins
    • Functions
    • Types
    • Properties
    • Expressions
    • Control Flow
    • Scope
    • Services
    • Server
  • First Applications
    • Backend (REST)
    • Automation (Timer)
  • Reference
    • Designer
      • User Interface
      • Expression Editor
      • Debugging
    • Server
      • Quick Start
      • User Interface
    • Services
      • Available Services
    • Plugins
      • Linx
        • Content
          • AddToList
          • Boolean
          • Byte
          • ClearList
          • DateTime
          • Decimal
          • Double
          • DoWhile
          • ForEach
          • IfElse
          • Integer
          • List<Type>
          • Return
          • SetValue
          • StartService
          • StopService
          • String
          • ThrowException
          • TryCatch
      • Async
        • Content
          • RunTask
          • Task
          • Task<Type>
          • Wait
          • WaitAll
          • WaitAny
      • Compression
        • Content
          • Zip
          • Unzip
      • Cryptography
        • Content
          • Create ECDSA Keys
          • Create JWT
          • Decrypt
          • Encrypt
          • Generate ECDSA Signature
          • Generate HASH
          • Generate HMAC
          • Generate Random
          • Verify ECDSA Signature
          • Verify JWT
      • CSharp
        • Content
          • CSharpFunction
      • Database
        • Conventions
        • Content
          • BeginTransaction
          • DB Bulk Copy
          • ExecuteSQL
          • Execute Stored Procedure
          • MongoDB Read
          • MongoDB Write
        • Shared Properties
          • Connection Editor
          • SQL Editor
      • Email
        • Content
          • Read Email
          • Send Email
      • Excel
        • Excel Open
        • Excel Read
        • Excel Write
      • File
        • Content
          • Binary File Read
          • Binary File Write
          • Create Temp File
          • Directory Copy
          • Directory Delete
          • Directory Exists
          • Directory List
          • Directory Move
          • Directory Watch
          • File Copy
          • File Delete
          • File Exists
          • File List
          • File Move
          • File Open
          • Robocopy
          • Text File Read
          • Text File Write
      • FTP
        • Content
          • Directory Create
          • Directory Delete
          • Directory Exists
          • File Delete
          • File Exists
          • File Move
          • FTP Download
          • FTP List
          • FTP Upload
        • Shared Properties
          • Connection Editor
      • GoogleDrive
        • Content
          • About
            • GetAbout
          • Changes
            • GetStartPageToken
            • ListChanges
          • Comments
            • CreateComment
            • DeleteComment
            • GetComment
            • ListComments
            • UpdateComment
          • Files
            • CopyFile
            • CreateFile
            • DeleteFile
            • EmptyTrash
            • ExportFile
            • GenerateFieldIds
            • GetFile
            • ListFiles
            • UpdateFile
          • Permissions
            • Createpermission
            • Deletepermission
            • Getpermission
            • Listpermissions
            • Updatepermission
          • Replies
            • Createreply
            • Deletereply
            • Getreply
            • Listreplies
            • Updatereply
          • Revisions
            • Deleterevision
            • Getrevision
            • Listrevisions
            • Updaterevision
          • Types
            • Contenthintsdata
            • humbnaildata
      • GoogleSheets
        • Content
          • DeveloperMetaData
            • GetDeveloperMetaData
            • SearchDeveloperMetaData
          • Sheets
            • CopySheetsTo
          • SpreadSheets
            • BatchUpdateheet
            • GoogleSheets Create
            • GoogleSheets Get
            • GoogleSheets GetByDataFilter
          • Types
            • DataFilter
            • DataFilterValueRange
            • Request
            • Spreadsheet
            • ValueRange
          • Values
            • AppendValues
            • BatchClearValues
            • BatchClearValuesByDataFilter
            • BatchGetValues
            • BatchGetValuesByDataFilter
            • BatchUpdate
            • BatchUpdateByDataFilter
            • ClearValues
            • GetValues
            • UpdateValues
      • GraphQL
        • Content
          • GraphQLQuery
          • GraphQLServer
      • JobScheduler
        • Content
          • JobScheduler Service
      • JSON
        • Content
          • JSON Reader
          • JSON Writer
      • Kafka
        • Content
          • Kafka Service
      • PDF
        • License
        • Content
          • AddWatermark
          • ChangeProtection
          • Concatenate
          • Fill Form
          • Read
          • Sign
          • Split
      • PostgreSQL
        • Conventions
        • Content
          • BeginTransaction
          • BulkImport
          • ExecuteSQL
      • ProcessAutomation
        • Process
      • QuickBooks
        • Content
          • Accounts
            • Account
            • CreateAccount
            • GetAccounts
            • UpdateAccount
          • Attachables
            • Attachable
            • AttachableReference
            • CreateAttachable
            • DeleteAttachable
            • DownloadAttachable
            • GetAttachables
            • UpdateAttachable
            • UploadAttachable
          • BillPayments
            • BillPayment
            • CheckPayment
            • CreateBillPayment
            • DeleteBillPayment
            • CreditCardPayment
            • GetBillPayments
            • UpdateBillPayment
          • Bills
            • Bill
            • CreatebBill
            • DeleteBill
            • GetBills
            • UpdateBill
          • Budget
            • Budget
            • BudgetDetail
            • GetBudgets
          • Classes
            • Class
            • CreateClass
            • GetClasses
            • UpdateClass
          • Common
            • Customfield
            • PhysicalAddress
            • Reference
          • CompanyInfo
            • CompanyInfo
            • GetCompanyInfo
            • NameValue
            • UpdateCompanyInfo
          • CreditMemos
            • CreateCreditMemo
            • CreditMemo
            • DeleteCreditMemo
            • GetCreditMemos
            • UpdateCreditMemo
          • Customers
            • CreateCustomer
            • Customer
            • GetCustomers
            • UpdateCustomer
          • Departments
            • CreateDepartment
            • Department
            • GetDepartments
            • UpdateDepartment
          • Employees
            • CreateEmployee
            • Employee
            • GetEmployees
            • UpdateEmployee
          • Deposits
            • CreateDeposit
            • DeleteDeposit
            • Deposit
            • GetDeposits
            • UpdateDeposit
          • Estimates
            • CreateEstimate
            • DeleteEstimate
            • Estimate
            • GetEstimates
            • UpdateEstimate
          • Invoices
            • CreateInvoice
            • DeleteInvoice
            • GetInvoices
            • Invoice
            • UpdateInvoice
            • VoidInvoice
          • Items
            • createitem
            • getitems
            • item
            • updateitem
          • JournalCodes
            • createjournalcode
            • getjournalcodes
            • journalcode
          • JournalEntries
            • createjournalentry
            • deletejournalentry
            • getjournalentries
            • journalentry
            • updatejournalentry
          • PaymentMethods
            • CreatePaymentMethod
            • GetPaymentMethods
            • PaymentMethod
            • UpdatePaymentMethod
          • Payments
            • CreatePayment
            • CreditCardPayment
            • CreditChargeInfo
            • CreditChargeResponse
            • DeletePayment
            • GetPayments
            • Payment
            • UpdatePayment
            • VoidPayment
          • Pdfs
            • GetPdf
          • Preferences
            • CompanyAccountingPreferences
            • CurrencyPreferences
            • EmailMessagesPreferences
            • GetPreferences
            • Namevalue
            • Preferences
            • ProductAndServicesPreferences
            • ReportPreferences
            • SalesFormsPreferences
            • TaxPreferences
            • TimeTrackingPreferences
            • UpdatePreferences
            • VendorAndPurchasesPreferences
          • PurchaseOrders
            • CreatePurchaseOrder
            • DeletePurchaseOrder
            • GetPurchaseOrders
            • PurchaseOrder
            • UpdatePurchaseOrder
          • Query
            • ChangeDataCapture
            • Count
            • GetQuery
          • Purchases
            • CashPurchase
            • CheckPurchase
            • CreatePurchase
            • CreditCardPurchase
            • DeletePurchase
            • GetPurchases
            • Purchase
            • UpdatePurchase
          • RefundReceipts
            • CheckPayment
            • CreateRefundReceipt
            • DeleteRefundReceipt
            • GetRefundReceipts
            • RefundReceipt
            • UpdateRefundReceipt
          • Reports
            • Column
            • Columndata
            • GetAccountListReport
            • GetAgedPayableDetailReport
            • GetAgedPayablesReport
            • GetAgedReceivableDetailReport
            • GetAgedReceivablesReport
            • GetBalancesheetReport
            • GetCashFlowReport
            • GetClassSalesReport
            • GetCustomerBalanceDetailReport
            • GetCustomerBalanceReport
            • GetCustomerIncomeReport
            • GetCustomerSalesReport
            • GetDepartmentSalesReport
            • GetGeneralLedgerReport
            • GetGeneraLedgerReportFR
            • GetInventoryValuationSummaryReport
            • GetItemSalesReport
            • GetJournalReportFR
          • SalesReceipts
            • CreateSalesReceipt
            • CreditCardPayment
            • CreditChargeInfo
            • CreditChargeResponse
            • DeleteSalesReceipt
            • GetSalesReceipts
            • SalesReceipt
            • UpdateSalesReceipt
            • VoidSalesReceipt
          • TaxAgencies
            • CreateTaxAgency
            • GetTaxAgencies
            • TaxAgency
          • TaxCodes
            • GetTaxCodes
            • TaxCode
            • TaxRateDetail
          • TaxRates
            • EffectiveTaxRate
            • GetTaxRates
            • TaxRate
          • TaxServices
            • CreateTaxService
            • TaxRateDetail
            • TaxService
          • Terms
            • CreateTerm
            • GetTerms
            • Term
            • UpdateTerm
          • TimeActivities
            • CreateTimeActivity
            • DeleteTimeActivity
            • GetTimeactivities
            • TimeActivity
            • UpdateTimeActivity
          • Transactions
            • AccountBasedExpenseLineDetail
            • DepositLineDetail
            • DescriptionOnlyLineDetail
            • DiscountLineDetail
            • DiscountOverride
            • GroupLineDetail
            • ItembasedExpenseLineDetail
            • JournaleEtryLineDetail
            • Line
            • LinkedTransaction
            • Markupinfo
            • PaymentLineDetail
            • PurchaseOrderItemLineDetail
            • SalesItemLineDetail
            • SalesOrderItemLineDetail
            • SubTotalLineDetail
            • TaxLineDetail
            • TDSLineDetail
            • TransactionDeliveryInfo
            • TransactionTaxDetail
          • Transfers
            • CreateTransfer
            • DeleteTransfer
            • GetTransfers
            • Transfer
            • UpdateTransfer
          • VendorCredit
            • createvendorcredit
            • deletevendorcredit
            • getvendorcredits
            • updatevendorcredit
            • vendorcredit
          • Vendors
            • createvendor
            • vendor
            • updatevendor
            • getvendors
      • RabbitMQ
        • Content
          • RabbitMQReader
          • RabbitMQService
          • RabbitMQWriter
      • Redis
        • Content
          • RedisGet
          • RedisSet
          • RedisDelete
      • REST
        • Conventions
        • Content
          • Call REST Endpoint
          • REST Host
          • Simple REST Host
      • SignalR
        • Content
          • SignalR
      • Text
        • Content
          • Razor Template Transform
          • Regular Expression
          • String Builder
      • Utilities
        • Content
          • Assert
          • Command Line
          • Cron
          • Sleep
          • Timer
      • Xero
        • Authentication
        • Content
          • Accounts
            • Account
            • CreateAccount
            • DeleteAccount
            • GetAccounts
            • UpdateAccount
          • Attachments
            • Attachment
            • CreateAttachment
            • GetAttachments
            • UpdateAttachment
          • BankTransactions
            • Bank Transaction
            • CreateBankTransaction
            • GetBankTransactions
            • UpdateBankTransaction
          • BankTransfers
            • BankTransfer
            • BankTransferAccountData
            • CreateBankTransfer
            • GetBankTransfers
          • BrandingThemes
            • BrandingTheme
            • GetBrandingThemes
          • Common
            • Address
            • Allocation
            • CallXeroAPI
            • LineItem
            • PaymentTerm
            • PaymentTerms
            • Phone
            • TrackingCategory
          • Contacts
            • Balance
            • Balances
            • BatchPayments
            • Contact
            • Contact Person
            • ContactTrackingCategory
            • CreateContact
            • GetContacts
            • UpdateContact
          • ContactGroups
            • ContactGroup
            • ContactGroupContact
            • CreateContactGroup
            • CreateContactGroupContact
            • DeleteContactGroupContact
            • GetContactGroups
            • UpdateContactGroup
          • CreditNotes
            • CreateCreditNote
            • CreateCreditNoteAllocation
            • CreditNoteAllocation
            • CreditNote
            • GetCreditNote
            • GetCreditNotes
            • UpdateCreditNote
          • Currencies
            • GetCurrencies
            • Currency
          • Employees
            • CreateEmployee
            • Employee
            • ExternalLink
            • GetEmployees
            • UpdateEmployee
          • ExpenseClaims
            • CreateExpenseClaim
            • ExpenseClaim
            • GetExpenseClaims
            • UpdateExpenseClaim
          • Invoices
            • CreateInvoice
            • GetInvoice
            • GetInvoices
            • Invoice
            • UpdateInvoice
          • Items
            • CreateItem
            • DeleteItem
            • GetItems
            • Item
            • PurchaseDetails
            • SalesDetails
            • UpdateItem
          • Journals
            • GetJournals
            • Journal
            • JournalLine
          • LinkedTransactions
            • CreateLinkedTransaction
            • DeleteLinkedTransaction
            • GetLinkedTransactions
            • LinkedTransaction
            • UpdateLinkedTransaction
          • ManualJournals
            • CreateManualJournal
            • GetManualJournals
            • ManualJournal
            • ManualJournalLine
            • UpdateManualJournal
          • Organisations
            • GetOrganisations
            • Organisation
          • Overpayments
            • CreateOverpaymentAllocation
            • Overpayments
            • OverpaymentAllocation
            • GetOverpayments
          • Payments
            • CreatePayment
            • GetPayments
            • Payment
            • UpdatePayment
          • Prepayments
            • CreatePrepaymentAllocation
            • GetPrepayments
            • Prepayment
            • PrepaymentAllocation
          • PurchaseOrders
            • CreatePurchaseOrder
            • GetPurchaseOrders
            • PurchaseOrder
            • UpdatePurchaseOrder
          • Receipts
            • CreateReceipt
            • GetReceipts
            • Receipt
            • UpdateReceipt
          • RepeatingInvoices
            • GetRepeatingInvoices
            • RepeatingInvoices
            • Schedule
          • TaxRates
            • CreateTaxRate
            • GetTaxRates
            • TaxComponent
            • TaxRate
            • UpdateTaxRate
          • TrackingCategories
            • CreateTrackingCategory
            • CreateTrackingOption
            • DeleteTrackingCategory
            • DeleteTrackingOption
            • GetTrackingCategories
            • TrackingCategory
            • TrackingOption
            • UpdateTrackingCategory
            • UpdateTrackingOption
          • Users
            • User
            • GetUsers
        • Filters
          • OrderBy
          • Where
      • XML
        • Content
          • XML Peek
          • XML Poke
          • XML Reader
          • XML Writer
  • BestPractices
    • Conventions
    • Principles
    • Practices
  • TestRunner
    • How To Use Test Runner
    • Test Runner Console
  • Guides
    • Google
    • MS Graph
    • OAuth2 Authentication
    • REST
    • Salesforce Guide
    • Shopify
    • Writing C# in Linx
    • Xero
  • Release Notes
    • Linx Platform
      • Upgrading from Linx 5
      • 6.10.1
      • 6.10.0
      • 6.9.5
      • 6.9.3
      • 6.9.2
      • 6.9.1
      • 6.8.4
      • 6.8.3
      • 6.8.2
      • 6.8.0
      • 6.7.1
      • 6.7.0
      • 6.6.5
      • 6.6.4
      • 6.6.3
      • 6.6.2
      • 6.6.1
      • 6.6.0
      • 6.5.0
      • 6.4.3
      • 6.4.2
      • 6.4.1
      • 6.3.1
      • 6.3.0
      • 6.2.0
      • 6.1.0
      • 6.0.5
    • Plugins
      • Async
      • Compression
      • Cryptography
      • CSharp
      • Database
      • Email
      • Excel
      • File
      • FTP
      • Google Drive
      • Google Sheets
      • GraphQL
      • Job Scheduler
      • JSON
      • Kafka
      • Linx
      • PDF
      • PostgreSQL
      • Process Automation
      • Quickbooks
      • Rabbit MQ
      • Redis
      • REST
      • SignalR
      • Text
      • Utilities
      • Xero
      • XML
    • Solution Dependencies
      • Compiler
      • Types
Powered by GitBook
On this page
  • Properties
  • Function
  • Parameters
  • Example
  • Links
  1. Reference
  2. Plugins
  3. CSharp
  4. Content

CSharpFunction

CSharpFunction can contain any C# function's code that you want to include in your solution.


Properties

Function

The function definition to execute. Click on the [...] icon to open the Function Editor.

An example function is included as a reference. You can replace this with your own function.

When writing a new function, please note that any access modifiers (e.g. public or private) will be ignored, so it is not necessary to add them. The name of the function is also not important (and independent of the name of the Linx function), although it may help to specify a descriptive name to convey the purpose of the function.

Parameters will be extracted and listed in the Parameters section, while the result of the function (if any) will be used as the output of your Linx function.

Accessing System Classes

Linx allows access to the System classes (for example Math or IO). This can be done by calling the fully qualified class name. For example, to access the Abs function in the System.Math class, you will need to use System.Math.Abs().

Only static members and functions are available to use.


Parameters

In this section, you can assign values to the parameters that are defined in your function. The list of parameters will automatically update when changes are made to the function.


Example

The example function in the Function Editor returns "Hello [name]!".

When you save the function definition in the Function Editor, the name parameter is created in the Parameters section. Enter or select any value for the name parameter, e.g. "Jane". When you run the function, "Hello Jane!" will be returned.

The function's output will be available for use by other functions, e.g. SetValue. Expanding on our example, the target String in the screenshot below will be set to "Hello Jane!".


Links

PreviousContentNextDatabase

Last updated 4 months ago

Writing C# in Linx
CSharpFunction
CSharpFunction