Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can we hide fields ONLY when creating a record?
#1
I would like to hide some fields when creating a record, that are not specifically hidden or inaccessible, but I would like to hide them ONLY when creating records. Do we even have that functionality?
Reply
#2
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.p...dependency
Joe
TSolucio
Reply
#3
Nice, seems very powerful. Let me try that and get back to you
Reply
#4
(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.p...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?
Reply
#5
(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.p...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
Reply
#6
Thanks, I'll try that and let you know. About the columname syntax, I'm guessing that's advanced filtering syntax? Is there any documentation about that Joe?
Reply
#7
try here: http://corebos.com/documentation/doku.ph...onal_popup
Joe
TSolucio
Reply
#8
Thanks!
Reply
#9
Just for anyone curious:
PHP Code:
<map>
    <
originmodule>
        <
originname>Assets</originname>
    </
originmodule>
    <
dependencies>
        <
dependency>
            <
field>asset_no</field>
            <
condition>
                [{
                    
"groupid""",
                    
"columnname""vtiger_assets:assetname:assetname:Assets_Asset_Name:V",
                    
"comparator" "e",
                    
"value""",
                    
"columncondition"""
                
}]
            </
condition>
            <
actions>
                <
hide>
                    <
field>cf_1440</field>
                </
hide>
            </
actions>
        </
dependency>
    </
dependencies>
</
map

The above map will hide the "cf_1440" (obviously change it with you own) only when creating a new asset.
Reply
#10
Good!
Ranieri
eCRM Web
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)