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? 

  • Yes 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 this field is not Required.

  • If you remove the id field and add a check on if the date_entered is blank it should work. So something like 

    and(
    or(
    equal($date_entered,""),
    isAfter($date_entered,date("2021-10-04"))
    )
    equal($namsa_quote2_c,"Yes"))

    p.s. I havent tested this.. 

  • Ok thanks i will try this. can you confirm same dependency work for Relate field.

    or(equal($id,""),and(isAfter($date_entered,date("2021-10-04")),or(equal(related($m01_sales_m03_work_product_1,"action_needed_c"),"NW"),equal(related($m01_sales_m03_work_product_1,"action_needed_c"),"Not Applicable"))))

    for relate field also not working

Reply
  • Ok thanks i will try this. can you confirm same dependency work for Relate field.

    or(equal($id,""),and(isAfter($date_entered,date("2021-10-04")),or(equal(related($m01_sales_m03_work_product_1,"action_needed_c"),"NW"),equal(related($m01_sales_m03_work_product_1,"action_needed_c"),"Not Applicable"))))

    for relate field also not working

Children