Edit a custom field in netsuite using PHP toolkit - php

I see a bunch of examples of how to add a new order however I'm trying to update a custom field of an existing order using the PHP toolkit. Could anyone start me out with this? I'm not sure where to start.
This is the code to add a new order
<?php
require_once '../PHPToolkit/NetSuiteService.php';
$service = new NetSuiteService();
$svr = new getSelectValueRequest();
$svr->fieldDescription = new GetSelectValueFieldDescription();
$svr->pageIndex = 1;
$priceFields = array(
'recordType' => RecordType::salesOrder,
'sublist' => 'itemList',
'field' => 'price',
'filterByValueList' => array(
'filterBy' => array(
array(
'field' => 'item',
'sublist' => 'itemList',
'internalId' => '458',
)
)
)
);
if ($id != null) {
echo "Custom price level id is " . $id . "\n";
} else {
echo "Custom price level not found " . $id . "\n";
}
$so = new SalesOrder();
$so->entity = new RecordRef();
$so->entity->internalId = 21;
$so->itemList = new SalesOrderItemList();
$soi = new SalesOrderItem();
$soi->item = new RecordRef();
$soi->item->internalId = 104;
$soi->quantity = 3;
$soi->price = new RecordRef();
$soi->price->internalId = $id;
$soi->amount = 55.3;
$so->itemList->item = array($soi);
$request = new AddRequest();
$request->record = $so;
$addResponse = $service->add($request);
if (!$addResponse->writeResponse->status->isSuccess) {
echo "ADD ERROR";
exit();
} else {
echo "ADD SUCCESS, id " . $addResponse->writeResponse->baseRef->internalId;
}
?>

You'll need a customFieldList object, which is an array of custom fields. There are different objects for the different data types of custom fields - below would be a string custom field. I utf8_encode to deal with weird characters that you normally don't see.
$customFieldList = new CustomFieldList();
$customField = new StringCustomFieldRef();
$customField->value = utf8_encode("contents of string custom field");
$customField->internalId = 'custbody_whatever_your_field_is';
$customFieldList->customField[] = $customField;
$so->customFieldList = $customFieldList;

Related

How can i export & Import custom modules as Package using PHP Script (Vtlib Function) from my CRM vtiger 7

