CRM 2011 Workflow Condition Issue - crm

I have created a simple workflow in CRM 2011 which checks a field value in one entity and creates a new record in a different entity. Sometimes however, the creation doesn't occur, it just seems that the condition is not met when it should be.
Consider an entity called "Car" which has a text field called "Task". This Task field will always be saved with 1 of 4 possible values: "", "Add", "Change", "Delete".
This value is used to determine how the workflow should process.
The workflow is set to fire when a different field is changed - "Driver".
The workflow is setup like this...
- Condition
- If "Task" == "Add"
- create new record
- Else if "Task" == "Change"
- create new record
- Else if "Task" == "Delete"
- create new record
- Reset "Task" to ""
NOTE: the created record is using different values depending on "Task"
I can see that the workflow is always fired when expected, and both the "Condition" and the "Reset" are processed. The problem is that sometimes (although, not so far today) no record is created - this suggests that none of the IF conditions are met. However, I have no reason to explain why. I can see that the field "Task" is always set as expected prior to the save (exact spelling/casing and all)
So, are there any known issues with CRM workflows that could explain this? Is there a more indepth way to debug these issues? (i.e. check the value of "Task" at time on "Condition" checks)
I am wondering is it possible that the "Reset" part of the workflow is somehow being processed before the condition? and there for the condition is checking a blank field.
Any help will be greatly appreciated, Thanks

Unfortunately, I have not experienced this issue again since the first time when I created the workflow.
However, some good techniques where offered in comments as to how this sort of issue could be debugged - thanks to those people!
Firstly, you can turn on Entity Auditing which will help you track down what is going wrong.
Another option would be to send an email from the workflow with the current data values for debugging, or add a final "else" clause to send emails when none of the conditions have been met (perhaps a good fail safe addition to have even when it does seem to all be working) - I like this second option as it is more "out of the box" thinking ;)
Anyway here you can find information on sending emails from within a CRM workflow

Related

D365FO Tile count on workspace doesn't work

Situation is next one:
I created several tiles. Every tile need to show count of records.
Tile "Expired Active Contracts" always shows zero.
There is created simple query with data source table Contract. Ranges are added (ContractStatus; Value: 2) and (ValidTo; Value: (LessThanDate(0)) )
When it's clicked on tile, it opens valid form with valid record, where contracts status is active (2) and ValidTo are any date before today's date, but count doesn't working.
Tried to recreate, tried several things but definitely nothing. ValidTo field is date field.
Some time ago I had a mistake very similar to yours in my dev environment, this steps help me to fix the error.
1 - Clear Usages Data.
2 - SysAdmin/Setup/Data cache/Tile data cache configuration. Select
the tiles which are running into this issue and then delete the
selected tiles.
3- In VS rebuilt and Synchronized the Solution.
4 - Finally refresh the Application browser.
Another thing is that a while ago there was a problem for tiles refresh
Issue 243278 Workspace tile does not update correctly when reusing the
same name
https://fix.lcs.dynamics.com/Issue/Details?bugId=243278&dbType=3&qc=68b6dc6804c9cea218daa102968c7acfcdfe6a990e80e0b5ec66b920a680fceb
I hope you find it useful

Powerapps - get stuck with UpdateContext

I am trying to build a PowerApp to log setup times of our machines by our fitters.
This is what my app looks like:
There are buttons named "Uhrzeit". Pressing these will write the current date and time into the Date/Time fields. I am using the following code:
UpdateContext({Total8:(Text( Now(); "[$-de-DE]dd/mm/yyyy hh:mm:ss" ))})
The Date/Time field is named Total8.
The code is working well but after saving the form and opening a new record the old data is still available in the fields. By clicking on the button "Zeiten zurücksetzen" I can "delete" the old data.
UpdateContext({Total8:""})
Problem: When I open one of the older records the old data is not available in the form. There is only the value of the last record. In the Common Data Service where my records are saved the values are correct.
As an example, I am saving this record:
When I open a new record, the values of the record 1 are still available. This should not be the case if my app worked properly.
For your Information:
If I enter the date/time without tapping the button, saving the record and opening a new record I don't have the problem. I think the "UpdateContext" code is not the code I should use here.
Can anyone help me solve the problem?
I don't think there's a problem with using the contexts in this way -- but remember that a context is just a variable. It isn't automatically linked to a datasource in any special way - so if you set it equal to Now(), it's going to keep that value until you do something different.
When you view an old record, you need to get the data from CDS and update your contexts to match the CDS data. Does this make sense?
Yeah thats my problem.
I want the variable to be linked to a datasource. Or is it possible to write the date/time into the fields without using a context variable?

Please read scenario below and help me to solve it

