12-21-2015, 11:50 AM
(12-21-2015, 10:55 AM)Guido1982 Wrote: So basically every record in the system has to have an assigned user? That means I have to create this field, always for every custom module?
Yes. There are 4 fields that should almost always be created on all modules although they are really in the vtiger_crmentity table. You can see these four in the default manifest.xml file:
https://github.com/tsolucio/corebos/blob/master/vtlib/ModuleDir/manifest.xml#L65
assigned user, created time, modified time and description
(12-21-2015, 10:55 AM)Guido1982 Wrote: I see you use REQUEST in your example. Since this is a collection of all the superglobals, I guess this is a post variable?
It is a POST variable when creating records using the application. If you are creating them by code, you have to "artificially" fill in the variable so the save process thinks it is being called from the web interface.
(12-21-2015, 10:55 AM)Guido1982 Wrote: I see you have made a custom Save.php file here (mine, from the Payslip tutorial just contains an inclusion of the stock vTiger Save.php file). If I understand correctly, the 'focus' object is a temporary representation of the entity you are saving right?
Note that the code I linked is just an example, your code will be different and has nothing to do with the Save.php file. The Save.php file is called ONLY from the application web interface, if you are creating records with your own code it will NOT get called.
$focus is the object you are saving.
(12-21-2015, 10:55 AM)Guido1982 Wrote: Will everything in the module's Save.php file be executed before the system actually saves the record?
Absolutely not. When your code calls the save() method, there will be no reference to the Save.php file.
Joe
TSolucio
TSolucio