I hope all of you are doing well.
I have created a custom module used this script.we have run this script in root folder.All field are working fine and list view also perfect.
```
<?php
include_once 'vtlib/Vtiger/Module.php';
include_once 'vtlib/Vtiger/Package.php';
include_once 'includes/main/WebUI.php';
include_once 'include/Webservices/Utils.php';
$Vtiger_Utils_Log = true;
$MODULENAME = 'Laptop';
$moduleInstance = Vtiger_Module::getInstance($MODULENAME);
if ($moduleInstance || file_exists('modules/'.$MODULENAME)) {
echo "Module already present - choose a different name.";
} else {
$moduleInstance = new Vtiger_Module();
$moduleInstance->name = $MODULENAME;
$moduleInstance->parent= 'Tools';
$moduleInstance->save();
// Schema Setup
$moduleInstance->initTables();
// Field Setup
$block = new Vtiger_Block();
$block->label = 'LBL_'. strtoupper($moduleInstance->name) . '_INFORMATION';
$moduleInstance->addBlock($block);
$blockcf = new Vtiger_Block();
$blockcf->label = 'LBL_CUSTOM_INFORMATION';
$moduleInstance->addBlock($blockcf);
// Text Area1 Item_Name
$itemName = new Vtiger_Field();
$itemName->name = 'itemname';
$itemName->label= 'Item Name';
$itemName->uitype= 1;
$itemName->column = $itemName->name;
$itemName->columntype = 'VARCHAR(100)';
$itemName->typeofdata = 'V~M';
$block->addField($itemName);
// Text Area2 Item_Deatils
$itemdeatils = new Vtiger_Field();
$itemdeatils->name = 'itemdeatils';
$itemdeatils->label= 'Item Deatils';
$itemdeatils->uitype= 1;
$itemdeatils->column = $itemdeatils->name;
$itemdeatils->columntype = 'VARCHAR(100)';
$itemdeatils->typeofdata = 'V~O';
$block->addField($itemdeatils);
$moduleInstance->setEntityIdentifier($itemdeatils);
// Text Area3 Item_Company.
$companyname = new Vtiger_Field();
$companyname->name = 'companyname';
$companyname->label= 'Company Name.';
$companyname->uitype= 15;
$companyname->column = $companyname->name;
$companyname->columntype = 'VARCHAR(100)';
$companyname->typeofdata = 'V~O';
$block->addField($companyname);
$companyname->setPicklistValues( Array ('Sumsung','HP','Dell', 'Lenovo','Apple') );
$description = new Vtiger_Field();
$description->name = 'description';
$description->label= 'Description';
$description->uitype= 19;
$description->column = 'description';
$description->table = 'vtiger_crmentity';
$blockcf->addField($description);
// Recommended common fields every Entity module should have (linked to core table)
$mfield1 = new Vtiger_Field();
$mfield1->name = 'assigned_user_id';
$mfield1->label = 'Assigned To';
$mfield1->table = 'vtiger_crmentity';
$mfield1->column = 'smownerid';
$mfield1->uitype = 53;
$mfield1->typeofdata = 'V~M';
$block->addField($mfield1);
$mfield2 = new Vtiger_Field();
$mfield2->name = 'createdtime';
$mfield2->label= 'Created Time';
$mfield2->table = 'vtiger_crmentity';
$mfield2->column = 'createdtime';
$mfield2->uitype = 70;
$mfield2->typeofdata = 'DT~O';
$mfield2->displaytype= 2;
$block->addField($mfield2);
$mfield3 = new Vtiger_Field();
$mfield3->name = 'modifiedtime';
$mfield3->label= 'Modified Time';
$mfield3->table = 'vtiger_crmentity';
$mfield3->column = 'modifiedtime';
$mfield3->uitype = 70;
$mfield3->typeofdata = 'DT~O';
$mfield3->displaytype= 2;
$block->addField($mfield3);
/* NOTE: Vtiger 7.1.0 onwards */
$mfield4 = new Vtiger_Field();
$mfield4->name = 'source';
$mfield4->label = 'Source';
$mfield4->table = 'vtiger_crmentity';
$mfield4->displaytype = 2; // to disable field in Edit View
$mfield4->quickcreate = 3;
$mfield4->masseditable = 0;
$block->addField($mfield4);
$mfield5 = new Vtiger_Field();
$mfield5->name = 'starred';
$mfield5->label = 'starred';
$mfield5->table = 'vtiger_crmentity_user_field';
$mfield5->displaytype = 6;
$mfield5->uitype = 56;
$mfield5->typeofdata = 'C~O';
$mfield5->quickcreate = 3;
$mfield5->masseditable = 0;
$block->addField($mfield5);
$mfield6 = new Vtiger_Field();
$mfield6->name = 'tags';
$mfield6->label = 'tags';
$mfield6->displaytype = 6;
$mfield6->columntype = 'VARCHAR(1)';
$mfield6->quickcreate = 3;
$mfield6->masseditable = 0;
$block->addField($mfield6);
/* End 7.1.0 */
// Filter Setup
$filter1 = new Vtiger_Filter();
$filter1->name = 'All';
$filter1->isdefault = true;
$moduleInstance->addFilter($filter1);
$filter1->addField($itemName);
$filter1->addField($itemdeatils, 1);
$filter1->addField($companyname, 2);
$filter1->addField($mfield1, 3);
// Sharing Access Setup
$moduleInstance->setDefaultSharing('Private');
// Webservice Setup
$moduleInstance->initWebservice();
$targetpath = 'modules/' . $moduleInstance->name;
if (! is_file($targetpath)) {
mkdir($targetpath);
$templatepath = 'vtlib/ModuleDir/6.0.0';
$moduleFileContents = file_get_contents($templatepath . '/ModuleName.php');
$replacevars = array(
'ModuleName' => $moduleInstance->name,
'<modulename>' => strtolower($moduleInstance->name),
'<entityfieldlabel>' => $field1->label,
'<entitycolumn>' => $field1->column,
'<entityfieldname>' => $field1->name
);
foreach ($replacevars as $key => $value) {
$moduleFileContents = str_replace($key, $value, $moduleFileContents);
}
file_put_contents
($targetpath . '/' . $moduleInstance->name . '.php',$moduleFileContents);
}
if (! file_exists('languages/en_us/ModuleName.php')) {
$ModuleLanguageContents = file_get_contents
($templatepath . '/languages/en_us /ModuleName.php');
$replaceparams = array(
'Module Name' => $moduleInstance->name,
'Custom' => $moduleInstance->name,
'ModuleBlock' => $moduleInstance->name,
'ModuleFieldLabel Text' => $field1->label
);
foreach ($replaceparams as $key => $value) {
$ModuleLanguageContents = str_replace($key, $value, $ModuleLanguageContents);
}
$languagePath = 'languages/en_us';
file_put_contents
($languagePath . '/' . $moduleInstance->name . '.php',$ModuleLanguageContents);
}
}
Settings_MenuEditor_Module_Model::addModuleToApp
($moduleInstance->name, $moduleInstance->parent);
?>
```
how can i export & Import custom modules as Package using PHP Script (Vtlib Function) from my CRM vtiger 7, Please help me.
I was stuck on How to create a custom module in Vtiger using VTlib library. The code you shared is perfect for creating custom module in vtiger.
To Export your custom module in vtiger, you need to run the code below -
require_once('vtlib/Vtiger/Package.php');
require_once('vtlib/Vtiger/Module.php');
$package = new Vtiger_Package();
$package->export(
Vtiger_Module::getInstance('Payslip'),
'test/vtlib',
'Payslip-Export.zip',
true
);
Don't forget to change the module name

