Answers.Body: <p>It looks like you are creating it disabled?</p>
  
  <blockquote>
  <pre><code>    "is_active": "",
  </code></pre>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-04T10:16:02.540Z
Answers.LastActivityDate: 2019-04-04T10:16:02.540Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>Your code includes <code>'id' =&gt; 1</code></p>
  
  <p><code>create</code> with an id is for updating an existing value.  Do you already have a WordReplacement with id=1 ?</p>
  
  <p>If you are wanting to create a new one rather than update, just omit <code>'id' =&gt; 1</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-05T11:58:01.623Z
Answers.Text: But I want to edit a values of id 1.
Answers.UserDisplayName: deepak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-05T12:08:16.280Z
Answers.Text: Ok, that's not how I interpreted your question.  What output do you get from `cv api WordReplacement.get` ?
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-05T09:56:08.443Z
Answers.LastActivityDate: 2019-03-05T09:56:08.443Z
Answers.UserDisplayName: Aidan
Body: <p>I want to replace a word. I was trying to insert using API3 but it is not working properly.</p>
  
  <blockquote>
    <p>Word replacement API3</p>
  </blockquote>
  
  <pre><code>$result = civicrm_api3('WordReplacement', 'create', [
    'find_word' =&gt; "Contacts",
    'replace_word' =&gt; "Data",
    'id' =&gt; 1,
  ]);
  </code></pre>
  
  <blockquote>
    <p>Output
        {</p>
  </blockquote>
  
  <pre><code>"is_error": 0,
  "version": 3,
  "count": 1,
  "id": 1,
  "values": {
      "1": {
          "id": "1",
          "find_word": "Contacts",
          "replace_word": "Data",
          "is_active": "",
          "match_type": "",
          "domain_id": "1"
      }
  }
  </code></pre>
  
  <p><hr>
  But the values are not stored in 'civicrm_word_replacement' table.
  Please give some suggestion.
  When I am trying to insert a value using custom php script then it is showing me a following error.</p>
  
  <pre><code>PHP Fatal error:  Uncaught Error: Call to undefined function _drupal_flush_css_js() in C:\xampp\htdocs\copy\sites\all\modules\civicrm\CRM\Utils\System\DrupalBase.php:300
  </code></pre>
  
Tags: <api><php>
Title: API problem regarding to Word Replacement
ThreadText: # API problem regarding to Word Replacement
  
  (Asked by: username_0 on 2019-03-05)
  
  I want to replace a word. I was trying to insert using API3 but it is not working properly.
  
  Word replacement API3
  
  $result = civicrm_api3('WordReplacement', 'create', [
    'find_word' => "Contacts",
    'replace_word' => "Data",
    'id' => 1,
  ]);
  
  
  Output
        {
  
  "is_error": 0,
  "version": 3,
  "count": 1,
  "id": 1,
  "values": {
      "1": {
          "id": "1",
          "find_word": "Contacts",
          "replace_word": "Data",
          "is_active": "",
          "match_type": "",
          "domain_id": "1"
      }
  }
  
  
  But the values are not stored in 'civicrm_word_replacement' table.
  Please give some suggestion.
  When I am trying to insert a value using custom php script then it is showing me a following error.
  PHP Fatal error:  Uncaught Error: Call to undefined function _drupal_flush_css_js() in C:\xampp\htdocs\copy\sites\all\modules\civicrm\CRM\Utils\System\DrupalBase.php:300
  
  **Tags:** api, php
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-04-04. Score: 1
  
  It looks like you are creating it disabled?
  
      "is_active": "",
  
  
  ---
  
  ### Answer by username_2 on 2019-03-05. Score: 1
  
  Your code includes `'id' => 1`
  
  `create` with an id is for updating an existing value. Do you already have a WordReplacement with id=1 ?
  
  If you are wanting to create a new one rather than update, just omit `'id' => 1`
  
  > **Comments:**
  > **username_0**: But I want to edit a values of id 1.  
  > **username_2**: Ok, that's not how I interpreted your question.  What output do you get from `cv api WordReplacement.get` ?  
  
  ---
  
  