findRelatedMany

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ednt
    Member
    • May 2022
    • 31

    findRelatedMany

    I just use the example for findRelatedMany in the sandbox Target Type "Account" and a Target which have a contact and get no result.

    Can some one explain what we do wrong ?

    Code:
    output\printLine('Start');

    $rec = record\findRelatedMany('Account',accountId,'contac ts',10);

    output\printLine($rec);​
  • lazovic
    Super Moderator
    • Jan 2022
    • 809

    #2
    Hi Ednt,

    When you run a script formula in Formula Sandbox with an Account Target Entity, consider that you are running the formula specifically for the Account entity.
    That is, in this case, you just need to use the id attribute (ID of your Account), not the accountId:

    record\findRelatedMany('Account', id, 'contacts', 10);

    Comment

    Working...