Dependency not working

Hello There,

I am facing dependency issue while using formulla builder for module . Below is the path of file : custom/Extension/modules/modulename/Ext/Dependencies

i am using below formulla in that file :

array(
'name' => 'SetRequired',
'params' => array(
'target' => 'namsa_bde_referred_c',
'value' => 'or(equal($id,""),and(isAfter($date_entered,date("2021-10-04")),equal($namsa_quote2_c,"Yes")))',
) ,
) ,

Somehow it's not working for me , Would anyone please help me to suggest any way to fix this.

Parents
  • - Which version of sugar are you using?

    - What type of field are we talking about?

    - Did you already put the formula inside a field in the studio to see if the formula is correct? 

    You can make fields required based on formula's for some time now on the latest releases. 

  • - Which version of sugar are you using?

    We check on both versions 10.3.0 and 11.1.0

    - What type of field are we talking about?

    formula is not working in any field we try Textbox,date,dropdown .

    - Did you already put the formula inside a field in the studio to see if the formula is correct?

    We can not use studio formula as id field is not acceptable in studio formula builder , and also we need that for newly created record thats why we have to use dependency via file instead of studio

  • So, from what I understand is that you want this dependency only to be run when it's a new record and the date entered is after a certain date and field namsa_quote2_c is yes. 

    Do you see the problem here? The date entered always today in a new record so the only thing you should check is to see if that field namsa_quote2_c is set to yes? 

  • I don't think that is quite right. When creating a new record the date_entered field will be blank, it will not set to today until after the Save has been actioned.

    It might be safer to test to see if that field is blank as part of the dependency. However, you are correct in that there is then no need to check for the id being blank as an empty date_entered would do the same check within the Create page.

    Using the above from Jeroen probably means you can use a simpler formula that works directly in the field in Studio - at least you should be able to test it there anyway.

    Good luck,

    JH.

  • we added a new filed namsa_bde_referred_c we want this filed is Required when namsa_quote2_c is yes and record after created 2021-10-04. on old record field should not Required.  if we added formula from studio  it's working for all records that we don't want.

Reply Children
No Data