4 votes
Accepted

How to load custom css into admin popup boxes?

The custom css file do load on every page of civicrm, even the pop ups. Note that the elements in the ajax contains different ids and classes(mostly starts from ui-**) compare to page view. So you ...
jitendra - fuzion's user avatar
3 votes
Accepted

What are the security considerations before allowing access AJAX API to anonymous users?

Is the visibility for your field defined in the profile as Expose Publicly and also with the Searchable checkbox checked? You might not have to fiddle with permissions. Otherwise to directly answer ...
Demerit's user avatar
  • 22.9k
3 votes
Accepted

Problem with incoerent local currency in contribution

Looks like the decimal delimiter present at civicrm/admin/setting/localization?reset=1 is configured as a comma (,) instead of a default .. Civi might not be handling this correctly when the record ...
jitendra - fuzion's user avatar
3 votes

Using Civicrm_api3 in onAjax[Name] plugin function

Call civicrm_initialize() before using civicrm_api3() (or other CiviCRM functions). This function is defined in the various CMS plugins (eg civicrm.module) and will load required files then ...
Pradeep Nayak's user avatar
3 votes

Ajax Error when trying to view relationships tab

I had the same issue. CiviCRM 4.7/Drupal 7/IIS8 configuration. The Ajax call was generating a query longer than what the web server was configured to handle and behind the scenes the web server was ...
Jim Bennett's user avatar
3 votes

Making a small application with the CiviCRM API

I think what you're looking for is either https://docs.civicrm.org/dev/en/latest/api/v4/usage/#ajax, or the rest api at https://docs.civicrm.org/dev/en/latest/api/v3/rest/ Api explorer, found at https:...
Demerit's user avatar
  • 22.9k
2 votes

"SyntaxError: Unexpected token" error on l10n-js files

Generically: You have a Javascript error, so I would definitely consult the Troubleshoot Javascript errors post which describes additional steps to try. That said - I know what your problem is, and ...
Jon G - Megaphone Tech's user avatar
2 votes

Ajax Error when trying to view relationships tab

I am seeing this on 4.6.14 . This is due to modsec thinking it is a SQL attack. I saw a popup indicating datatables saw an error and to look here:https://datatables.net/manual/tech-notes/7 Console ...
Sonicthoughts's user avatar
2 votes
Accepted

Suppress default CRM.alert in hook_postProcess

To clear all status messages and prevent them from being shown to the user, you can do: CRM_Core_Session::getStatus(TRUE);
Coleman's user avatar
  • 18.6k
2 votes
Accepted

How to write unit tests for methods thsat echo instead of return (e.g., AJAX call handlers)

Allan - I have tended to try to refactor the AJAX functions such that they call a more testable function & test that - this generally improves the code.... There are a few examples that test the ...
Eileen's user avatar
  • 96
2 votes

How to write unit tests for methods thsat echo instead of return (e.g., AJAX call handlers)

I'm a bit out of date on the current status of the civi test framework, but if WebTests are still available I would do this as a WebTest. https://wiki.civicrm.org/confluence/display/CRM/Setting+...
Demerit's user avatar
  • 22.9k
2 votes

After upgrade to 4.7.13, I get 500 Internal Server Error when creating new mailing

After investigations : The issue is due to i18n : if multilingual is on, then the bug raises. When it's off, there are no bug. CRM_Core_DAO_AllCoreTables::registerEntityType returns only table names ...
philippe's user avatar
2 votes

HowTo: crmApi get rows with date between

Oh, I've found in my crm menu Support - Develper - API Explorer and there was a solution: start_date: {'BETWEEN': ['2015-01-01', '2016-01-01']},
Somerussian's user avatar
2 votes

Tutorial for creating pages with ajax

As far as I know - If you dont need any specific action to be done on the form which you have created before you hit the submit button then you should be alright For example: If you enter a ...
Ramesh - ARTECH Consultancy's user avatar
2 votes

AJAX API permissions

I believe there is currently a bug. I have submitted a bug report: https://issues.civicrm.org/jira/browse/CRM-20582 When I ran into my issue, I was told: "If you need a quick fix that doesn't ...
Randy Tobias's user avatar
2 votes