Drupal 7, validate node as per interface

I created a webservice, it works correctly, I was doing the node creation operation and it works correctly.
I need to validate the node I'm about to save in the same way it is validated during the interface insertion form.
I have tried with
drupal_form_submit($nodeType . '_node_form', $form_state, (object) $node);
it keeps giving me errors its node reference fields
Could you suggest other ways to do the same validation that is done by the interface on a programmatically created node?
The error on the node reference field is:
" field_ente : this entry cannot be
referenced. "
The node (6310) exists correctly and if I try to do the node_save, it is saved correctly
the complete function is as follows
function my_ws_resource_create($field_nome = '', $field_cognome = '', $field_codice_fiscale = '', $field_data_di_nascita = '', $field_ente= '')
{
module_load_include('inc', 'node', 'node.pages');
global $user;
$nodeType = 'contatti';
$node = new stdClass();
$node->type = $nodeType;
$node->uid = $user->uid;
$node->status = 1;
$node->revision = 1;
$node->promote = 0;
$node->comment = 0;
node_object_prepare($node);
$node->field_cognome['und'][0]['value'] = $field_cognome;
$node->field_nome['und'][0]['value'] = $field_nome;
$node->field_codice_fiscale['und'][0]['cck_codicefiscale'] = $field_codice_fiscale;
$node->field_data_di_nascita['und'][0]['value'] = $field_data_di_nascita;
$node->field_categoria_contatto['und'][0]['tid'] = '66';
// $node->field_ente = array('und' => array(array('nid'=> $field_ente )));
// this field causes the error
$node->field_ente = array('und' => array(array('nid'=> '6310')));
$node->field_simplenews_term['it'][0]['tid'] = '13660';
$form_state = array();
$form_state['values']['type'] = $nodeType;
$form_state['values']['name'] = $user->name;
$form_state['values']['status'] = 1;
$form_state['values']['promote'] = 1;
$form_state['values']['sticky'] = 0;
$form_state['values']['op'] = t('Save');
drupal_form_submit($nodeType . '_node_form', $form_state, (object) $node);
if ($errors = form_get_errors()) {
return services_error(implode(" ", $errors), 406, array('form_errors' => $errors));
}
return 'Creation successful';
}
I've had success with the following (remove $form_state and replace drupal_form_submit):
if ($node = node_submit($node)) {
node_save($node);
// Success!
}
else {
// Fail :(
}

How to post an event directly to another user's calendar

