How to set picklist value using workflow - dynamics-crm-4

I'm creating a lead record using import function (System->Data Management-> Import), I have creatd a workflow for once the lead record is created, the contact record field 'Salutation' which is a dropdown list must be updated.
When I'm trying to do this, looking for lead doesn't appear to have any value coming on it. Don't know how to set picklist value for updating records using workflow. Please see the screnshot below

That seems odd, you should get all available options when updating a record with a workflow. Is the picklist populated with values? The salutation dropdown is not a standard field in CRM 4.0, it's a freetext field OOB.
Regards

I don't thing pick-list field value can be set dynamically on a record by the field of another entity.
What I did I check multiple cases and update the field manually to achieve this.
i.e. If lead(car1) == 2 update the pick-list value on workflow with your choice. But this is q dirty fix because conditions are more and is difficult to use multiple times for updating record.

Related

Updating one table in MS Access with data from another

In MS Access 2016 I have a table named Master that periodically needs to gets updated with ‘updated’ data from a table named NewData. Each table has the same fields, except Master has one additional field named OTHER_SOURCES (explained further down). They each have an indexed unique id field named EVENT_ID. I’ve built an update query where the tables are joined one-to-one on the EVENT_ID field. In this query I have the fields in Master getting updated to the new values from the same fields in NewData if the TIMESTAMP field value is different. If the TIMESTAMP values haven’t changed, then those records do not get updated. This part is pretty straightforward and works fine.
However, I have end users that may make occasional changes to the values in the SIZE field of Master that need to be preserved and not overwritten with updated values from NEW_DATA. When a user makes a change in SIZE field, he documents the change with information obtained from other sources, which is stored in the extra field I mentioned earlier: OTHER_SOURCES. Here’s what I need to do, and I just can’t figure it out. Whenever a user has made a change to the SIZE field for a record, I need the update query to not override that value in the SIZE field, but still update the values in all the other fields (again, assuming the TIMESTAMP values are different between the two tables). It seems I need to use an IIF statement, but I’m thinking it needs to be done in VBA where I’m a bit of a hack. See screenshots. I greatly appreciate any help you can offer.
enter image description here
enter image description here
You can still proceed with the update, but update it to the same value as its previous value:
SET SIZE= IIF(nz(OTHER_SOURCES,'')<>'', MASTER.Size, NEW_DATA.Size)
This assumes that anything present in the MASTER.OTHER_SOURCES column indicates that the user has changed MASTER.Size. Note that MASTER.Size will never be updated from NEW_DATA.Size until someone (end user) removes MASTER.OTHER_SOURCES.

Access combo box for DB mapping table 2-1 Table relation

I've run into a bit of a snag with a project I'm working on, and being new to Access I don't know if what I want to do is possible without VBA. I've looked around but all I can find are answers related to showing multiple columns, not controlling multiple fields in my DB.
To paint a picture I have a mapping system set up in my DB to help me distinguish the name and type of data is held in a table.
The setup is as follows:
-Data table is "LineItems" with an ID and the line data (think typical excel format)
-Mapping table is "LineItem_Mapper" with LineItem_ID, DataType, and Entity_ID
-A helper table "Data_Type" with ID and Name
-two "Entity" tables with differing properties both have ID and Name
The reason for the split is on data type is that the two types of data behave differently. One type has a parent child relation, and the other is a standalone row. I want to preserve this structure in my DB and feel I have done so with this mapping.
Now, on to the issue I'm running into. In my Access data entry form I want to use a combo box, as the options a user may chose for each line when entering are finite. However, this combo box is affecting the Mapping table above. I have been able to populate the box with my desired list with a custom query built from my 2 entity tables, but I don't know how to get Access to create or update the Mapping table using this box.
what I want to happen is when I chose something in the box, a line is created (or changed) in the mapping table with all 3 columns being populated. first the LineItem_ID for the line I am populating, and then the DataType and Entity ID to reflect the proper mapping.
Can Access do this on its own? Or do I need to do this with VBA?
As requested by the OP converting my commend as an answer (with a little bit more detail):
By far your best option is to use VBA. I doubt there is another way and even if there is it would be so convoluted it would be unworkable and unmanageable.
This should get you started:
In the combo box properties go tot the events tab and in After Update or On Change (look up the difference between the two events to see which behavior you prefer) click the down arrow and select [Event Procedure], then click on the … button. This will create a VBA module for you complete with the function that runs when the selected event is triggered.
You can use DoCmd.RunSQL "[Access SQL INSERT statement]" to add records to tables.
You can use Me.[MyComboBoxName] to get the current value of the combo box. Similarly the value of anything else in your active form.
You can use DLookup to get the value of any record in your tables.
Hopefully these will give you a relatively quick start.

