05-28-2019, 10:53 AM
(05-27-2019, 12:22 PM)Guido1982 Wrote:(05-16-2019, 10:15 PM)joebordes Wrote: I would say that this can be done with a field dependency map. The condition would be based on the getCRUDMode function to detect if you are creating/editing and hide the field accordingly
https://corebos.com/documentation/doku.php?id=en:adminmanual:businessmappings:field_dependency
I've been reading the docs, but can't understand how I should format the condition so that the map kicks in when I am creating an asset, regardless of the source module, if any. Could you get me started on that?
Hello,
getCRUDMode function for the moment is used only for Validations Map, not for FDep.
But, I would suggest you to create a condition in your Field Depencency Map based on a field which has always a default value or is empty in CreateView or another possibility would be to hide them by default and show them once another field is filled after save. That would be the autonumbering field for example which is not even visible in create view. I haven't tested this case yet, but you can try it.
For example:
<map>
<originmodule>
<originname>Assets</originname>
</originmodule>
<dependencies>
<dependency>
<field>amount</field>
<condition>[{"groupid":"",
"columnname":"vtiger_assets:asset_no:asset_no:Assets_Asset No:V",
"comparator":"e",
"value":" ",
"columncondition":""}]
</condition>
<actions>
<hide>
<field>shippingmethod</field>
</hide>
</actions>
</dependency>
</dependencies>
</map>
Let me know if it works or you need something else
Regards
Elisa