How Can I update an Express Entry in code
Permalink
Hello,
I have an express object where each and all entries have a series of text, checkbox and multi-select attributes that can be associated.
I need to programmatically add entries for the object. For the Text and Checkbox attributes, I am easily able to set the attribute value using the set() function and passing in the text for the text items, and a zero or a one (0 or 1) for the checkbox.
However, for the multi-select attribute, how do you go about passing in all of the options that should be checked for the entry?
Here is some sample code for the text and checkbox items that I have working. Just looking for how to do the multi-select.
The above gives me a new entry for the My Product object, with a part_number of 'abc123' and is_valid checkbox is checked, and the disabled checkbox is not checked.
The options for the multi-select are
'red', 'green', 'blue'
I need to choose BOTH the 'red' and 'blue' options for a single entry.
Thanks in advance !
I have an express object where each and all entries have a series of text, checkbox and multi-select attributes that can be associated.
I need to programmatically add entries for the object. For the Text and Checkbox attributes, I am easily able to set the attribute value using the set() function and passing in the text for the text items, and a zero or a one (0 or 1) for the checkbox.
However, for the multi-select attribute, how do you go about passing in all of the options that should be checked for the entry?
Here is some sample code for the text and checkbox items that I have working. Just looking for how to do the multi-select.
$entry = Express::buildEntry('my_product'); $entry->setPartNumber('abc123'); $entry->setIsValid(1); $entry->setDisabled(0);
The above gives me a new entry for the My Product object, with a part_number of 'abc123' and is_valid checkbox is checked, and the disabled checkbox is not checked.
The options for the multi-select are
'red', 'green', 'blue'
I need to choose BOTH the 'red' and 'blue' options for a single entry.
Thanks in advance !
The code that now works looks like this
This creates an entry that looks like this
Part Number: abc123
Is Valid: Yes
Available Colors: Red, Blue
Is Disabled: No