MS Access: Prevent validation of subform - validation

I am struggling with inadvertent triggering of validation rules when activating a subform.
In MS Access, I have a form with data about a patient, which contains a subform with one record of a medical device that belongs to this patient. The patients table has an [ID] field, and the medical devices table has a [PatientID] field. The medical devices table has a one-to-many relation with the patients table (one patient can have many medical devices).
When the form containing the subform is opened, the subform's Form_Load() method fills in certain fields such as the current date.
The problem is: As soon as any control of the subform is activated (via tabbing or clicking), the medical devices table's validation rules are triggered -- once and only once. After dismissing the validation error message, I can switch between the controls on the parent form and the subform without problem.
When I remove the code from the Form_Load() method, I can activate the subform's controls without triggering validation.
Both the parent form and the subform are linked to tables, not queries.
How can I fill in data in the subform using VBA without triggering validation?

I suggest you use default values, not actual text. Default values only become "real" when some other field is completed.

Related

Multiselect lookup field in Dynamics

Can I:
make manipulation with subgrid so I can choose multiple Contacts and save them in the field (or even better choose only the email address from the Contacts) or
make a lookup field to Contact that allows me to choose multiple contacts
Longer description of the problem:
I have made some customization of the Invoice entity in Dynamics Sales, but what I also need is an email failed that is a lookup to Contacts, so I can choose a multiple contacts, so later on I can get the email information and send them an email with power automate. But since I'm new to Dynamics I'm not sure how to manipulate with the subgrid, I researched something about creating N:N relationship, but I'm not sure how can I manipulate with on save/ on load events, cause I need to choose multiple contacts and save them in this field.
Customized Invoice Entity

Displaying Lead Activities in Contact's Social Pane

In our system, some contacts are linked to the leads later in the process, therefore those contacts don't have the Originating Lead (originatingleadid). Also, we want to connect some contacts to multiple leads.
Currently, we are connecting contacts and leads through the Parent Contact for Lead field (parentcontactid in lead entity).
But the problem is that if the contact does not have an Originating Lead, the activities from the lead are not displayed in the contact's social pane. The relation made through parentcontactid field is ignored.
Is there any workaround for this? Is it possible to make such a relation between the contact and the lead that the activities from the lead are displayed in the contact's social pane?
The originatingleadid field is not valid for update, it can be set only on create.
You can change the Rollup View Relationship Behavior on custom 1:N relationships to Cascade All. In this way the activities from children will be shown on the activity view for the parent.
This would require you to create a custom relationship between Contact and Lead, since you cannot change this property on the standard relationships in the system.
You have not specified a version. The Rollup View Relationship Behavior was added in Dynamics 365 (version 8.2).

How to create a validation rule which restricts data entry from specific table

I am creating a data entry form and report on MS Access and I would like to create validation rules for some input text boxes that restricts data based on the data contained in another table.
For example: For the subdivision input field, data that can be entered must be equal to one of the items which is contained in the Subdivision table which contains a list of subdivisions such as:
Los Angeles Sub
San Bernardino Sub
Riverside Sub
Etc
How would I go about doing this?
If your form data is directly bound to the table that holds it, then you would use the Before Update event of each text box to perform any validation you wish using VBA. If your form is not bound directly to the table you can either use the On Lost Focus event to validate each text box individually or whatever process you use to push the data to the table and validate the entire form input.

Product slug not working in CRM 2013 Email templates

I have a business requirement that execs are really wanting to see. In our lead and email templates we have a few of our products listed. The products themselves are pretty stable but the prices are of course subject to change.
I'm OK with hard coding the product name into email but I was hoping the price could be a slug that get's resolved.
We only have one price list so nothing to worry about there.
I see no way to get access to the product and or price list entities through the data field values dialog.
So my thought was to create the 2-4 fields in the lead and opportunity entities. Then create a background workflow that takes the price from the price list and sets those fields.
Then when an email is generated I can access those hidden fields as they will be available through the lead or opportunity entity.
Any thoughts, concerns, better approaches?
Unfortunately CRM's email template system is not capable of what you describe out of the box. As you have discovered it will only permit you to insert placeholders from, or assocated with, the primary entity. It won't let you insert fields from other entities. What you suggest as a workaround is possible but it's not an ideal solution as you'll have these 2-4 redundant fields on each record type that contain duplicated data from the price list.
If you have any experience with creating custom workflow activities using the SDK then the best solution here is to create a custom activity that accepts either an draft Email or Email template as a input parameter, instantiates the email if required, loads the price list data, and performs your own custom placeholder replacements.
I've done this on a few projects in order to pass multiple entity records into the template, or to insert complex tables into emails by loading data from relationships. See the screenshots below for an example of how I've configured the email template and dialog process to pass both an 'Account' and 'User' record into the email template.

CRM 2011 lookup attribute mapping

Is it possible to set null/blank lookup values on relationships in CRM 2011 when they open from the parental/referrential entity?
Example, if you create a new 1:N relationship between the entities opportunity and account holding an agency value. When creating a new opportunity from an account, this account is prefilled in both the potential customer lookup field and the agency lookup field.
This can easily be remedied with a javscript, clearing the field onload, but can this be done earlier, in the attribute mapping, or is it always a post-fix to correct the default action?
I had the same issue in Crm 4. So I suppose it still exists in 2011.
You cannot remove the relationship mapping of the primary attribute, though I've never understood why this automatically maps to fields of different relationships.
In this case you are just best off using JavaScript to perform the following logic:
If the form is in create mode and both fields contain the same value then clear the duplicated field.
This logic should ensure that it only clears the fields in this circumstance.
This is not possible without Javascript.
MS CRM doesn't give you an option to counter the autofill of the mapped field. It will always be automatically filled in by the system.

Resources