Changes

Line 48: Line 48:     
= Replace an edit form with your own template =
 
= Replace an edit form with your own template =
{{ToComplete}}
+
Using your own edit form for a record saved using your own create form is as simple as adding a file called
 +
 
 +
'''/mymodule/canvas/mycanvas/tpl/tabname_edit.tpl'''
 +
 
 +
where
 +
* '''mymodule''' directory is value mymodule you used as canvas parameter to create record (see previous chapter).
 +
* '''mycanvas''' is value mycanvas you used as canvas parameter to create record (see previous chapter).
 +
* '''tabname''' is name of tab or page to edit record. In most cases it is value "card".
 +
 
 +
With our canvas demo societe@company, edit template will be into file
 +
 
 +
'''/societe/canvas/company/tpl/card_edit.tpl'''
 +
 
 +
Note that for edit, changing URL is not necessarly required. Dolibarr can detect your record is a personalized canvas record and automatically scan for this template file to show it if found. If not, standard form will be used. So all you have to do to use your own edit template is copy and paste an existing demo edit template file and rename it with correct value of mymodule and mycanvas and edit it.
 +
Like for creation, all mandatory fields must be kept to avoid errors when submitting the form to save change.
    
= Replace a view form with your own template =
 
= Replace a view form with your own template =