Formula Help of if then

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Nishan Perera
    replied
    I've solved the formula, this works perfectly. Thank you for your great support Maximus as always.

    Code:
    ifThen ([INDENT]datetime\month('supply_dispatch.createdAt') == datetime\month('datetime\today()'),[/INDENT][INDENT]totalIssue = entity\sumRelated('supplyDispatchs', 'supply_dispatch.dispatchingUnits')[/INDENT]
     
    
     );

    Leave a comment:


  • Nishan Perera
    replied
    Maximus Thank you for the reply. I tried given code and it doesn't work. But below code worked with datetime\today()

    Code:
    ifThen ([INDENT]datetime\today('supply_dispatch.createdAt') == datetime\today(datetime\today()) ,[/INDENT][INDENT]totalIssue = entity\sumRelated('supplyDispatchs', 'supply_dispatch.dispatchingUnits')[/INDENT]
     );

    What I want with this is to update totalIssue if supply_dispatch.createdAt on current month.

    Leave a comment:


  • Maximus
    replied
    Hi,
    try this:
    Code:
    ifThen (
        datetime\month(supply_dispatch.createdAt) == datetime\month(datetime\today()) ,
        totalIssue = entity\sumRelated('supplyDispatchs', 'supply_dispatch.dispatchingUnits')
    );

    Leave a comment:


  • shalmaxb
    replied
    Hi, I think the second argument is not right.
    Without knowing your relationship name I guess:

    - supplyDispatchs is the relationship Link name
    - in the second argument you only should insert the related field name, not the relationship name again, so in my opinion dispatchingUnits would be enough.

    Leave a comment:


  • Nishan Perera
    started a topic Formula Help of if then

    Formula Help of if then

    Hello,

    I'm trying to figure out below formula to work. Sum related formula is working perfectly. And with that I want to update the Sum Related record created on current month. So I tried with below formula and it didn't work.

    Code:
    ifThen (
    supply_dispatch.createdAt== datetime\month(),
    totalIssue = entity\sumRelated('supplyDispatchs', 'supply_dispatch.dispatchingUnits')
    );
    Appreciate your support to sort this matter.
Working...