Facing issue in updating contact Mailing address into OtherAddress when onChange of checkbox

  • 1
  • Problem
  • Updated 3 years ago
  • (Edited)
I need some help with this. I have a scenario when a checkbox is true, i want to update contact mailing adderss into other address. Here i did some extent. But not solved completely i am facing some issues.

Thanks in Advance.

Here is my code: var field = arguments[0], value = arguments[1], $ = skuid.$; field.element.html(skuid.ui.renderers.BOOLEAN.edit({ onChange : function(value){ var conRow = skuid.$M('Contact').getRows()[0]; if(value) { conRow.OtherCity = conRow.MailingCity; conRow.OtherStreet = conRow.MailingStreet; conRow.OtherCountry = conRow.MailingCountry; conRow.OtherState = conRow.MailingState; conRow.OtherPostalCode = conRow.MailingPostalCode; } else { conRow.OtherCity = ''; conRow.OtherStreet = ''; conRow.OtherCountry = ''; conRow.OtherState = ''; conRow.OtherPostalCode = ''; } skuid.$M('Contact').adoptRows( field.row, field.row); } }));
Photo of Jagadeesh Boya

Jagadeesh Boya

  • 76 Points 75 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,836 Points 10k badge 2x thumb
Not sure about the code, but if I'm understanding correctly, you should a able to do this with model actions. Create a model action triggered by the update of the contact address field. Have it update field on rows. Choose the other address field. Set its value to the value of the contact address field (you may need to use merge syntax.