SharePoint 2010 List event handlers cascade - sharepoint-2010

I have three SharePoint lists as below:
GroupCategory
GroupName
GroupProperties
GroupName has a lookup column to select GroupCategory.
GroupProperties has a lookup column to select GroupName.
Now my scenario is when a GroupName is deleted, I want to delete from GroupProperties all entries for that GroupName. Similarly when a GroupCategory is deleted, I want to delete from GroupName all entries for that GroupCategory.
I know I can write a list ItemDeleted event handler for GroupName and GroupCategory to delete their respective entries from the child list. But my question is: When a GroupCategory item is deleted, and it deletes the child GroupName items, will the ItemDeleted event handlers of GroupName also fire?
Has anyone done this before? Also is there any other way of doing it?
Thanks.

Yes, when you delete item from list wich has event receiver for ItemDeleted event appropriate code from this receiver will also run regardless of place where event had originally triggered.
So if you have event receiver on list it will be called always when you change item no matter where you doing it from code, UI or powershell.

Related

Is it possible to hard delete a Directus item through the API or app?

Deleting an item from a collection, which has a status field, through the UI or API results in the item being soft deleted. However, in this one particular instance, we want to remove it from the database entirely.
If not possible, can it safely be done through the database by just deleting it from the table carrying the name of the collection? Any side-effects when doing it this way?
Found the answer on this page https://v8.docs.directus.io/guides/status.html#soft-delete:
When deleting an item, the API does the following:
Check if the collection has a status field
Check if the delta data has the status field (meaning the status was changed)
Check if the new status value (from delta data) has soft_delete = true
If yes, it sets the action to SOFT_DELETE
If no, it hard deletes the item (permanently removed from the database)

Update control value on parent form when all values on subform are changed to a certain value

I am currently helping design a business case form in ACCESS 2013 for our department's product managers to facilitate them submit business cases and store data.
There is one subform on the parent form, which displays all SKUs associated with the business case in datasheet view, as well as their statuses (one SKU might be in stage 1, another in stage 2), and the parent/child form are linked by case ID. That is to say one case ID is associated with many SKUs. What I want to do is to update a field value (case status) on parent form only when all SKU statues are updated to stage 3. If one SKU is stage 3 but another one is in stage 2, then don't update the case status. I googled a lot however there doesn't seem to be a solution I can find online. Could anyone please help me?
Should not save this calculated value to table. Just calculate when needed.
A textbox on subform footer can have expression to count records where stage is not 3.
=Count(IIf(Stage<>3,1))
Textbox on main form can reference the subform textbox.
=IIf([subform container name]!tbxStageCount > 0, "Incomplete", "Complete")

Updating a single SharePoint 2010 list item through multiple instances of a workflow

I have a list called "Tasks"with a number column called "Count".
On the "Workflow Tasks" list, I have a workflow that gets triggered on item added or item changed. When a workflow task is created/edited, the workflow checks the status of the task and either adds 1 or minuses 1 to the "Tasks" "Count" column.
If I add a single task to the workflow task list, the workflow picks it up and adds 1 to the "Count" field perfectly. However, if i add two tasks to the workflow task list, one after the other, the second task's workflow results in an error.
It's almost like i'm unable to update the "Count" field multiple times. I assumed that the row was somehow "locked" while the first instance of the workflow was updating it, so I added a pause, which didn't help. (I guess because the 2 instances pause at the same time.) I then added another column to the "Tasks" list called "Busy" and set this to "Yes" while the first instance updated the row. When the second instance runs, it first checks if "Busy" is "Yes" and if so, it pauses for a duration and then carries on. This still does not work.
Is my assumption of row locking correct? Or what am I missing?
TIA!
Edit: I don't have access to the error logs and the error simply states "An error has occurred in [Workflow Name]".
do you have many workflows and only one task to change? workflow runs, when task is changed or workflow list is changed?

Set value dynamic action not working in apex

I have a problem creating sql dynamic action in oracle apex v4.2. I have two fields, Department number and department name. Department number is a text field with autocomplete. The department name is a display field. On changing the department number, the department name should be displayed by an sql query.
I created a set value dynamic action on department number, giving the correct values in page item to submit and the correct sql query referencing P3_DEPARTMENT_NO.
When i run the page, after select a department number, the department name is not coming up automatically.
Could you please suggest on what i might be missing.
Thanks in advance.
You can try use this way:
First step: In the Shared Components -> Application Processes: create a process myProcess an put your sql dynamic in.
Second step: Create a javascript function myFunction to call the process myProcess.
Third step: Use onChange event to call your javascript function myFunction.
Also you can find a lot of exemples on Denes Kubicek app: https://apex.oracle.com/pls/otn/f?p=31517:101:116042570427567.
Best regards,
iulian
The exact behaviour of autocomplete lists is probably browser dependent, but generally speaking, don't rely on the "Change" event, as it won't necessarily fire when you select from the list.
You'll need to experiment to get the behaviour you want in your particular situation, but as a starting point you might want to try replacing the "Change" event type on your dynamic action with "Lose focus". That way the dynamic action should always be triggered when you tab or click away from P3_DEPARTMENT_NO.
In similar situations in the past, I've used "Key release" instead of "Lose focus", and I've created a second dynamic action which does the same thing, but triggered by "Get focus". That combination ensures that the display field stays synchronised with the user's selection, whether a value is keyed in or selected from the autocomplete list. Whether or not you go this route depends on how happy you are about the database being hit with your department name query every time a user interacts with P3_DEPARTMENT_NO in any way.

How can I create a filter to display all records created by group members in SharePoint 2010

I want to create a filter for list view, where I want to show all the records created by user group.
We all know [Me] will filter out the records which are craeted by me. i.e. Created by equals to = [Me]
How can I create a filter to display all records created by only the group members.
Please help, Thanks in advance.
I dont think you can do this out of the box.
A way to do this is to use an event receiver on that list, on item inserted / updated with some logic to extract the group from the user and populate a field of that item.
Once you have the column with the group value you can then apply a filter to it normally.
Reader here about event receivers:
https://www.nothingbutsharepoint.com/sites/devwiki/sp2007dev/pages/event%20receivers.aspx
You want to be looking at using event receivers on the SPListItem object.