Hi everybody, was hoping somebody can help me with findRelatedOne issue I'm facing.
I have 3 entities:
Account, Rentalobject, Transactions
I'm writing a formula for the Transaction entity, that has both Account and Rentalobjects linked to it.
My end goal is when within Transaction records, I select an Account that it relates to, it then executes:
I'm having issues with "findRelatedOne" to get the $rentalid
I can't seem to understand how exactly this formula works.
In non-formula language what I want is:
When I create a Transaction record, and within it specify that this transaction is made by Account lets say "Alex"
I want the formula to assign a Rentalobject field to the Rentalobject that Alex has assigned in his Account entity.
What my current formula looks like:
I know for a fact that $accname tells me the right Name, so lets say "Alex".
I also know that the record\relate also works (I replaced $relid with the actual Id - and it did what I'm trying to achieve)
So my issue is with the findRelatedOne, I don't understand its structure despite looking and the Formula FAQ and other forum posts.
Can't understand which part of it am I getting wrong, will appreciate any help. My current version of findRelatedOne does not work
I have 3 entities:
Account, Rentalobject, Transactions
I'm writing a formula for the Transaction entity, that has both Account and Rentalobjects linked to it.
My end goal is when within Transaction records, I select an Account that it relates to, it then executes:
Code:
record\relate('Rentalobject', '$rentalid', 'transactions', $accid);
I can't seem to understand how exactly this formula works.
In non-formula language what I want is:
When I create a Transaction record, and within it specify that this transaction is made by Account lets say "Alex"
I want the formula to assign a Rentalobject field to the Rentalobject that Alex has assigned in his Account entity.
What my current formula looks like:
Code:
$accname = accountName; $relid = record\findRelatedOne('Rentalobject', RentalobjectId, 'Account', 'name=', $accname); $accid = id; record\relate('Rentalobject', '$relid', 'transactions', $accid);
I know for a fact that $accname tells me the right Name, so lets say "Alex".
I also know that the record\relate also works (I replaced $relid with the actual Id - and it did what I'm trying to achieve)
So my issue is with the findRelatedOne, I don't understand its structure despite looking and the Formula FAQ and other forum posts.
Can't understand which part of it am I getting wrong, will appreciate any help. My current version of findRelatedOne does not work
Comment