locked
Relating a Custom Entity to Another Entity RRS feed

  • Question

  • I have created some custom entities that I want to Contracts and  Invoice Entities. I would you recommend using the Guid for the Contracts and Invoice Entities or creating a new attribute to link the my custom entities to Contract and Invoice entities?

    Monday, December 3, 2012 5:48 PM

Answers

  • OK I see.

    Setting -> Customizations -> Customize the System

    Expand Entities, Expand Contract

    Select 1:N Relationships

    New 1-to-Many Relationship

    Select Translation as the Related Entity (Name the field Contract)

    Save and Close

    (Optional)

    Forms -> Main form (still Contract)

    From the Insert tab on top, add a new sub-grid or entity type Translation

    Save and close

    Expand Translation

    Forms -> Main form

    Add the Contract field to the form

    Save and close

    Publish both entities


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Monday, December 3, 2012 6:43 PM
    Moderator

All replies

  • I'm not fully sure I understood you question but you have a couple of options - really depends on your specific needs. 

    When customizing your entities, you can create new 1:N, N:1 or N:N relationships between system and custom entities. This gives you access to having links to the related entities in the related navigation menus as well as sub-grids with the related records.

    On an entity, you can also create a new field of type "Lookup" and choose an entity type. From this lookup field you can browse to one of the specified records and save the value. This works well if you don't need to deal with the hierarchy of related records in your requirements. 

    You can also use the "Connections" functionality to related different types of unrelated records. Each "Connection" can be defined to differentiate the different types of relationships you are looking to track. This is good if you have many different types of records you need to related together. 


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Monday, December 3, 2012 6:09 PM
    Moderator
  • Ok, I create a custom entity called Translation it has one to many relationship to the Contract entity. How would I go about relating the 2 entities and their data. Should I use the ContractID to relate the 2 entities or create a new attribute in both the Contract entity and Translation entity to relate the entities.
    Monday, December 3, 2012 6:20 PM
  • If you have already created the relationship between the two entities, then the next step would be to add the ContractID field to the Translation form so users can populate it to make the relationship. This should result in a new Lookup field from which you can choose a Contract record. 

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Monday, December 3, 2012 6:24 PM
    Moderator
  • I have not created the relationship. I am trying to figure out what is the best way to create the relationship between the 2 entities so they have a 1 (Contracts) to Many Relationship (Translation). I do not know how to take this step.
    Monday, December 3, 2012 6:28 PM
  • OK I see.

    Setting -> Customizations -> Customize the System

    Expand Entities, Expand Contract

    Select 1:N Relationships

    New 1-to-Many Relationship

    Select Translation as the Related Entity (Name the field Contract)

    Save and Close

    (Optional)

    Forms -> Main form (still Contract)

    From the Insert tab on top, add a new sub-grid or entity type Translation

    Save and close

    Expand Translation

    Forms -> Main form

    Add the Contract field to the form

    Save and close

    Publish both entities


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Monday, December 3, 2012 6:43 PM
    Moderator
  • I created the relationship. Thank you. I was curious can a Look-up value also be an option set? For the translations, I was interested in allowing people to select a tranlsation in a contracts form and have that value populate the entity translation. I hoping to allow a person to have mulitple translations. What is the best way to handle this issue? 
    Tuesday, December 4, 2012 4:45 PM
  • If you want to have multiple Translations to 1 Contract, instead of creating a 1:N Relationship you would need to create a N:1 Relationship. Then add a sub-grid of Translations to the Contract and the Contract Lookup to the Translation forms (essentially reversing the other steps. 

    Technically it would be possible to have an option set selection create or add a Translation entity using JavaScript but it wouldn't be really straight forward. Would probably end up being a lot of code to determine the logic and values need to perform the operation. Something like that might be better asked in a new thread. 


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Tuesday, December 4, 2012 5:25 PM
    Moderator
  • Dear Jason,

    Thanks again for the response and I will move forward with your suggestion.

    Thank you again,

    Scott

    Monday, December 17, 2012 3:41 PM