Announcement

Collapse
No announcement yet.

HELP Request - Document Relationship to Case/Account

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

  • telecastg
    replied
    For autofill you need to use dynamic handler. Formula is a user-friendly implementation of a back-end hook so any changes will not be implemented until the record is updated.

    Leave a comment:


  • esforim
    replied
    I need help. I thought I understand how to use formula but try as I might for something so simple yet I'm unable to get it. What am I doing wrong?

    I want the Account Name to be autofill after I choose the Contact in Opportunities. Anyone know how I should write the formula? Here is one sample of my failure formula:

    accountName=contactName

    contactName=entity\isRelated(accountName, ID)
    Last edited by esforim; 02-11-2020, 06:34 AM.

    Leave a comment:


  • telecastg
    replied
    Excellent esforim ! I am sure many newcomers or people just "testing the waters" with EspoCRM will appreciate your efforts.

    Since formula is a back-end facility, the changes in fact take place after the entity has been saved in the front-end.

    Leave a comment:


  • esforim
    replied
    Beautiful, I manage to get it to work after thinking I could just test it on the Demo before using it live on my system. It seem that the Formula script is run after you save or update?

    Anyway here is how I did it.

    1. Open Admin Management > Entity Manager - https://demo.espocrm.com/?lang=en_US.../entityManager
    2. Pick where you want your formula to be use. For example I will choose Contact.
    3. Click the arrow button.
    4. Click Formula
    5. Create your own formula or use the + button for menu and fieldcode.
    6. For the purpose of this Guide we will set it up that phone number of the Contact will be copied from the Account.
    7. Formula is: phoneNumber = account.phoneNumber
    7a. Click Save.
    8. Now to test the system: Create a new Contact.
    9. Fill in the requirement field (Last name).
    10. Link an Account to this newly create contact (preferably one with a phone data).
    11. Save
    12. The Formula will run and phone number will be copied from the Account to the Contact.
    13. Done

    Some additional note:
    - If you fill in detail then it won't input the data.
    - If you have a blank field it won't add the data into secondary field.

    And here is some screenshot for the more visual people.



    ---

    I still need to decide on what I want to do, I need to make it more complex so that it doesn't add in useless data. For example, "If blank then add" statement.

    Leave a comment:


  • telecastg
    replied
    I might be totally wrong, but my interpretation is that formula is a way for Administrators to build and use back-end "hooks" without having to actually code them. The formula input is saved as metadata and then the system executes a beforeSave hook to implement them.

    Leave a comment:


  • esforim
    replied
    While waiting for telecastg to save us, I wanted to learn how to do this way but not getting it.

    From what I see at the moment there is only one place to do Formula. Appreciate an in depth guide or screenshot of layout/setup

    Leave a comment:


  • telecastg
    replied
    I'm glad it worked for you.

    I am currently experimenting with another approach using the front-end dynamic handler feature https://github.com/espocrm/documenta...mic-handler.md and found that if you are changing one attribute value, and want to affect another direct (not link) attribute within the same model, you won't have to refresh the window for the screen or reload the model to reflect your change but if you want to change a linked attribute and have a regular (not link) attribute value affected by the change, you need to save the value.

    I will post any progress :-)

    Last edited by telecastg; 01-18-2020, 09:57 PM.

    Leave a comment:


  • PhotoMommie
    replied


    AHHH! I got it figured out. I was thinking that this was going to DISPLAY the result in the screen before the document was uploaded... HA fooled me! OK, thank you, the formula accountId = case.accountID; worked splendidly!

    Leave a comment:


  • PhotoMommie
    replied


    I cannot seem to get this to work in the formulas. Honestly, I am struggling with this.
    I tried accountId, accountName, accountIds and I cannot get this linked correctly.

    Leave a comment:


  • telecastg
    replied
    Perhaps try with formula ?: account.id = case.accountId Case has a M:1 relationship to Account

    Last edited by telecastg; 01-16-2020, 06:39 PM.

    Leave a comment:


  • HELP Request - Document Relationship to Case/Account

    I have a M:1 relationship with Documents:Account and M:M Documents:Accounts
    And I have a M:1 relationship for Documents:Case

    My question is this: When I pull up the form to enter the document, the Case is linked, but the Account has to be 'found'.
    Is there away to link the Account automatically?
Working...
X