FieldMotion API Docs
  • Getting Started
  • Account
    • _setName
    • _getTaxRate
    • _new
    • _setDefault
    • _delete
    • _getDetails
    • _setNominal
  • AccountCategory
    • _save
    • _new
    • _delete
  • AccountCategoryGroup
    • _save
    • _new
    • _delete
  • Accounts
    • _import
    • _listNominals
    • _getAccountCategoryGroups
    • _getChartOfAssetAccounts
    • _getCategories
    • _getChartOfAccounts
  • Address
    • _delete
    • _get
    • _set
  • ApiKey
    • _list
    • _create
  • Appointment
    • _calculateTravel
    • _checkJobRef
    • _createDuplicates
    • _getAddress
    • _getAsJpg
    • _getAsPdf
    • _getAsTiff
    • _getClientAndMeetingTime
    • _getLinkedUsers
    • _getLocation
    • _get
    • _getNotes
    • _getStatus
    • _getStock
    • _getTableColumnSum
    • _getTimeAndCosts
    • _invoiceDocumentDelete
    • _invoiceDocumentGenerate
    • _invoiceDocumentGet
    • _invoiceDocumentsList
    • _invoiceGenerate
    • _invoiceGet
    • _invoiceUpdate
    • _logGet
    • _move
    • _new
    • _print
    • _save
    • _setFieldImage
    • _setContractId
    • _setCustomer
    • _setDueDate
    • _setField
    • _setFormNum
    • _setHours
    • _setJobRefCustomer
    • _setJobRef
    • _setMeetingTime
    • _setMileage
    • _setNotes
    • _setScheduleOfRates
    • _setPdfSent
    • _setPriority
    • _setStatus
    • _setStatusToComplete
    • _setTableCellImage
    • _setStock
    • _setStockNotes
    • _setTableCells
    • _setTables
    • _setUserIdAndType
    • _setVehicleId
  • AppointmentRecurrence
    • _clean
    • _copy
    • _create
    • _delete
    • _deleteFromDate
    • _get
    • _getByAssetDT
    • _getByCustomerDT
    • _getDT
    • _removeAppointment
    • _rename
    • _resetMonth
    • _runAll
    • _setActive
    • _setDepartmentId
    • _setEDate
    • _setEvery
    • _setName
    • _setOn
    • _setupMonth
    • _setSchedule
    • _setSkipWeekends
    • _updateNext
  • Appointments
    • _calculateTravel
    • _countIncomplete
    • _emailRemoved
    • _getById
    • _getCalendar
    • _getDT
    • _getExportData
    • _getSome
    • _getJobRefLast
    • _getJobRefNext
    • _getStock
    • _getInvoiceStatuses
    • _importStep1
    • _importStep2
    • _importStep3
    • _listbyDateTimeRange
    • _listByLastEdited
    • _listIds
    • _new
    • _listBy
    • _save
    • _recurring
    • _setMeetingDate
    • _setUser
    • _statusSet
  • AppointmentsFinancial
    • _getDT
  • AppointmentType
    • _delete
    • _new
    • _setArchived
    • _setDepartment
    • _setDuration
    • _setForm
    • _setName
    • _setNotes
    • _setNotification
    • _setNotificationEmail
    • _setPriority
  • AppointmentTypes
    • getDT
    • list
  • Area
    • _listUsers
  • Asset
    • _appointmentsGetDT
    • _archive
    • _delete
    • _financialsGetDT
    • _getByBookID
    • _getLocation
    • _get
    • _getOwner
    • _getQrCode
    • _locationsGetDT
    • _new
    • _rentalsGetDT
    • _setCode
    • _setActive
    • _setArchive
    • _setCustomer
    • _setCustom
    • _setLocationId
    • _setLocation
    • _setRentalFreq
    • _setLocationType
    • _setName
    • _setOwner
    • _setRentalAmt
    • _setType
    • _setUrl
    • _setValue
    • _setVehicleReg
    • _setWarranty
    • _unarchive
  • AssetMaintenance
    • _create
    • _delete
    • _disable
    • _export
    • _getDescriptions
    • _getDT
    • _listNames
    • _setName
  • AssetMaintenances
    • getDescriptions
  • Assets
    • _import
    • _qrPrint
    • _getNames
    • _listByLastEdited
    • _list
    • _getRentalIds
    • _getRecentAppointments
    • _getInvoice
    • _getDT
    • _export
  • AssetTable
    • _deleteAll
    • _edit
    • _getData
    • _setRow
  • AssetType
    • _setMeta
    • _setTemplate
    • _setName
    • _new
    • _get
    • _delete
    • _setUrl
    • _setAttrBit
  • AssetTypes
    • _getNames
    • _listByLastEdited
    • _list
    • _listByRentalType
    • _getDT
  • Contract
    • _setName
    • _setActive
    • _edit
    • _addAppointment
    • _new
    • _recalculateCustomersFromAppointments
    • _removeAppointment
    • _getNotes
    • _setNotes
    • _setBudget
    • _customEdit
    • _setCustom
    • _get
    • _setExpiryDate
    • _delete
  • Contracts
    • _import
    • _list
    • _getDT
    • _export
  • Customer
    • _checkAccountNumberIsUnique
    • _checkLandlineIsUnique
    • _contractsGetDT
    • _deleteCallback
    • _delete
    • _disable
    • _edit
    • _emailsGetDT
    • _enable
    • _exportChanges
    • _financialsExport
    • _financialsGetDT
    • _getAppointmentsDT
    • _getByAccountNumber
    • _getByChild
    • _getChangesDT
    • _getChildrenDT
    • _getCustomFields
    • _getCreditTerms
    • _getDepartmentId
    • _getEventsDT
    • _getHighestAccountNumber
    • _getLocation
    • _getLocations
    • _getMeta
    • _getNotes
    • _getSubsidiaries
    • _get
    • _loginCreate
    • _loginDelete
    • _new
    • _quotesGetDT
    • _setCallback
    • _setArea
    • _setCallbackNotes
    • _setCity
    • _setCounty
    • _setCreditTerms
    • _setDepartmentId
    • _setLatLng
    • _setNotes
    • _setMobile
    • _setPostCode
    • _setState
    • _setStreet1
    • _setTown
    • _stockExport
    • _stockExportTotals
    • _stockGetDT
    • _stockTotalsGet
    • _updateMeta
  • CustomerAppointments
    • export
  • CustomerAssets
    • _getDT
  • CustomerInvoices
    • _getDT
  • Customers
    • _delete
    • _export
    • _getAllTypes
    • _getAllNamesAndAddress1s
    • _getAllNames
    • _getById
    • _getDetails
    • _getDT
    • _getSome
    • _import
    • _listByLastEdited
    • _listParents
    • _list
    • _merge
    • _search
  • CustomerTable
    • _import
    • _edit
    • _getData
    • _setRow
  • CustomerType
    • _new
    • _save
    • _get
    • _delete
  • CustomerTypes
    • _list
  • Department
    • _delete
    • _get
    • _getUsers
    • _new
    • _setAssets
    • _setCustomerTypes
    • _setName
    • _setUsers
  • Departments
    • _getById
    • _getNames
    • _getDT
  • File
    • _delete
    • _get
    • _getByUrl
    • _getTags
    • _getMaxUploadSize
    • _setCustomerReadable
    • _setEditNotesInPortal
    • _setIncludeInMailReport
    • _setNotes
    • _upload
  • Files
    • _deleteAll
    • _getDT
  • Form
    • _autodocImageGet
    • _copy
    • _countJobs
    • _createFromPdf
    • _dataGetDT
    • _edit
    • _exportDataAsCSV
    • _get
    • _getIsInvoiceable
    • _pageMove
    • _pageRemove
    • _setPortalVisibility
  • FormBlock
    • _delete
    • _getByName
    • _get
    • _new
    • _setCode
    • _setImage
    • _setName
  • Forms
    • _getNamesByIds
    • _adminFormsList
    • _list
    • _getDT
  • Geofence
    • _delete
    • _get
    • _save
  • Geofences
    • _getDT
  • GoodsReceived
    • _getBySupplierId
    • _newNote
    • _getDT
    • _export
  • GoodsReceivedNote
    • _get
    • _jobCreate
    • _delete
  • ImportCustomersEmail
    • _delete
    • _save
    • _setName
    • _setNotes
  • ImportTasksEmail
    • _save
  • Invoice
    • _delete
    • _get
    • _pay
    • _setDiscount
    • _setDiscountTax
    • _setForm
    • _setStatus
  • Invoices
    • _getStatuses
    • _exportSageOne
    • _list
    • _exportLineItems
    • _exportSage
    • _exportCSV
    • _getExportData
    • _getDT
  • Jobs
    • _list
  • Link
    • _save
    • _delete
    • _getDetails
  • Links
    • _getDT
  • Location
    • _edit
    • _add
    • _get
    • _delete
  • Locations
    • _getNames
    • _get
  • Log
    • _get
  • MarketingExpense
    • _delete
    • _new
    • _setExpense
    • _setExpenseDate
    • _setSource
  • MarketingExpenses
    • _getDT
  • MarketingSource
    • _delete
    • _new
    • _setName
  • MarketingSources
    • _getDT
    • _list
  • Opportunity
    • _convertToQuote
    • _delete
    • _new
    • _setFormValues
    • _setNotes
    • _setSource
    • _setStatus
    • _setUser
    • _setValue
  • Opportunities
    • _getDT
  • Outsourcing
    • _setStatus
    • _requestLink
    • _getLinkQr
    • _getLinkCode
    • todo
    • _countPending
  • PurchaseOrder
    • _getReference
    • _setReference
    • _getTargetDetails
    • _orderEmail
    • _setDeliveryDetails
    • _new
    • _setSupplier
    • _cancel
    • _setLink
    • _setDeliveryDate
    • _get
    • _getPdf
    • _setDeliveryAddress
    • _delete
    • _setDeliveryCosts
    • _approve
  • PurchaseOrderEntries
    • _get
  • PurchaseOrderEntry
    • _delete
  • PurchaseOrders
    • _export
    • _getBySupplierId
    • _getDT
    • _listAttention
  • Quote
    • _costsGet
    • _costsSet
    • _delete
    • _documentLink
    • _get
    • _getTags
    • _new
    • _notesGet
    • _setGross
    • _setNet
    • _setNotes
    • _setSaleChance
    • _setStatus
    • _setTags
    • _setTax
    • _unlinkJob
  • Quotes
    • _getPredictedSales
    • _list
    • 01_getDT
    • todo
    • _templatePdfGet
    • _templateTypeGet
    • _templateTypeSet
    • _export
  • Referral
    • _new
    • todo
    • _delete
  • Report
    • _appointmentsByAssetTypes
    • _userPerformance
    • _usersPerformance
    • _users
  • Reports
    • _list
    • _exportUserReports
  • RequisitionOrder
    • _setDeliveryDetails
    • _new
    • _setLink
    • _setDescription
    • _setDeliveryDate
    • _get
    • _delete
    • _setDeliveryCosts
    • _approve
  • RequisitionOrderEntries
    • _get
  • RequisitionOrderEntry
    • _delete
    • _new
    • _save
  • RequisitionOrders
    • _getDT
    • _export
  • ScheduleOfRates
    • _add
    • _delete
    • _get
    • _getByNameAndCode
    • _getDT
    • _list
    • _setAssetTypes
    • _setCost
    • _setCustomerCosts
    • _setNominal
    • _setPriceBands
  • Setting
    • _setImage
    • _set
    • _get
    • _dbUpdates
  • Settings
    • _save
    • _get
  • SMS
    • _eventListenersUpdate
  • Stock
    • _add
    • _containerAdd
    • _containerList
    • _containers
    • _deleteByDate
    • _deleteByIds
    • _delete
    • _descriptionGet
    • _descriptionSet
    • _exportAll
    • _exportCosts
    • _exportLocations
    • _exportTrigger
    • _exportUsers
    • _exportVehicles
    • _find
    • _getTriggerErrors
    • _getCosts
    • _getDT
    • _getLocationTags
    • _get
    • _itemGet
    • _listByCategory
    • _listByIds
    • _listBySupplier
    • _listItems
    • _list
    • _nominalGet
    • _nominalSet
    • _notesGet
    • _notesSet
    • _setIsArchived
    • _setName
    • _supplierAdd
    • _supplierSet
    • _suppliersSet
    • _updateOneField
  • StockCategory
    • _update
    • _move
    • _list
    • _addStock
    • _add
    • _get
    • _delete
  • Stocks
    • _import
    • _list
  • Supplier
    • _edit
    • _getStatus
    • _new
    • _getByPO
    • _get
    • _delete
  • Suppliers
    • _list
    • _getDT
  • Target
    • _getOrders
    • _getName
  • Task
    • _setStatus
    • _setPrivacy
    • _update
    • _setAssignedTo
    • _edit
    • _setType
    • _setDetails
    • _setResolution
    • _create
    • _setSubject
    • _setTimeSpent
    • _get
    • _delete
    • _setDueDate
    • _setCustomerId
  • TaskNote
    • _new
  • TaskNotes
    • _get
  • Tasks
    • _listByLastEdited
    • _getDT
    • _getDetails
  • TaskType
    • _new
    • _delete
    • _edit
  • TaskTypes
    • _list
  • Undo
    • _apply
    • _archive
    • _setName
  • Undos
    • _list
  • User
    • _activate
    • _backgroundColourGet
    • _deactivate
    • _delete
    • _filtersSave
    • _getTmpLoginKey
    • _getAppointmentsDT
    • _getCompanyName
    • _get
    • _getStockDT
    • _setImage
    • _new
    • _setAppPermissions
    • _setDepartments
    • _setEmail
    • _setMeta
    • _set
    • _setName
    • _setNextOfKin
    • _setPermissions
    • _stockDelete
  • UserClockin
    • _delete
    • _new
    • _setClockinDiff
    • _setClockinNotes
    • _setClockinTime
    • _setClockoutDiff
    • _setClockoutNotes
    • _setClockoutTime
    • _setFlag
    • _setNotes
  • UserClockins
    • _getDT
    • _list
  • UserFile
    • _get
    • _exists
  • UserFilter
    • _setName
    • _setPublic
    • _delete
    • _save
  • UserFilters
    • _getDT
  • Users
    • _updateCount
    • _list
    • _getLatLon
    • _getDepartments
    • _listAvailability
    • _backgroundColourGet
    • _getDT
    • _export
    • _listSalaries
  • Util
    • _geocode
    • _geocodeReverse
    • _getCountryNames
  • Vehicle
    • _setReg
    • _setPricePerDistance
    • _setCostPerDistance
    • 83_update
    • _setDescription
    • _update
    • _getByUserId
    • _get
    • _delete
  • Vehicles
    • _getReges
    • _getCostPerDistance
    • _getDT
