Event Related Object Fields

Ok, depending on whether you want to allow multiple types of Sobjects for your WhatId field, the solution could be more complicated. I worked on the simple case where you only update the event’s location based on an account’s (in your case, contact’s) address. Here’s what I did:

1.) Create your models (Events and Account). Your Account model should have a condition where Id = ‘’ (filterable as AcctId) (inactive). ALSO, in your advanced settings for Account, uncheck “Load Model Data on Page Load.”

2.) Use a custom popup window for your event source’s on-click behavior. In this popup, include all the fields necessary (including WhatId), and use a custom button to save the event (you can uncheck “Show Default Buttons in Popup” under “Configure On-Click Popup” if you want.


3.) The snippet for your custom button should include this code (but replace Account information with Contact information):

//If an event's WhatId points to an account, use the account's billing street as the event's location. var $ = skuid.$; //Get the events model and the event row in context var eventModel = skuid.model.getModel('Events'); var contextRow = arguments[0].component.component.context.row; //Get info about the account model var acctModel = skuid.model.getModel('Account'); var acctCondition = acctModel.getConditionByName('AcctId'); //Save the event model in order to get the WhatId eventModel.save({ callback: function(){ var eventWhatId = contextRow.WhatId; //Run this if an account is associated with the event's WHatId if (eventWhatId !== undefined &amp;&amp; eventWhatId !== null) { if (contextRow.What.Type == 'Account') { //Bring the event's account into the account model, and update the event's location acctModel.setCondition(acctCondition, eventWhatId); acctModel.activateCondition(acctCondition); acctModel.updateData(function(){ var account = acctModel.getFirstRow(); var acctAddress = account.BillingStreet; eventModel.updateRow(contextRow, {Location: acctAddress}); eventModel.save(); }); } } } }); //Close the popup $('.ui-dialog-content').dialog('destroy');<br>

 
Hope this is not more complicated than what you’re looking for. Currently, this is probably the best you can do! Let me know if you have any other questions.