Reference field in SmartAction of type ['Enum']

Expected behavior

Field in SmartAction of type [‘Enum’] with reference. I want to select multiple records from another collection in the form of the SmartAction.

I don’t even know if that functionality is supported. Is it?

Actual behavior

The browser freezes and the form remains half rendered.

Failure Logs

Uncaught TypeError: Cannot read property 'widget' of null
    at i.get (client-97dffa30a5d987a7e39579cd8bf227d9.js:13836)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:2679
    at e.untrack (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5121)
    at i.o.get (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2679)
    at i.currentEditWidget (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2638)
    at i.get (client-97dffa30a5d987a7e39579cd8bf227d9.js:13838)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:2679
    at e.untrack (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5121)
    at i.o.get (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2679)
    at i.componentName (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2638)
    at _e (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2655)
    at e.ye [as getPath] (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2654)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:4368
    at e.track (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5119)
    at e.t.value (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4368)
    at e.t.initialize (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4337)
    at e.t.peek (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4333)
    at Object.evaluate (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4696)
    at e.t.evaluate (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4629)
    at e.t.evaluateSyscall (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4900)
    at e.t.evaluateInner (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4894)
    at e.t.evaluateOuter (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4894)
    at r.next (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4997)
    at r.execute (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4996)
    at n.r.handleException (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4915)
    at e.t.handleException (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4942)
    at e.r.throw (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4904)
    at n.evaluate (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4701)
    at e.r.execute (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4904)
    at e.t.rerender (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4945)
    at e.l.render (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2426)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:2454
    at e.inTransaction (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4410)
    at n.i._renderRoots (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2453)
    at n.i._renderRootsTransaction (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2458)
    at n.i._revalidate (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2458)
    at t.invoke (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5286)
    at e.t.flush (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5278)
    at e.t.flush (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5292)
    at e.n._end (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5355)
    at e.n.end (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5311)
    at e.n._run (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5357)
    at e.n._join (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5356)
    at e.n.join (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5322)
    at h (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3927)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:3627
    at a (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3845)
    at Object.handleEvent (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3627)
    at p.handleEvent (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3552)
    at HTMLLIElement.<anonymous> (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3577)

Context

Please provide any relevant information about your setup.

  • Package Version: NPM? 6.13.0
  • Express Version: 4.17.1
  • Sequelize Version:
  • Database Dialect: Mongoose
  • Database Version:
  • Project Name: jurata
    "body-parser": "1.19.0",
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "cors": "2.8.5",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "^4.17.0",
    "express-jwt": "5.3.1",
    "forest-express": "^7.4.0",
    "forest-express-mongoose": "^7.7.1",
    "mongoose": "~5.8.2",
    "morgan": "1.9.1",
    "require-all": "^3.0.0"

Hello @David_Roegiers !

Nice catch indeed! :baseball:
This is definitively a bug.
It looks like it is currently not supported :building_construction:

We will handle it and tell you once it is fixed!

By the way, you can only put an array of strings in the enums key. Keep in mind, you won’t be able to see directly objects in the dropdown.

I hope it helps :wink:

Merci Guillaume :wave:

Okay, right now I’m building a workaround with type [‘Enum’], strings without reference.

Will you get in touch here, when this gets released? Or is there an issue tracker I can observe?

Regarding the way of supporting multiple records from another collection thanks to a dropdown list in a smart action form, I’m pushing it to our product board!

Thanks for digging into this :+1:

Just to be clear : this behaviour is possible by using the type [‘Enum’] and using RecordGetters in the hook. However, this is custom code, which needs maintaining and adds complexity to the overall solution. So, allowing the behaviour by simply using the reference field would be cool towards the future, but not a blocker in my project.