Access form must be opened twice before combobox values will appear

I have a checklist that is used to perform QC audits. When a reviewer answers a question that requires an exception, a pop-up form will open with the correct exception detail already populated. They then have to provide some further information, which I have set-up in the format of a combobox for a field named 'Condition_Detail.' Some exceptions have only one condition that would be an option in the drop-down whereas others have multiple possible conditions, which is why I don't have that field automatically populated as well. I have a table of possible exceptions and conditions that I have used to create the combobox query. When the database was created, the field the 'Condition_Detail' combobox is dependent on was labeled 'Exception Detail' with a space and in my new table it is called 'Exception_Detail.' I did this because the old data and tables will eventually become irrelevant and I know that it is easier to write code with underscores instead of spaces. I include this information because I had to create a relationship between those two fields in the combobox query so that the database would know they are the same. When I test the database, the form opens as expected with the exceptions already populated (NOT in combobox format - the data appears as text on the form). The issue is that when I select the combobox, it is blank. If I answer the exact same question the same way to trigger the same exception to open in a new record, the combobox does have the correct data in it. I have tried to requery the field both when the form loads and after it updates. It still won't show the combobox values unless I trigger that the form open twice with the same detail populated. An additional piece of information that likely doesn't affect the problem is that the combobox is set-up as three columns so that I can populate two additional fields when the condition detail has been updated. I used the code below to populate that, which works perfectly when I can get the condition detail to appear in the combobox:
Private Sub Condition_Details_Change()
Me.Responsible_Position.Value = Me.Condition_Details.Column(2)
Me.Severity_Description.Value = Me.Condition_Details.Column(3)
End Sub
Thanks in advance for your help!
I figured it out. The relationship I created within the combo box query was unnecessary. The query was searching for values in the table that stored the actual responses/conditions instead of the table that stored the available response options. Because of this, once I had answered the question it knew what to look for, but in the wrong place. Setting up the combo box the usual way with the look-up control value in the form referenced as follows was sufficient to get the combo box to work properly.
Field: Exception_Text
Table: tblPreCloseExceptionDescEnc
Criteria: [Forms]![frmEncompassExceptions].[Form]![Exception Text]

Microsoft Access Form To Query for Multi Value Field

I am trying to write an Microsoft Access query from a form with a multi value field being the criteria. The field I am trying to use is called Population and the field is represented in my database as a List Box that allows multiple values and it is in the Building table. The values it allows are the following:
"Singles";"Familes";"Families with Children";"Youth/Young Adults";"Veterans";
The form that I am creating is called HousingSearch.
I am trying to create a form which uses this field, so someone could use the list box and check off the values they want and click on the button which would open a query. I know having done this with single value fields the criteria in the query looks something like
[forms]![HousingSearch]![Building]![Population]
but if you try the same thing for a multi value field nothing is returned for the query. Any help would be appreciated.
From the information you have provided it seems that the phrase [Forms]![HousingSearch]![Building]![Population] are combining a request that starts with a form and then jumps to a table.
You are asking access to find data in a form but the information you're most likely trying to access is in a table. I don't quite understand what you're end result is but I think that you most likely want to refer to your information this way [Building]![Population]. Referring to your data this way makes access look at the table of [Building] and then into the field of [Population].
It's been a while since you posted, if you haven't cleared things up already I hope this helps.

use access form to edit data from a query result

I'm brand new to Access 2010, well to Access in general. I have a query that returns 10 columns (the query is called pending_review, the source is a table called escalations) in the results, some of those fields are blank since they have to be reviewed. One of the resulting columns is the primary key.
So this is my problem: I need a to create a form where I can type the primary key and the fields on the form will populate with the info from that row so I can fill the blank spaces with information that I now have and then update the table.Once the table is updated, that row should no longer show on the query results.
What I have done is that I created the form, but I don't know how to do the part of typing the primary key and everything gets populated. A solution would be to make a combo box that shows me the primary keys of the rows in the query results, so that every time i edit something in one of those fields for the query to be run again and reduce the number of options in the combo box.
Question is, how do i do that? or is there an easier and better way to do it?
Thanks in advance!!
Can you not just create a new form using the pending_review query as a data source? Access makes it very easy--you can just use the form wizard. This gives you a form in which you can edit one row at a time. Presumably the pending_review query has a filter condition that checks for certain fields being blank (null) or not. If you finish editing a result row in the form, and refresh the form, the row should then disappear from the form because it will no longer be returned by the pending_review source query.
Even if you need to do something more complex, this should at least be a good start.