You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for building a great extension. I don't think I fully understand what scope the popup_callback is calling functions from.
I keep getting an error ReferenceError: depotDisplay is not defined when I don't make it a global function. But given that I want to use CiviCRM's api I'm stuck doing
function($) {
function displayInfo(feature, layer) {
var text = 'hello';
if (feature.properties.depot_id) {
text = 'some stuff';
CRM.api4('Contact', 'get', {
select: ["display_name", "custom_distribution_schedule.Days_of_a_the_Week:label", "custom_distribution_schedule.Start_Time", "custom_distribution_schedule$
join: [["Relationship AS relationship", "LEFT", ["relationship.contact_id_b", "=", "id"], ["relationship.contact_id_a", "=", 345]], ["Custom_Distribution_$
where: [["relationship.relationship_type_id", "=", 15], ["relationship.is_active", "=", true]],
checkPermissions: false, // IGNORED: permissions are always enforced from client-side requests
limit: 1
}).then(function(contacts) {
text = contacts[0].display_name;
// do something with contacts array
}, function(failure) {
// handle failure
});
// Find the details
// layer.bindPopup(text);
}
layer.bindPopup(text);
};
}(CRM.$);
Unless you feel that I'm doing this wrong? Any help would be amazing I'm so close to finishing the integration, but I'm stuff on this element.
The text was updated successfully, but these errors were encountered:
Hey there,
Thanks for building a great extension. I don't think I fully understand what scope the
popup_callback
is calling functions from.I keep getting an error
ReferenceError: depotDisplay is not defined
when I don't make it a global function. But given that I want to use CiviCRM's api I'm stuck doingUnless you feel that I'm doing this wrong? Any help would be amazing I'm so close to finishing the integration, but I'm stuff on this element.
The text was updated successfully, but these errors were encountered: