Magidoc

getFinanceClientAccountOptions
Query

Searches the counterparties a finance document may name — the client it is billed to or the vendor it is owed to — a page at a time, by name. search narrows on any part of the name; omitting it returns the first page alphabetically. selectedId names a counterparty already chosen, which comes back whether or not the search finds it, so a picker can always render its own value by name rather than by id. Access: Requires the finance feature and any one of the billing invoice generate, purchasing create, billing worksheet create or setup update permissions — each authors a document that names a counterparty. Deliberately not the CRM read: a bookkeeper who bills need not hold a CRM grant, and a workspace can run finance without the CRM feature at all. Errors: Throws when the user is not logged in, the workspace has finance disabled, or the user holds none of those permissions.

Arguments

#

workspaceId

ID !
Non-null

search

selectedId

accountType

Narrows the offer to one CRM account type, for the caller whose writer narrows too. Omitted by every picker whose writer stores this id as given — an agency bills companies it also buys from and the type is optional, so a filter there would only make a legitimate counterparty unreachable. Supplied by the vendor tax profile, which upsertVendorTaxProfile refuses unless the account is a live vendor.

Response

#

Returns FinanceClientAccountOptions !.

Example

#