YetiForceCompany / YetiForceCRM

Our team created for you one of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!
https://yetiforce.com
Other
1.72k stars 742 forks source link

[Question] Invoke custom function: How to mysqli_connect() #12572

Closed LaurensCleyman closed 4 years ago

LaurensCleyman commented 4 years ago

Hi all,

I have create a custom function where I want to update records directly in the database, so without using the workflow 'Update fields'-option.

But, how do I fetch the connection details?

$con = mysqli_connect();
$sql = "UPDATE vtiger_contactdetails SET email= 'test@test.com' WHERE contactid = '116'";
return mysqli_query($con,$sql);
vovpff commented 4 years ago
$db = \App\Db::getInstance();
$db->createCommand('DROP TABLE IF EXISTS `a_vgdn`;')->execute();
mariuszkrzaczkowski commented 4 years ago

https://yetiforce.com/en/knowledge-base/documentation/developer-documentation/item/nowy-silnik-komunikacji-z-baza-danych

apcloic commented 4 years ago

@mariuszkrzaczkowski Is there any english version of this documentation ?

z0lo13 commented 4 years ago

@LaurensCleyman it is yii2 documention could be find here: https://www.yiiframework.com/doc/api/2.0/yii-db-activequery also the link above have some examples.

In addition your query is directly editing the db, however you can edit any record data with RecordModel you can search git for examples.

example: $recordModel->set('email',$email); $recordModel->save;

paula-w commented 4 years ago

@apcloic You can find the English version here: https://yetiforce.com/en/knowledge-base/documentation/developer-documentation/item/new-db-communication-engine