Updating related data


#1

I’m having trouble getting the examples from the wiki working in the API docs - http://wiki.dreamfactory.com/DreamFactory/Features/Database/SQL/Related_Data

Although I can see the schema for the example Contacts db has changed a little, should the examples still work? For example, creating a new contact while also creating a new contact group and relating the new contact to it with the following POST to contact:

{
“resource”:
{
“first_name”: “Joe”,
“last_name”: “Smith”,
“contact_group_by_contact_group_relationship”: [
{
“name”: “ACME2”
}
]
}
}

This actually does create a new Joe Smith contact, but fails to create a new ACME2 group. The message received is “Failed to update many to one map assignment.\nField ‘contact_id’ must be a valid integer.”

I also get the same message when altering the above to try to add the new contact to the existing group with id 1.

“contact_group_by_contact_group_relationship”: [
{
“id”: 1
}
]

Ultimately, I would like to update many to many relationships in my own database & I’m wondering if it’s fully supported - ie: additions, updates, deletes as per the wiki.

Otherwise, enjoying Dream Factory very much, thank you.


#2

There are a few issues on posting related records that will be addressed in this sprint (shipping Nov 15). That should solve the problem you’re seeing.


#3

Hi Ben,

Do we have this solved in DFS 2.6?
I am struggling with the same issue.

Thanks
Saurabh


#4

Hi Planet Claire,

Trust you are doing good.
I am kind of stuck with the same implementation.
Curious to know if you were able to do it in the latest version? I am using 2.6 now.

Waiting for your response.

Thanks
Saurabh


#5

@Saurabh_Bhadkaria we didn’t get to this issue in 2.6 or 2.7. We’ve added it to the next sprint which will ship to production in late July.


#6

Thank you Ben, Appreciate your quick response.

Regards,
Saurabh