Announcement

Collapse
No announcement yet.

Help Request - Link Account to Custom Entity

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

  • Help Request - Link Account to Custom Entity



    I have attempted to write a formula to allow an event-type entity "Warranty Appointments" to link to the Parent Case Account owner for viewing on the customer portal.

    //Link Appt to Job
    caseId = parentId;
    caseName = parentName;


    //Link Addresses
    addressStreet = case.siteAddressStreet;
    addressCity = case.siteAddressCity;
    addressState = case.siteAddressState;
    addressPostalCode = case.siteAddressPostalCode;

    ifThen (
    parentType == 'Case',
    builder = case.accountName; case.accountId
    );

    I can see that the linking is working, but I cannot view any of the appointments on the customer portal. I did check that all the permissions were correct.
    Maximus , can you help me yet again???

  • #2
    Hi there.
    What a permission did you set for "Warranty Appointments" in the portal role? Provide its screenshot please.
    Also, please take a look at the 14-th line of the formula. What this part 'case.accountId' of the formula should do?

    Comment


    • #3
      I was thinking that the case.accountId would help relate the entity to that account. Maybe that is wrong???
      Below are photos for portal permissions.

      Comment


      • #4
        Based on my experience with formula case.accountId is probably correct. However that case must be a One-Many or Many-One I believe, if you can see that field using the + button then it most likely the field exists.

        case would be the entity
        accountId would be the field name in Account entity.

        Comment


        • #5
          Now it's clear.
          You can try do this:
          1. Use your Many-to-One relationship between Warranty Appointments and Case to link Warranty Appointments to Case;
          2. Use your parent type relationship to link Warranty Appointments to Account;
          3. Rewrite formula like this:
          Code:
          //Link Addresses
          addressStreet = case.siteAddressStreet;
          addressCity = case.siteAddressCity;
          addressState = case.siteAddressState;
          addressPostalCode = case.siteAddressPostalCode;
          
          ifThen (
              case.accountId,
              parentType = 'Account';
              parentId = case.accountId
          );
          Note. do not forget to recalculate formula for needed records to let it link your Warranty Appointments to Account.


          UPD. In case that parent type relationship will not work for this, you can create another Many-to-One relation between Warranty Appointments and Account and use it. Also you will need to rewrite your ifThen to something like this:
          Code:
          accountId = case.accountId
          Last edited by Maximus; 06-19-2020, 01:41 PM.

          Comment


          • #6
            SIGH! Maximus , you are my hero, yet again! Thank you so much for your explanation and code!

            Comment

            Working...
            X