Announcement

Collapse
No announcement yet.

Condition Formula Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    Someone Please Respond

    Comment


    • #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 & Founder of Eblasoft.
      Professional EspoCRM development & extensions.

      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

    • #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

    • #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


      • #6
        sapyantuk please share here the worked formula, so other users can get benifit
        CEO & Founder of Eblasoft.
        Professional EspoCRM development & extensions.

        Comment


        • #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...
          X