Announcement

Collapse
No announcement yet.

record \ find syntax question

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

  • record \ find syntax question

    Hello together,

    for some testings I am using the ESPOCRM demo

    Inside this demo i've added a formula in fomula field to entitiy "account"

    $someVariableName='IDAccount';
    $IDAccount=accountId;
    $someVariableName='IDAuftrag';
    $IDAuftrag=record\findRelatedOne('Account',$IDAcco unt,'quotes','dateOrdered','desc');
    letzterAuftrag=record\attribute('Quote',$IDAuftrag ,'dateOrdered');


    "letzterAuftrag" is a new field created in account.

    Unfortunatley i do not what i did wrong, as it is not working. Currently it just shows no result

    What I want is to review all connected entities "Quote" for each "Account" and want to show on "Account" page the latest date when a customer did an order. so to show "dateOrder" out of "Quote"-Entity inside "Account"-Entity


  • #2
    Hi,

    Formula script is executed when target record (account in your case) is saved. For your requirement it won't work.

    You can use scheduled workflow that will run with interval, take all accounts (via specified report) and apply formula (with Update Target Record action).

    Comment


    • #3
      I know, that the script is just executed when the target record is saved, but even i update the target record manually i do not have any results.

      Comment


      • #4
        any Ideas?

        Comment


        • #5
          Hi Alexander,
          Do you have Advanced Pack? If so, I suggest you investigate the solution described by yurikuzn. Otherway you have to develop a custom hook for your purpose https://github.com/espocrm/documenta...pment/hooks.md.

          Comment

          Working...
          X