Edit custom field value inside "commerce_orders.onBeforeSaveOrder" event I would like to edit custom Lightswitch field value to true inside of event on order save

          $order = $event-&gt;params["order"];
          $order-&gt;setContentFromPost(array(
              'ediCheck' =&gt; true,
          ));

          $order-&gt;getContent()-&gt;setAttributes(array(
              'ediCheck' =&gt; true,
          ));


Tried following but the value still stays the same.

Also If there is an documentation file on following that I maybe missed would also be helpful.
That looks right, but I think you may need to set the value of that field to '1' - looking in the craft_content table, it seems switches are stored as 0 and 1.

      $order = $event-&gt;params["order"];
      $order-&gt;setContentFromPost(array(
          'ediCheck' =&gt; 1,
      ));


If that still doesn't work, try throwing in a craft()-&gt;commerce_orders-&gt;saveOrder($order); at the end of your function.  It shouldn't be needed though as it should fall through to the saveOrder it's going to do anyway....