Powered by GitBook
On this page
  • Parameters
  • Examples
  • Results
  1. Stocks

_list

Lists Stocks using several optional parameters

Parameters

fields

Fetches requested aspects of Stock, through the use of several fields in an array: "name", "code", "in_stock", "average_cost", "price", "nominal_code", "tax_rate", "description", "notes", "id", "price_bands"

supplier_id

Condition which only fetches Stock that are from a Supplier with the given id

all

Condition which decides if archived Stocks should also be included. 0 => No, 1 => Yes

last_edited

Condition which filters fetched Stock by only selecting from after the given date

Examples

(In these examples, there are 3 total Stocks, Test Stock 2 is Archived, Test Stocks 2 and 3 have a supplier)

1. This example simply gathers the id and name of every non-archived Stock

FM_api(
    'Stocks_list',[
        'fields' => '["id","name"]'
    ]
);

2. This example will gather the ids and names of all Stock, included Archived, under a Supplier with the ID of 368157

FM_api(
    'Stocks_list',[
        'fields' => '["id","name"]',
        'all' => '1',
        'supplier_id' => '368157'
    ]
);

3. This example below will fetch the id, names and prices of Stock valid under the following conditions: Their supplier has the ID of 368157, The stock is not Archived, The stock has received changes since the time of 14:47:30 on the 12th of March 2023.

FM_api(
    'Stocks_list',[
        'fields' => '["id","name","price"]',
        'supplier_id' => '368157',
        'last_edited' => '2023-03-12 14:47:30',
        'all' => '0'
    ]
);

Results

On Success

  1. All non-archive Stock fetched. (Stocks 1 and 3)

[{"id":427418,"name":"Test Stock 1"},{"id":427419,"name":"Test Stock 3"}]
  1. All Stock under a supplier with the ID of 368157. (Stocks 2 and 3)

[{"id":427417,"name":"Test Stock 2"},{"id":427419,"name":"Test Stock 3"}]
  1. The Ids, names and prices of every non-Archived Stock which has been edited since 14:47:30 on the 12th of March 2023 and also has a supplier under the ID of 368157. (Stocks 2 and 3 have been edited since that time, however Stock 2 is Archived, therefore only Stock 3 is fetched)

[{"id":427419,"name":"Test Stock 3","price":"2.0000"}]
Previous_importNextSupplier

Last updated 2 years ago