Hello,
I have a slightly urgent question on how to get Address from Account lookup
the code lookslike this
Terrasoft.sdk.Model.addBusinessRule("Activity", {
name: "LatLongPreFilled",
ruleType: Terrasoft.RuleTypes.Custom,
triggeredByColumns: ["Usrcheck_in"],
events: [
Terrasoft.BusinessRuleEvents.ValueChanged,
Terrasoft.BusinessRuleEvents.Save,
],
executeFn: function (model, rule, column, customData, callbackConfig) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
function (position) {
model.set("Usrcheck_in_longitude", position.coords.longitude, true);
model.set("Usrcheck_in_latitude", position.coords.latitude, true);
var account = model.get("Account").get("Address");
alert(account);
Ext.callback(callbackConfig.success, callbackConfig.scope);
},
function (error) {
alert("Geolocation failed: " + error.message);
Ext.callback(callbackConfig.success, callbackConfig.scope);
}
);
} else {
alert("Geolocation is not supported by this browser.");
Ext.callback(callbackConfig.success, callbackConfig.scope);
}
},
});
i use this: var account = model.get("Account").get("Address");
but when i test it, displayed on an alert it says "undefined", but this model.get("Account").get("Id"); or model.get("Account").get("Name"); works fine.
Can anyone help me out?
Thank you.