How can I capture event on adding item in Sharepoint Blog Site - sharepoint

I have tried Visual Studio Site Solution generator for building Sharepoint Site solution.
My requirement is to validate blog entries with some criteria at run time. I want to add the same Bad Keyword thing I had asked earlier.
But Visual Studio Site Solution generator is unable to create solution for Blog Site and showing below error
The Solution Generator does not support Site Definition of this type
Advice any other approch if available.
It worked for Discussion Board library and also the Custom Lists using ListDefinition. However, I am not able to do the same on Blog.

As Rubens Farias states you should use an event receiver, but I'll try and expand on the process.
You should write an event receiver to handle events that occur when you add or update blog entries. A blog site stores posts in a list based on a template named Blog Posts list (with a template ID of 0x0110).
Knowing this, I would:
create a new project in Visual Studio (using VSeWSS or WSPBuilder both will work)
add a class that implementsSPItemEventReceiver (this is the "event receiver")
override the ItemAdded, ItemAdding, ItemUpdated and/or ItemUpdating methods with your own implementation. You may not need to use all of these depending on your requirements and you should understand the difference between synchronous and asynchronous events
create a feature that registers your event receiver with the Blog Post list template (using the ListTemplateId 301).
To help you find out more about how do to go about the above steps, I recommend reading the following:
Event Fundamentals
Event Registrations
How to: Create an Event Handler Feature

Since Sharepoint is always list based, I can suggest to inspect SPItemEventReceiver.ItemAdded Method

As far as I know the Solution Generator makes a "best attempt" but because of the complexities involved, it doesn't always work. I prefer to use a tool such as WSPBuilder instead of VSeWSS for this reason, however it doesn't have functionality like the Solution Generator.
If you're looking for an improved blog engine for SharePoint, why don't you try Community Kit for SharePoint:Enhanced Blog Edition?

Use a custom Workflows and a custom Activity to do whatever it is you need done.?

Related

Using PnP/CSOM to customise New SharePoint OOTB Document Libraries

Hoping someone could possibly help please.
Quite new to the PnP framework, but I have a template up and running, but I'm drawing a blank on customising the OOTB document library with our own custom content types and site columns. I’ve managed to do it for the initial provisioning process using PnP, but the bit I’m currently struggling with is when a user creates a new document library from either the 'addanapp.aspx' page or through a Modern Page, since that doesn’t use our content types or site columns, that just creates a default SPO Document Library.
I’ve been reading about the ECM Document Library core, List Definitions, Event Receivers and CSOM to achieve what I’m looking to do, but not sure where I should be starting.
Ideally, the outcome I'm looking to achieve is I want any new document library a user creates from a Modern Team Site to use only our custom content types and site columns, not the default OOTB ones.
Any help gratefully received, thanks.
Have you checked the demo ECM.DocumentLibraries?
Here is the general explanation video.
You need familiar with SharePoint add-in(app) first guideline here.

Using Flow with SharePoint Discussion Boards

I am trying to use "Flow" to automate emails every time a new item is added to a SharePoint discussion board.
This is working fine with all lists, however, it does not do anything when I create a flow for the discussion board. The name of the discussion board does not even come up as an option in the "List" category and if I use the "Documents" option instead of the lists, I am able to choose the correct discussion board, but the alerts do not work.
Discussions are based on the folder content type, with each reply to a parent discussion being an item within that folder.
Flow does not currently support many triggers or operations against folders (including discussion boards) in SharePoint sites, though they've been steadily adding functionality since Flow was introduced.
It's possible that this functionality will be added in the future. You can make suggestions and vote on proposed functionality in Microsoft's "Flow Ideas" community.

Automating Approval Processes in Dynamics CRM

