1

I have model which having many relationship with other table

  <cfcomponent extends="Model">
    <cffunction name="init">
        <cfset table("products")>
        <cfset hasOne(name="productInventory") />
        <cfset hasmany(name="productDescriptions",dependent="deleteAll") />
        <cfset hasmany(name="productPrices",dependent="deleteAll") />
        <cfset nestedProperties(associations="productDescriptions,productPrices,productInventory",allowDelete=true)>

    </cffunction>
  </cfcomponent>

It's giving me an error on this update statement

Problem occured may because of structure created by cfwheels for object. as we look into to params.product dump having different id for many relation and in cfwheels object there is different id . may that why its creating problem of nested properties.

    <cfset variables.product = model("product").findOne(include="productDescriptions,productPrices,productInventory", includeSoftDeletes="true", where="products.id=#params.product.id#") />
            <cfset updateResult = product.update(params.product) />

Screen shot of error message:

Screenshot 1

Screenshot 2

Johnny Bones
  • 8,786
  • 7
  • 52
  • 117
  • Paste the error text into your question, also include the relevant code that is erroring, the exception message is pointing to the area of code that it is having issue with – Lima Oct 27 '15 at 06:48
  • You have removed code now. Add the code and keep image. Only then we can be able to help you. – Tushar Bhaware Oct 27 '15 at 07:08
  • 1
    The error message in your screenshot is not pointing to the code you specified??? – Miguel-F Oct 27 '15 at 12:26
  • Can you include more details about the data that you're posting? Perhaps a screenshot of ``. Also, what version of CFWheels are you using? – Chris Peters Oct 27 '15 at 14:15
  • @Miguel-F I think the code included is relevant to the error message. Something about the data being sent to the model is causing that framework-level exception. – Chris Peters Oct 27 '15 at 14:16
  • @ChrisPeters i have updated screenshot with error message and dump of params.product – Nilesh Bhagat Oct 28 '15 at 06:22

0 Answers0