You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Setting a Menu Value in Connect for PHP

Accepted answer
23
Views
3
Comments
edited Jun 20, 2018 3:27AM in UI Extensibility 3 comments

Content

This is making me crazy, but I don't seem to be able to set a value on a menu field in a custom object using CPHP. On a test site, I built a custom object called "Animal" with two fields: "Name" is a string, and "Sound" is a menu with the values "Moo" (0), "Oink" (1), "Woof" (2). (See attached code block.) I cannot set either

$animal->Sound->ID = 2;

or

$animal->Sound->LookupName = 'Woof';

Because I get an error similar to "Connect error: 1, Not Allowed: read-only; AnimalSounds.ID" Buuut...I'm pretty sure I'm following the example in the documentation found on this page

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!