A bit of background before I begin.
Background:
I am working on migrating an existing .NET based system to Dynamics CRM and one of its key feature is its 'Request Approval Process'. I have implemented some simpler versions of such approval processes in past but this one is a bit complex since it involves multi-level approvals, multiple approvers at one level, amendment logic, delegation functionality, etc.
Analysis Till Now:
Before pushing this question at SO, I did a fair analysis of the requirements from my end and have come up with few possible approaches:
Workflow based approach (something on lines of this)
Complete custom logic using Plugins/Web Resources (something on lines of this)
I am not explaining the details of these approaches as of now but the core issue is that none of these two approaches are fitting correctly to my requirements.
Queries:
While analyzing these approaches I came across some newer functionalities added to CRM (listed below) but did not get any additional resources to explore them further. I just want to confirm that I am not trying to achieve something which is already present out-of-the-box or going in the incorrect direction.
1. Internal Process Automation:
Reference: Here
Any leads/thoughts on this approach? I am not able to find any good documentation/articles around this.
2. Graphical Approval Workflow:
Reference: Here
This feature seems to be useful but it is mentioned to be a part of Dynamics Marketing. With the new structuring of Dynamics 365, will this feature be a part of Dynamics CRM by default?
Also, the Prerequisites section of this link mentions certain Item Types for which you can configure this functionality. So can't we use this functionality for any entity records?
Any kind of help/inputs would be appreciated.
I'd suggest the best of both worlds: using out-of-box Workflows along with custom Workflow activities that you can write with C#. Use as much out-of-box functionality as you can, but when you need to query records or run custom logic, create a custom workflow activity that can be used in your out-of-box Workflow. Custom workflow activities are similar to plugins in that they are written using C#. You can have custom inputs and custom outputs for your activity.
For example, maybe your approval process needs to look up the appropriate approving user for this record. You could write a custom workflow activity that takes an input (the record being approved) and an output (the user that has the ability to approve). Then in your Workflow, you'd add your custom activity as a step. After that step, you could send an email to the approver by using the output of that custom step.
More information about custom workflow activities: https://msdn.microsoft.com/en-us/library/gg309745.aspx

One time javascript function run in custom action

I have a request from the customer that they want every time they create a subsite (publishing site) .We have to add a custom column to OOTB Documents list.
I have done some researching the way to add the custom column to
Documents list in onet.xml but have no luck .
Then i think about the work around solution that i create a
ScriptBlock custom action that will call javascript function which
will add the custom column to document list , then i will put this
custom action to a feature ,and finally i will reference that feature
in onet.xml.
It run well but the javascript function call every time i refresh the page. I just want it run one time when i active the feature.
Does anyone have any suggestion ? I use sandbox solution and Sharepoint Online .Sorry for my bad English
I don't think a custom action is the right way to do this, Custom actions generally need some sort of user interaction.
Get CKS dev tools in Visual studio
Create a new SharePoint solution
Add a new web template(CKS Dev) to your solution from the Add new item menu in VS
Create an additional feature (web) with a list template (Your documents Library and add your column)
Update the Web templates onet file
Also sometimes it's better to put up what your having issues with as you have said you have had no luck with the above, What is the issue you are having, Post some code up etc rather than going down the route of changing the way you implement the solution
Many Thanks
Truez

How do I build custom workflows in SharePoint?

I need to learn how to build custom workflows in SharePoint. In addition to basic stuff like having legal sign-off on documents, I need to be able to execute arbitrary custom code at certain points. For example, after legal signs off it should export the document and update a database table indicating that a new version is ready.
Is this possible using SharePoint? If so, where can I find the documentation or tutorials I would need to get started?
Getting Started Link 1,Getting Started Link 2 links will help you to get started with the SharePoint Custom Workflows. And also it is possible to do any arbitrary code inside the workflow. Also there is another type of work flow called State machine for which there is a class one article
Workflow as the whole is built using sub parts called Activities which dictates what the workflow should do at a particular point of time, I remember you have an activity called Code Activity which will help you to achieve what you want.
Robert Shelton's Workflow Video Tutorial series is very helpful:
http://rshelton.com/Tags/Workflow/default.aspx

Resources