Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

Auto Store Relation with Add button


Go to End


1042 Views

Avatar
Benwitz

Community Member, 7 Posts

17 March 2012 at 3:40am

my structure in CMS:
Order DOM shows OrderItem - shows only OrderItems in active Order
OrderItem DOM shows ProcessStep - shows only ProcessSteps in active OrderItem

When I 'Add ProcessStep' I would like the OrderItemID field to be filled in automatically. currently i create a ProcessStep and when I return to the OrderItem DOM I have to select the checkbox to make the relationship (ie store OrderItemID in ProcessStep). checking the checkbox is a repetitive step since i should be able to indicate the proper OrderItemID at creation.

Is there a way I can tweak the 'Add ProcessStep' action to pass the ID?

I tried using onBeforeWrite in the ProcessStep but I dont know how to refer back to the active OrderItem to get its ID.