I have asp.net web page which populates grid view. One of column is Status which can have (Scheduled, InProgress, Failed, OnHold, Completed) these values and another column with link in each row to edit that particular entry. Editing is only allowed for statuses Failed, OnHold, Completed not for Scheduled, InProgress on click of entry which has status Scheduled or InProgress a pop up appears saying you cannot edit.
Now, click on link and start editing data, at same time another person with same access as mine also tries to edit same data(i.e. clicks on same link) and makes Status to Scheduled and clicks submit. The data is saved in database. Before I complete editing.
Now status for that entry is Scheduled and according to requirement it cannot be edited, but I'm able to edit data and save it database.
It should not happen. How to achieve this please help.
Thanks in advance
On the function or RowUpdating Event of the grid, you should run a SQL statement checking if the status of the row currently being updated is valid for saving (per your requirements).
If it's not, then display an error that it's been updated by someone else to a status different from the one fetched by the 2nd user trying to update it.
You can make a Column in your database like "IsEdited" and whenever a record is being inserted first run a query to retrieve the value of "IsEdited" then use If-Else statement to check. If its value is True then don't run the Insert query and display error message and if its value is False then run the Insert query with data for all other columns and also a value (True) for "IsEdited" column.
If you could provide a code it would be easy to explain.

Generate Number with Validating rule in Access

I have a database in access for institute. there is a [Registers] Table and [Certificates] Table.
I want to give Mark to each of Registers a Mark. I want to set Validation Rule for Each
If [Certificates].[Mark]>70
Then UpdateRecord
SetField
CertificateID "GENERATE AutoNumber"
My Problem is i cant handle the CertificateID Generate with Macro. i cant use DMAX.
looking for a solution to give CertificateID to only Registers who passed the Course.
Tried "After Update" Macro and "After Insert" macro but still didnt success.
is there any other way to give AutoNumber except "DMax"?
Well, i just already found a way but not the best way.
I just added another Table as "Certificates" and renamed current(Certificates) to "Marks".
Tables and Fields
i made a query with Select a "Grade" from Certificates Table and rest from Marks. Whenever i fill a record in Grade table it generate Autonumber for "CertificateID" a new number.
For Validation i set my validation Rule in my form on Grade which i cant fill that field if Marks.Mark is less than 70. ( [Marks].[Mark] < 70)
I know its not a good way.
Still looking for better answer

Updating all instance of a recurring event in Google Calendar API

What is the proper way to update all (or a subset) of the instances of a recurring event? Also related: how do you, given the id of the original event, get the instances of that event?
If you want to update just a subset of recurring events, then you need to set singleevents = true when running your query to retrieve the initial list of events. In PHP you'd do something like this
$gdataCal = new Zend_Gdata_Calendar($client);
$query = $gdataCal->newEventQuery();
$query->setUser('default');
$query->setVisibility('private');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setStartMin($startDate);
$query->setStartMax($endDate);
$query->setSingleEvents('true'); //get recurring events as a series of single events
$eventFeed = $gdataCal->getCalendarEventFeed($query);
foreach ($eventFeed as $event) {
//do stuff with $event
}
I tried with updating all recurrence event ,it is working.Initially I created one Recurring event like weekly on Monday from 2016-02-25 to 2016-03 25 and It is created 6 instances for that recurring period.During updating what I tried is,
1.First I assigned to Recurrence field ,
"recurrence":["RRULE:FREQ=WEEKLY;COUNT=18;BYDAY=TU"] (Updating like weekly on Tuesday)
2.after that I fetching available lists using list google api.here I used Single Events: false(in the sence it will give only main recurring event not all instances)
3.after I used update event to update like passing auth,eventId and calendarId: "primary" and resource:updated event array
then it is done .It is updating the instances as Weekly on Tuesday.
I hope it will help to someone.
To update all you just change the relevant properties for the event, leaving the recurrence and recurrence exceptions strings intact. Not sure that you can easily modify a subset, as this would require converting the recurring event into multiple new events depending on the subset.
For the second part or your question, according to the API docs:
Specifically, each recurring event is
represented by a
element in the result feed, and each
of those elements includes a
element for each occurrence of that
event that falls between the start
time and the end time. Looking at
elements is much simpler
than parsing recurrences and
exceptions yourself.
However, I've never been able to find that magic "when"... so I've ended up parsing the recurrence and recurrenceexceptions strings - if you find the answer to that one, let us all know!
For anyone with this issue I also spent some time trying to figure this out. Basically when you get your CalendarEventEntry list you need to check for each calendarEventEntry if it has an originalEvent (calendarEventEntry.getOriginalEvent()). This basically tells you there is another event (which you may or may not have already processed) that needs to swapped with the information for this current calendarEventEntry.

Resources