i want To post an event directly to another user's calendar with jamesiarmes/php-ews but in example i have find only how to make it with invitation.
I have admin account so i can write in athers user's post calendar directly.
i don't understant a lot because i'm new in ews so thx for any help.
// Replace this with your desired start/end times and guests.
$start = new DateTime('tomorrow 4:00pm');
$end = new DateTime('tomorrow 5:00pm');
$guests = array(
array(
'name' => 'Homer Simpson',
'email' => 'hsimpson#example.com',
),
array(
'name' => 'Marge Simpson',
'email' => 'msimpson#example.com',
),
);
// Set connection information.
$host = '';
$username = '';
$password = '';
$version = Client::VERSION_2016;
$client = new Client($host, $username, $password, $version);
// Build the request,
$request = new CreateItemType();
$request->SendMeetingInvitations = CalendarItemCreateOrDeleteOperationType::SEND_ONLY_TO_ALL;
$request->Items = new NonEmptyArrayOfAllItemsType();
// Build the event to be added.
$event = new CalendarItemType();
$event->RequiredAttendees = new NonEmptyArrayOfAttendeesType();
$event->Start = $start->format('c');
$event->End = $end->format('c');
$event->Subject = 'EWS Test Event';
// Set the event body.
$event->Body = new BodyType();
$event->Body->_ = 'This is the event body';
$event->Body->BodyType = BodyTypeType::TEXT;
// Iterate over the guests, adding each as an attendee to the request.
foreach ($guests as $guest) {
$attendee = new AttendeeType();
$attendee->Mailbox = new EmailAddressType();
$attendee->Mailbox->EmailAddress = $guest['email'];
$attendee->Mailbox->Name = $guest['name'];
$attendee->Mailbox->RoutingType = RoutingType::SMTP;
$event->RequiredAttendees->Attendee[] = $attendee;
}
// Add the event to the request. You could add multiple events to create more
// than one in a single request.
$request->Items->CalendarItem[] = $event;
$response = $client->CreateItem($request);
// Iterate over the results, printing any error messages or event ids.
$response_messages = $response->ResponseMessages->CreateItemResponseMessage;
foreach ($response_messages as $response_message) {
// Make sure the request succeeded.
if ($response_message->ResponseClass != ResponseClassType::SUCCESS) {
$code = $response_message->ResponseCode;
$message = $response_message->MessageText;
fwrite(STDERR, "Event failed to create with \"$code: $message\"\n");
continue;
}
// Iterate over the created events, printing the id for each.
foreach ($response_message->Items->CalendarItem as $item) {
$id = $item->ItemId->Id;
fwrite(STDOUT, "Created event $id\n");
}
}
You define the attendees but miss the account where you want to create the event in:add this code before the $response
...
$request->Items->CalendarItem[] = $event;
//following lines are missing
$lsEmail = 'some#email.de';
$request->SavedItemFolderId = new TargetFolderIdType();
$request->SavedItemFolderId->DistinguishedFolderId = new DistinguishedFolderIdType();
$request->SavedItemFolderId->DistinguishedFolderId->Id = self::DISTINGUISHED_FOLDER_ID;
$request->SavedItemFolderId->DistinguishedFolderId->Mailbox = new EmailAddressType();
$request->SavedItemFolderId->DistinguishedFolderId->Mailbox->EmailAddress = $lsEmail;
// here your code continues
$response = $client->CreateItem($request);
...

Paypal Merchant SDK with Laravel

I am trying to create paypal recurring payment profile but i am facing this error
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'RecurringPaymentsProfileDetailsType' not found","file":"/home/test/public_html/payment/app/models/payment/Purchase.php","line":7}}
my code
<?php
class Purchase extends Eloquent
{
public static function submit($name, $email, $ccNumber, $pinCode, $expiryDate)
{
$profileDetails = new RecurringPaymentsProfileDetailsType();
$profileDetails->BillingStartDate = "2014-11-17T00:00:00:000Z";
$paymentBillingPeriod = new BillingPeriodDetailsType();
$paymentBillingPeriod->BillingFrequency = 30;
$paymentBillingPeriod->BillingPeriod = "Day";
$paymentBillingPeriod->Amount = new BasicAmountType("USD", "1.0");
$scheduleDetails = new ScheduleDetailsType();
$scheduleDetails->Description = "recurring billing";
$scheduleDetails->PaymentPeriod = $paymentBillingPeriod;
$createRPProfileRequestDetails = new CreateRecurringPaymentsProfileRequestDetailsType();
$creditCard = new CreditCardDetailsType();
$creditCard->CreditCardNumber = "4032034992341100";
$creditCard->CreditCardType = "Visa";
$creditCard->CVV2 = "962";
$creditCard->ExpMonth = 11;
$creditCard->ExpYear = 2019;
$createRPProfileRequestDetails->CreditCard = $creditCard;
$createRPProfileRequestDetails->ScheduleDetails = $scheduleDetails;
$createRPProfileRequestDetails->RecurringPaymentsProfileDetails = $profileDetails;
$createRPProfileRequest = new CreateRecurringPaymentsProfileRequestType();
$createRPProfileRequest->CreateRecurringPaymentsProfileRequestDetails = $createRPProfileRequestDetails;
$createRPProfileReq = new CreateRecurringPaymentsProfileReq();
$createRPProfileReq->CreateRecurringPaymentsProfileRequest = $createRPProfileRequest;
$config = array (
'mode' => Config::get('paypal.mode') ,
'acct1.UserName' => Config::get('paypal.username'),
'acct1.Password' => Config::get('paypal.password'),
'acct1.Signature' => Config::get('paypal.signature')
);
$paypalService = new PayPalAPIInterfaceServiceService($config);
$createRPProfileResponse = $paypalService->CreateRecurringPaymentsProfile($createRPProfileReq);
die($createRPProfileResponse);
}
}
?>

