Sharepoint REST API + unable to Update Extended properties - sharepoint

Currently we are consuming Sharepoint 2013 REST API; As per requirement we need to update certain extended properties. e.g. "IsCompleted" property of workflow.
Currently we are using following link for rest api
http://msdn.microsoft.com/en-us/library/office/jj860569(v=office.15).aspx
Can you please help out to resolve this issue.
Thanks in advance

This is a read only property. You cannot update it. There is no setter.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflow.iscompleted(v=office.15).aspx
And logically too, this property would reflect the current state of workflow. To mark it completed, you would have to complete the workflow.

Related

SharePoint List 'NoCrawl' with Graph API

The SharePoint API to GET a list, shows the boolean property 'NoCrawl' in its response. This property can be set by altering the settings for the Search availability and Offline access through the settings.
GET https://{site_url}/_api/web/lists/GetByTitle('List Title')
However the Graph API counterpart doesn't have this property.
GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/
Update - Seems there is no way right now other than using the old SharePoint API itself. I'll keep the question open if in case the feature in inculcated.
As Shiva updated there is no such property called NoCrawl as of now in the public document and any relationship for expanding even in beta. Being said that I remember a related thread which works in SharePoint online rest api, which you may want to give a try with Microsoft Graph and see if it helps your scenario.

How to copy Notes and Activities while converting Contact to Lead in Microsoft Dynamics CRM 2011

I have a requirement to copy all Notes and Activities while converting Lead to Contact and vice versa.
When I Qualifying Lead to Contact I use my custom plugin which is triggered by QualifyLead event. There is no out of the box solution to convert Contact to Lead so I use my custom on-demand dialog. But this dialog unable to run my custom plugin (which will copy Notes and Activities from Contact to Lead).
Please help me to find a way to copy all this stuff from Contact to Lead.
You can create a Custom Workflow Activity with the code of your custom plugin and uses as step inside your on-demand dialog.
You can start from here:
http://msdn.microsoft.com/en-us/library/gg328515.aspx
Another way that you can do this is to simply reference the notes from the Lead in the Contact, Account, or Opportunity entities using an IFrame and some JavaScript as described in http://030bacf.netsolhost.com/WordPress/?cat=69 . Depending on how many records you have, potentially this could even be a better solution since you are only keeping one copy of the notes which will help keep the size of the database more manageable and performance better. Or you could use this solution for the notes and the solution recommended by Guido for the Activity records. I had to make a change to the URL used for CRM 2013 and have copied that part below.
//src="/"+context.getContext().getOrgUniqueName()+"/_controls/note/notesdata.aspx?id="+lookupItem[0].id+"&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false";
// change to this for CRM 2013
src=serverUrl+"/"+Xrm.Page.context.prependOrgName("/_controls/notes/notesdata.aspx?id="+lookupItem[0].id+"&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false");

How to edit Workflow steps via API?

In my solution I have a workflow where one step contains a reference to Queue. After importing this solution on another CRM instance this workflow could not be activated because it contains an invalid reference - Queue can not be resolved. Queue with same name is created on new CRM but resolving is probably based on record Guid.
Now, I'm wondering, is there a way to edit workflow steps using CRM SDK? Whole process of CRM solution deployment is automated. And I want to remove all manual work. Some example would be great :)
Thanx in advance!
There are 2 things you can do if you are having issues with the Guids not matching in a workflow lookup when deploying from one environment to another.
Use the API to create those records referenced in the WF. When you create a record you can actually specify the Guid that it uses as the id. So write a tool or see if one exists already that will create some default data for your environment.
Use a configuration entity with references to all the EntityRefrences needed in your WFs. Then you can create a custom workflow activity to retrieve the configuration entity record (there should only ever really be one) that contains all the references in that environment.

How to differentiate a programmatic delete from an application delete in crm 2011 plugins

I have an entity with a pre delete plugin. Is it possible to differentiate in the plugin if the delete request has been issued manually in crm or programmatically using the crmservice from the sdk?
As far as I know is not possible to differentiate inside a plugin a request made by web interface from another made using the sdk.
You could infer it from other information.
If you know a particular user who will always be performing the delete (e.g. a service account), then you could inspect IPluginExecutionContext.InitiatingUserId.
Or you could have a 'delete by service' field, don't put that field on the form, then before you issue your delete via the crmservice, update that field to a known value. Then your plugin can just inspect that field.
Not quite as elegant as inspecting an origin field, but you should be able to perform the logic you need.

CRM 2011 workflow to update sharepoint document field

Can anyone tell me if it is possible to update a sharepoint document field from a CRM2011 workflow?
Thanks, Nuno
Yes. In order to do, within the context of the CRM2011 Workflow, you would need have a reference to the SharePoint url, and the item that you want to update. you would also need to have access to the SharePoint environment.
this would have to be done in a Custom workflow assembly or an asynchronous plugin.
If you add more detail to your question, I may be able to give you a more detailed answer.

Resources