-
Continue reading →: Activate or Deactivate record in CRM 2011
Hi, We can Activate\Deactivate record using “SetStateRequest“. Below is the code snippet. private void SetEntityStatus(IOrganizationService service, Guid recordGUID, string entityName) { SetStateRequest setState = newSetStateRequest(); setState.EntityMoniker = newEntityReference(); //Pass GUID of the record to be activated or Deactivated setState.EntityMoniker.Id = recordGUID; setState.EntityMoniker.Name = entityName; setState.EntityMoniker.LogicalName = entityName; //Setting ‘State’ i.e., (0 – Active ; 1 – InActive)…
-
Continue reading →: Set field values using query string parameters on Form load in CRM
Hi, I have got below requirement, I need to open a CRM form from my custom ‘.aspx’ page. On opening of the form I should populate “name” field with value After referring MSDN article, I came to know that we can set the field values using “extraqs” query string parameter and it must meet below…
-
Continue reading →: Execute the workflow from JScript In CRM
Hi, We can run the CRM workflows from JScript, if we know the GUID of the workflow. Below are the execution steps. Steps :- Get the GUID of workflow from name using OData Service (i.e., Using GetWorkflowIDByName(wfName) function ) Execute the Workflow using the GUID (i.e., Using TriggerWorkflow(workflowGuid) function) Below are the JScript…
-
Continue reading →: Unexpected error while bulk edit
Hi, You may come across below error screen when you try to bulk edit records. When you verify the event viewer for issue log, you may observe “Message: INVALID_WRPC_TOKEN: Validate WRPC Token: WRPCTokenState=Invalid” . Reason:- The fundamental problem is that CRM 2011 now expects additional parameters on the query string that contain a Token…
-
Continue reading →: Missing prvReadAsyncOperation privilege exception
Hi, Today my plug-in has thrown “Missing prvReadAsyncOperation privilege ” exception for user with one of the security role. Fix:- We need to grant Read Priveliege of System Job for the security role Open the Security Role and go to Customization tab Refer below screen Hope it helps 🙂
-
Continue reading →: Check user security role in Plug-ins CRM 2011
Hi, Below is the code snippet to check current user security role in Plug-in. private void CheckUserRole(IOrganizationService service, Guid userID) { QueryExpression query = new QueryExpression(); query.EntityName = “role”; //role entity name ColumnSet cols = new ColumnSet(); cols.AddColumn(“name”); //We only need role name query.ColumnSet = cols; ConditionExpression ce = new ConditionExpression(); ce.AttributeName = “systemuserid”; ce.Operator = ConditionOperator.Equal; ce.Values.Add(userID); //system roles LinkEntity linkRole = new LinkEntity(); linkRole.LinkFromAttributeName…
-
Continue reading →: How to change CRM form field’s label text and color using Jscript
Hi, Below is the sample JScript to change the color and text of CRM form field’s label; Place the code in JScript “onload” event // To change color if(crmForm.all.new_fieldname != null) { var field = crmForm.all.new_fieldname_c; //”_c” is the caption (i.e.,Label) if (field != null) field.style.color = ‘gray’; //Specify your…
-
Continue reading →: Case statement in Select clause
Hi, Below is a sample query that has “CASE statement” in SELECT clause SELECT EmpID, CASE WHEN Salary>=2000 THEN ‘High Salaried’ WHEN Salary<=1000 THEN ‘Medium’ ELSE ‘Below Bar’ END ‘New Column’, * FROM Employee Below is the screenshot for reference Hope it helps 🙂
-
Continue reading →: Workflows/Dialogs ownership in CRM 2011
Hi, Today i have come across useful article on “Ownership of Workflows ” below are few excerpts Q> Under what user’s context does the workflow execute? (If the workflow creates a record, who will be the owner of that new record?) Automatically triggered workflows (such as a workflow that triggers…