Creating custom module in Vtiger CRM from scratch with table

I am new to Vtiger CRM and I have searched a lot to find how to create a custom module in Vtiger CRM with a table associated with it from scratch. I am not able to follow the documentation provided by Vtiger.
Refer this url for Creating New module and fields.
https://wiki.vtiger.com/index.php/CreatingEntityModule
Or if you having any problem then follow as per instructions.
first of all do this.
First create a new folder(module name without space) in modules and copy files from vtlib/ModuleDir/5.4.0 file to the folder created in modules/newmodule
Change name of ModuleFile.js, ModuleFile.php, ModuleFileAjax.php with your module name(with no space).
Keep in mind, During changing name of ModuleFileAjax.php just Replace ModuleFile with name of Module.
Go to modulename.php to change the class name, $table_name (6values change), $table_index (4values change).
Create new file with any name. Insert the code below to add the fields and also module.
<?php
// Turn on debugging level
$Vtiger_Utils_Log = true;
include_once('vtlib/Vtiger/Menu.php');
include_once('vtlib/Vtiger/Module.php');
$module = new Vtiger_Module();
$module->name = 'Store';//(No space in module name)
$module->save();
$module->initTables();
$module->initWebservice();
$menu = Vtiger_Menu::getInstance('Support');
$menu->addModule($module);
$block1 = new Vtiger_Block();
$block1->label = 'Organization Information';
$module->addBlock($block1); //to create a new block
$field0 = new Vtiger_Field();
$field0->name = 'organization_name';
$field0->label = 'Organization Name';
$field0->table = $module->basetable;
$field0->column = 'organization_name';
$field0->columntype = 'VARCHAR(100)';
$field0->uitype = 2;
$field0->typeofdata = 'V~M';
$module->setEntityIdentifier($field0); //to insert values in entity folder
$block1->addField($field0); //to add field in block
$field1 = new Vtiger_Field();
$field1->name = 'store_id_auto';
$field1->label = 'Store ID';
$field1->table = $module->basetable;
$field1->column = 'store_id_auto';
$field1->columntype = 'VARCHAR(100)';
$field1->uitype = 4;
$field1->typeofdata = 'V~O';
$block1->addField($field1);
//Do not change any value for filed2.
$field2 = new Vtiger_Field();
$field2->name = 'assigned_user_id';
$field2->label = 'Assigned To';
$field2->table = 'vtiger_crmentity';
$field2->column = 'smownerid';
$field2->columntype = 'int(19)';
$field2->uitype = 53;
$field2->typeofdata = 'V~M';
$block1->addField($field2);
$filter1 = new Vtiger_Filter();
$filter1->name = 'All';
$filter1->isdefault = true;
$module->addFilter($filter1);
// Add fields to the filter created
$filter1->addField($field0, 1);
$filter1->addField($field1, 2);
$filter1->addField($field2, 3);
/** Set sharing access of this module */
$module->setDefaultSharing('Private');
/** Enable and Disable available tools */
$module->enableTools(Array('Import', 'Export'));
$module->disableTools('Merge');
?>
we have Create Store module
Create folder in modules/Store and also create Store.php file in Store folder
modules/Store/Store.php
include_once 'modules/Vtiger/CRMEntity.php';
class Store extends Vtiger_CRMEntity {
var $table_name = 'vtiger_store';
var $table_index= 'storeid';
var $customFieldTable = Array('vtiger_storecf', 'storeid');
var $tab_name = Array('vtiger_crmentity', 'vtiger_store', 'vtiger_storecf');
var $tab_name_index = Array(
'vtiger_crmentity' => 'crmid',
'vtiger_store' => 'storeid',
'vtiger_storecf'=>'storeid');
var $list_fields = Array (
/* Format: Field Label => Array(tablename, columnname) */
// tablename should not have prefix 'vtiger_'
'Organization Name' => Array('store', 'organization_name'),
'Assigned To' => Array('crmentity','smownerid')
);
var $list_fields_name = Array (
/* Format: Field Label => fieldname */
'Organization Name' => 'organization_name',
'Assigned To' => 'assigned_user_id',
);
// Make the field link to detail view
var $list_link_field = 'organization_name';
// For Popup listview and UI type support
var $search_fields = Array(
/* Format: Field Label => Array(tablename, columnname) */
// tablename should not have prefix 'vtiger_'
'Organization Name' => Array('store', 'organization_name'),
'Assigned To' => Array('vtiger_crmentity','assigned_user_id'),
);
var $search_fields_name = Array (
/* Format: Field Label => fieldname */
'Organization Name' => 'organization_name',
'Assigned To' => 'assigned_user_id',
);
// For Popup window record selection
var $popup_fields = Array ('organization_name');
// For Alphabetical search
var $def_basicsearch_col = 'organization_name';
// Column value to use on detail view record text display
var $def_detailview_recname = 'organization_name';
// Used when enabling/disabling the mandatory fields for the module.
// Refers to vtiger_field.fieldname values.
var $mandatory_fields = Array('organization_name','assigned_user_id');
var $default_order_by = 'organization_name';
var $default_sort_order='ASC';
}
Create languages/en_us/Store.php
<?php
$languageStrings = array(
'SINGLE_Store'=>'Store'
);
?>
Create file /var/www/html/Projectname/Store.php and run this file
<?php
// Turn on debugging level
$Vtiger_Utils_Log = true;
include_once('vtlib/Vtiger/Menu.php');
include_once('vtlib/Vtiger/Module.php');
$module = new Vtiger_Module();
$module->name = 'Store';//(No space in module name)
$module->save();
$module->initTables();
$module->initWebservice();
$menu = Vtiger_Menu::getInstance('Support');
$menu->addModule($module);
$block1 = new Vtiger_Block();
$block1->label = 'Organization Information';
$module->addBlock($block1); //to create a new block
$field0 = new Vtiger_Field();
$field0->name = 'organization_name';
$field0->label = 'Organization Name';
$field0->table = $module->basetable;
$field0->column = 'organization_name';
$field0->columntype = 'VARCHAR(100)';
$field0->uitype = 2;
$field0->typeofdata = 'V~M';
$module->setEntityIdentifier($field0); //to insert values in entity folder
$block1->addField($field0); //to add field in block
$field1 = new Vtiger_Field();
$field1->name = 'store_id_auto';
$field1->label = 'Store ID';
$field1->table = $module->basetable;
$field1->column = 'store_id_auto';
$field1->columntype = 'VARCHAR(100)';
$field1->uitype = 4;
$field1->typeofdata = 'V~O';
$block1->addField($field1);
//Do not change any value for filed2.
$field2 = new Vtiger_Field();
$field2->name = 'assigned_user_id';
$field2->label = 'Assigned To';
$field2->table = 'vtiger_crmentity';
$field2->column = 'smownerid';
$field2->columntype = 'int(19)';
$field2->uitype = 53;
$field2->typeofdata = 'V~M';
$block1->addField($field2);
$field3 = new Vtiger_Field();
$field3->name = 'CreatedTime';
$field3->label= 'Created Time';
$field3->table = 'vtiger_crmentity';
$field3->column = 'createdtime';
$field3->uitype = 70;
$field3->typeofdata = 'T~O';
$field3->displaytype= 2;
$block->addField($field3);
$field4 = new Vtiger_Field();
$field4->name = 'ModifiedTime';
$field4->label= 'Modified Time';
$field4->table = 'vtiger_crmentity';
$field4->column = 'modifiedtime';
$field4->uitype = 70;
$field4->typeofdata = 'T~O';
$field4->displaytype= 2;
$block->addField($field4);
$filter1 = new Vtiger_Filter();
$filter1->name = 'All';
$filter1->isdefault = true;
$module->addFilter($filter1);
// Add fields to the filter created
$filter1->addField($field0, 1);
$filter1->addField($field1, 2);
$filter1->addField($field2, 3);
/** Set sharing access of this module */
$module->setDefaultSharing('Private');
/** Enable and Disable available tools */
$module->enableTools(Array('Import', 'Export'));
$module->disableTools('Merge');
?>

Categories