Wordpress Ajax & pictures not loading after upgrade to 5.0

I can see the problem (I saw this myself recently), but I don't have a 100% answer. However, the solution is usually to rebuild your multilingual schema. This problem is characterized by: ...
Jon G - Megaphone Tech's user avatar
2 votes
Accepted

https://docs.civicrm.org/dev/en/latest/framework/ajax/

crmLoad is triggered on every action. Try: CRM.$(document).on('crmLoad', function(e, data) { console.log(data); })
nielo's user avatar
  • 1,304
2 votes

Fetch Node data from drupal into CiviCRM

On which forms do you wish to add the fields/logic? I feel like there are two questions here: 1) How to build an arbitrary list of options from a third-party source of data (Drupal) 2) How to set ...
bgm's user avatar
  • 3,421
2 votes
Accepted

Fetch Node data from drupal into CiviCRM

I wasn't able to figure this out so data is Fetched directly into CiviCRM. However, I ended up using Drupal EntityQuery and fetched the data into a webform then Used Javascript PopUp Feature and ...
Moe's user avatar
  • 521
2 votes
Accepted

Using fieldOptions with Custom Fields

As I haven't seen your code, I can only suggest what worked for me: function myext_civicrm_fieldOptions($entity, $field, &$options, $params) { if ($entity == 'Contribution') { if (isset($...
VangelisP's user avatar
2 votes

Making a small application with the CiviCRM API

You could review this Cordova based mobile app which integrates with CiviCRM, https://github.com/agileware/au.com.agileware.civicontact
Justin Freeman - Agileware's user avatar
2 votes
Accepted

After upgrade to 5.44 menu and some elements won't load without debugging enabled

Long story short, it was a permission issue. A change to groups on my institutions relatively new server left Apache without execute permission on some files and folders in myTheme/civicrm/files. The ...
Jeff Wood's user avatar
  • 133
2 votes

How can I call api directly from external http?

This URL lets me get contacts from my site externally (without logging in) and without creating a JavaScript client: https://agloa.org/wp-json/civicrm/v3/rest?entity=Contact&action=get&json=1&...
MikeSteigerwald's user avatar
2 votes
Accepted

Contact Quick Edit, refreshParent after CRM.api3('CustomValue', 'create)?

Use below $('.crm-custom-set-block-5 .crm-summary-block').load(CRM.url('civicrm/ajax/inline', { cid: '133', class_name: 'CRM_Contact_Page_Inline_CustomData', groupID: '5', customRecId: '1', ...
Pradeep Nayak's user avatar
2 votes
Accepted

How to add JavaScript to an AJAX snippet

The buildForm hook works for popups too. TIP: put some logging in a buildForm hook to log the $formName, then visit the page you're interested in. If you're interested in new case, see https://lab....
Demerit's user avatar
  • 22.9k
1 vote
Accepted

A contribution batch containing transactions of more than one currencies causes fatal error

I believe the standard workflow for accounting requires a single currency per batch. At least that was all that we aimed to support. Please create an issue at lab.civicrm.org indicating that there ...
Joe Murray's user avatar
  • 6,741
1 vote

Ajax issues on WordPress

You need to cross check each and every path configured in Administer -> System Settings -> Resource URLs. Set them as per your site configurations. CiviCRM Resource URL : is the URL path to ...
jitendra - fuzion's user avatar
1 vote

https://docs.civicrm.org/dev/en/latest/framework/ajax/

I'm new here so I'm not sure what protocol to follow to explain 1) how to receive notifications from CiviCRM for the events shown in your screenshot of the CiviCRM Admin panel and 2) what you mean ...
Pinnacle Systems Group's user avatar
1 vote
Accepted

CiviCRM AJAX api Permissions

I think you can bypass permission using permission_check hook.
Pradeep Nayak's user avatar
1 vote

Ajax error when viewing relationships under IIS and Joomla (HTTP400 - invalid syntax)

After months of struggling with this, I think I have solved it: I found this article or others like it: https://stackoverflow.com/questions/8159321/request-exceeds-the-configured-maxquerystringlength-...
Stephen Palmstrom's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible