2
votes

I have an entity called Club that has a sub-grid for another entity called Membership. When I am on a Club record and I click the "+" on the Membership grid, it opens a create window with the Lookup fields pre-populated. The fields it currently pre-populates are both Lookups to the Club entity, but for one of the fields I don't want it to pre-populate to the Club entity that clicked the "+". How can I achieve this?

I have looked at the 1:N relationships on the Club and Membership entities. The membership entity has a N:1 mapping from the field in question to the Club but when I try to remove the mapping it says that the component is in use by CRM so I cannot remove it. If I remove the fields from the dependent forms and then remove the mapping, what are the repercussions of this? I've noticed that other fields have lookup mappings but they don't pre-populate so why does this field in particular? I don't have any business rules or javascript that pre-populates it. What else can I try here to narrow down the issue?

Opening the Membership Create form from a Club entity pre-populates the lookup fields to the entity record that opened the create form. I want it to not pre-populate a specific field.

3

3 Answers

2
votes

You need to check the bindings in the relationship too. If you open the Entity, and you select the relationship (where you can select the cascade attributes) in the top left side you should see a menu called "Bindings". There you can set automated mapping on entity creation through a subgrid.

1
votes

For me this does not look like an issue, just the expected behavior.

One to Many 1[a]:N[b] relationship gives a lookup attribute in b record. In reverse, b records subgrid in a record. Here in your case, a is Club and b is Membership.

The fields it currently pre-populates are both Lookups to the Club entity, but for one of the fields I don't want it to pre-populate to the Club entity that clicked the "+". How can I achieve this?

Either you should have duplicate relationships between Club & Membership or duplicate Club lookup control is added to the form. So when you say both are getting filled without BPF or script, then check the schema in form editor they should be same, with “1” appended to the name. Essentially the same field added twice.

The lookup associated for that relationship will always autofill when created from Associated view/subgrid. This is expected behavior.

I've noticed that other fields have lookup mappings but they don't pre-populate so why does this field in particular?

They will pre-populate when you create the record from the respective related subgrid for that relationship.

If I remove the fields from the dependent forms and then remove the mapping, what are the repercussions of this?

Not sure if you can remove this mapping, if you do so that will try to break the platform functionality. In other words, you want simply a new record creation experience in regular form or Quick create form without pre-populating values unlike associated record created from its parent record.

0
votes

I had a similar problem and used Business Rules to resolve it. In my case, Opportunity records have two separate lookups to Account (one for customer, one for referring customer). A value in "Referral Type" optionset field on Opportunity indicates whether the Opportunity is from referral. If it is not, "Referral Type" is null.

An Opportunity business rule checks for a value in "Referral Type". If "Referral Type" = null, business rule clears "Referring Customer" then hides "Referring Customer" field If "Referral Type" contains data, business rule shows "Referring Customer" and sets it required.