Feature(s) impacted
Smart Action Hooks
Observed behavior
We have been using the Sequelize package, and we are now migrating to the new Node agent. We are encountering issues with the hooks and their migration, as the documentation does not provide an in-depth outline of the process.
For example, we have a field that loads all of our partners from a model. The type is an Enum. In previous versions, we were able to use findAll to retrieve all partners and then map them to display in a certain way.
const allPartnerCompanies = await models.partnersPartnercompany.findAll()
allPartnerCompanies.map((singlePartnerCompany) => {
partnerCompanyOptions.push(`${singlePartnerCompany.name} ${singlePartnerCompany.partnerTypes} | ID: ${singlePartnerCompany.id}`)
})
companyPartnerFieldName.enums = partnerCompanyOptions
return fields
In the new Node version, we are running into errors. It seems we can use “const allPartnerCompanies = context.collections.partnersPartnercompany.” in a simple way to retrieve the data, but nothing is coming back.
Do you have any suggestions?
Also additional documentation, especially expanded sections on Scopes and Context with examples for each, would also be greatly appreciated.
Expected behavior
For the smart action field to show the records in the dropdown
Failure Logs
Context
- Project name:
- Team name: …
- Environment name: …
- Agent (forest package) name & version: 1.34.1
- Database type: Sequelize Data Source Package - postgres
- Recent changes made on your end if any: …