I need a help in creating field collection item dynamically. here is the use case.
while editing a node, i've some media files to be uploaded to third party using their api (ajax file upload), after I get response, i need to add an item to existing field collection. when we are doing this by using entity_create, setHostEntity, collection item save etc it is not working. If we save it to the default collection item available by using index 0 it works but unable to create other items on form submit.
please share your inputs, if we are missing something or this needs a different treatment/customization etc.
thanks in advance