Condition Formula Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sapyantuk
    Senior Member
    • Oct 2020
    • 265

    Condition Formula Error

    How to write a condition formula

    i want to test if a field is linked with any records for certain entity or not linked



    If File management is Not Linked or emply the avaiable status should be Availabe and if file management is linked or not emply the available status should be not available

    Attached Files
  • sapyantuk
    Senior Member
    • Oct 2020
    • 265

    #2
    Someone Please Respond

    Comment

    • eymen-elkum
      Active Community Member
      • Nov 2014
      • 472

      #3
      This must be easy, just make sure to use the correct field name in the ifThen function:



      I think the field name is filesManagementsId, you can easily pick it from the + button

      ifThen(filesManagementsId, do any thing here);
      CEO of Eblasoft
      EspoCRM Expert since 2014
      Full Stack Web Developer since 2008
      Creator of Numerous Successful Extensions & Projects​

      Comment


      • sapyantuk
        sapyantuk commented
        Editing a comment
        I tried with this code:



        ifThenElse(
        fileManagementsIds != null,
        status = 'Not Available');
        ifThen(
        fileManagementsIds == null,
        status = 'Available');



        But it is only producing Not Available Option
    • sapyantuk
      Senior Member
      • Oct 2020
      • 265

      #4
      I tried but its not working

      ifThenElse(
      fileManagementsNames != null,
      status = 'Not Available'
      ifThen(
      fileManagementsNames == null,
      status = 'Available')
      )

      Comment


      • eymen-elkum
        eymen-elkum commented
        Editing a comment
        In condition use == instead of =
        This is important!!

      • eymen-elkum
        eymen-elkum commented
        Editing a comment
        what is the link type
        one to many or many to many ?

      • sapyantuk
        sapyantuk commented
        Editing a comment
        I tried with This one
        I tied with This one



        ifThenElse(
        fileManagementsIds != null,
        status = 'Not Available';
        ifThen(
        fileManagementsIds == null,
        status = 'Available')
        )

        Link Type Is One to Many
    • sapyantuk
      Senior Member
      • Oct 2020
      • 265

      #5
      I tried with This one
      I tied with This one



      ifThenElse(
      fileManagementsIds != null,
      status = 'Not Available';
      ifThen(
      fileManagementsIds == null,
      status = 'Available')
      )

      Link Type Is One to Many

      Comment

      • eymen-elkum
        Active Community Member
        • Nov 2014
        • 472

        #6
        sapyantuk please share here the worked formula, so other users can get benifit
        CEO of Eblasoft
        EspoCRM Expert since 2014
        Full Stack Web Developer since 2008
        Creator of Numerous Successful Extensions & Projects​

        Comment

        • sapyantuk
          Senior Member
          • Oct 2020
          • 265

          #7
          eymen-elkum Thank you so much for helping me ..

          Working Formulas

          ifThen(
          array\length(fileManagementsIds) == 0,
          status = 'Available'
          );

          ifThen(
          array\length(fileManagementsIds) > 0,
          status = 'Not Available'
          );

          // status = entity\countRelated('fileManagements');

          Comment

          Working...