⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

set_relation_n_n with a value



dinhopereira
  • profile picture
  • Member

Posted 18 June 2014 - 15:59 PM

Hi all...

 

In the image I have an example of what I really need.

 

I would like set a value on price field during on set_relation_n_n. Its possible?

 

 

 


Amit Shah
  • profile picture
  • Member

Posted 19 June 2014 - 16:45 PM

well.. tell me 1 thing.. do u want to make manual entry for the same or you want to make automatic entry for value based on key selection ?? what is the requirement. Based on that, a solution can be provided for


dinhopereira
  • profile picture
  • Member

Posted 19 June 2014 - 22:14 PM

well.. tell me 1 thing.. do u want to make manual entry for the same or you want to make automatic entry for value based on key selection ?? what is the requirement. Based on that, a solution can be provided for

 

I want to make manual entry for value based on key selection, example:

A propertie for rent with a especific value, and the same propertie for sale with other value.


dinhopereira
  • profile picture
  • Member

Posted 25 June 2014 - 01:33 AM

?


Amit Shah
  • profile picture
  • Member

Posted 25 June 2014 - 03:08 AM

Well 1 simple thing... if there are not many objectives .. then u can reduce the relation and store the objective prices in the property table itself.

Other way for the same can be - you can add action to property in listing to manage objectives for the property. There u can keep adding objective and price keeping the property id selected / hidden by default. This way u can manage it with ease...

Other is a complex way where u can have add objective / price button .. when clicked, u dynamically add the fields  - select the objective - set price.
And before insert, u can pickup each entries .. store them into a session variable, remove from the post ... and in post insert callback,
retrieve the data from the session and store each entry into the respective table.

Hope this works out for you.

Happy GCing :)


holmesii
  • profile picture
  • Member

Posted 25 June 2018 - 13:01 PM

mark