Announcement

Collapse
No announcement yet.

Setting linked record does not link properly

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

  • Kharg
    commented on 's reply
    hrdy90 use record\attribute(ENTITY_TYPE, ID, ATTRIBUTE)

  • hrdy90
    commented on 's reply
    Did not know "record\fetch" was possible. Not available for me yet. Just upgraded to v7.4.4. According to the documentation it is/will be available as of v7.5. But yes, great idea - will try to do that instead!

  • Kharg
    commented on 's reply
    The name has to be the same name of the linked record. Why don't you fetch the name using the record id?

  • hrdy90
    replied
    Well, I did as you suggested:
    PHP Code:
    $message = (description);

    $addressLine string\match($message'/Gatuadress\: (.*)$/m');
    $address string\substring($addressLine12);

    $apartmentidLine string\match($message'/LägenhetsID\: (.*)$/m');
    $apartmentid string\substring($apartmentidLine13);

    realEstatePropertyName $address;
    realEstatePropertyId $apartmentid;​ 

    Case description:
    Gatuadress: Ramvägen 8
    Beskrivning av felet:
    Test!

    LägenhetsID: 644a42027d091dd82
    But it is unfortunately still only showing as "644a42027d091dd82" unless i manually click edit followed by save somewhere in the case.

    Leave a comment:


  • hrdy90
    commented on 's reply
    You are very correct! I will set realEstatePropertyName manually for now then. But is there no way to work around this? I.E to make it do the lookup after record is updated?

    Thank you!

  • Kharg
    commented on 's reply
    if you check the network tab in developer tools you will see that when you select "Ramvägen 8, Stockholm" the request will both contain the apartment name and the apartment id.

  • hrdy90
    commented on 's reply
    But realEstatePropertyId with ID 644a42027d091dd82 already exists with all that information. Clicking the link "644a42027d091dd82" takes me to that object where apartment name and other details already are set.

    And updating the case manually makes the link "644a42027d091dd82" become correct "Ramvägen 8, Stockholm". So it does understand the ID 644a42027d091dd82 correctly - it just does not create the link correctly unless I manually update the case record.

  • Kharg
    commented on 's reply
    you should set realEstatePropertyName to apartmentName

  • hrdy90
    commented on 's reply
    So I should set "realEstatePropertyId" to 644a42027d091dd82 Ramvägen 8, Stockholm? AFAIK the real estate property id field is "644a42027d091dd82". And clicking that link goes to the correct entity. It just does not seem to be linked correctly. Maybe like I need to use "Update" somewhere in the workflow to make it process/understand the linking.

  • Kharg
    replied
    try to also send the name, not only the id

    Leave a comment:


  • hrdy90
    started a topic Setting linked record does not link properly

    Setting linked record does not link properly

    I'm using the following formula with "Case" entity and Trigger type: After record saved:
    PHP Code:
    $message = (description);

    $apartmentidLine string\match($message'/LägenhetsID\: (.*)$/m');
    $apartmentid string\substring($apartmentidLine13);

    realEstatePropertyId $apartmentid
    A case description might look like this:


    Description:
    Test!

    LägenhetsID: 644a42027d091dd82

    This does add "644a42027d091dd82" in the correct place, but it does not lookup or link correctly. If I update the case manually it does however reapply the link and it works as expected. What am I missing?


    Attached Files
Working...
X