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.
Like
Hello,
Please check if the Address column is present in the SyncColumns array of the Account entity in the ModelDataImportConfig array of the mobile application manifest. It seems that the column is not synced so you receive undefined in the debugger.
Oleg Drobina,
Hi Oleg,
thanks for the reply,
should i add manually on Mobile manifest file or via Mobile Application Wizard?
PS: i don't use debugger like console.log, i use javascript's alert function since i use iOS and i have no clue on how to debug mobile apps on a smartphone, especially iOS.
Yanuar Adinagoro Vishnu Saputro,
It can be either manually or you can add the Address column to the account edit page and the column should be added to the manifest automatically in this case.