Archives

Archives / 2015 / June
  • How to Move to Next Stage Automatically in Business Process Flow

    Microsoft Dynamics CRM 2015 supports Next Stage Automatically. This action is possible in CRM Form’s current selected

    Business Process Flow via JavaScript.Write scripts for business process flows

     

    desc1

     

    Using JavaScript saves the Microsoft CRM users time from manually clicking on the “Next Stage” in order to advance to the next Stage.  It also checks if the stage advance conditions have been met before advancing.

    Here is an example JavaScript that I would call from the CRM Form’s OnSave event:

    function MoveNextStage()) {

        var selectedProceess = Xrm.Page.getAttribute(“new_processselection”);
        var selectedProcessValue = selectedProcess.getValue();
        if (selectedProcessValue == 2) {
            //Set Guid for Sales Order Prcoess 1

            Xrm.Page.getAttribute(“processid”).setSubmitMode(“always”);
            Xrm.Page.getAttribute(‘processid’).setValue(‘stage guid′);

            //Set Guid for Sales Order Prcoess 1 Stage Propose
            Xrm.Page.getAttribute(“stageid”).setSubmitMode(“always”);
            Xrm.Page.getAttribute(‘stageid’).setValue(‘stage guid′);

            //Call Entity save
            Xrm.Page.data.entity.save();

            //Call window refresh
            window.location.reload(true);
        }
    }

  • Basic Mathematical Operations

    •  Mathematical calculations simply includes plus (+), minus (-), divide (/) and multiply (*) operations.
    •  For Execution, Three input properties and one output property is required.

     

    Input Properties:

    1.Field with Decimal Type for taking first number as input.

    2. Field with Decimal Type for taking second number as input.

    3. Field with String Type for taking symbol as input for required MATH operation. (+|-|*|/).

    1

     

    Output PropertiesField with Decimal Type for holding the Result.

    2

    Execution Steps of Workflow:

    •  Write the Source code and register the dll file using plugin registration tool.
    •  Go to “Processes” Entity and create new process by clicking on NEW.

     

    3

    • ·Enter Process Name, Select category as Workflow, Select Entity on which you wish to fire and Check Type as New blank Process. Click on Ok.

     

     

    4

    • Check “START WHEN”, this decides when your workflow should fire.

     

     

    5

    •  Click on Add Step, select your workflow.
    •  Add another step “UPDATE RECORD” for output to display. This displays the output when the record is updated.

     

    6

    •  Now Click on Set Properties to set input and output properties.
    • Activate the Process by clicking on “Activate ” button.
    • Select the required entity and fields and click Add then OK.

     

     

    7

     

    • Select the field which displays output and set workflow into it by clicking on entity fields and click add and then ok.

     

    8

    •  This completes the setting of input and output properties.
    •  Now go to entity forms and provide input values and click on save.
    •  Check into system jobs entity to know whether the workflow got succeeded or not.

     

    Conversion of Field Types:

    •  This simply includes converting one field type to another.(String –>Decimal,Double,Money)
    •  For execution one input and one output properties are required.

     

    Input property:  Field with String Type for taking input.

    Output property: Field with Decimal Type for displaying output.

    Execution Steps of Workflow:

    • Write the source code and register it with plugin registration tool.
    •  Go to Process Entity, Create new process by giving all the required data.
    •  Check “START WHEN” to decide when the workflow should fire.
    •  Click on Add Step, select your workflow.
    •  Add another step “UPDATE RECORD” for output to display. This displays the output when the record is updated.
    • Now Click on Set Properties to set input and output properties.

     

     

    9

     

    •  For input select the entity and also the field to give input value and then click on add and ok.

     

    10

    • For output select the workflow and the type, click on add and then ok.
    •  This completes the setting of input and output properties.
    •  Now go to entity forms and provide input values and click on save.
    •  Check into system jobs entity to know whether the workflow got succeeded or not.
  • Basic Date Time Operations

    Date Time Operations provide functionalities to find

    1. First Working Day by subtracting particular Days from a specified Date using Calendar Entity Data.

    2. Last Working Day by Adding particular Days from a specified Date Calendar Entity Data

    3. To get number of days on difference between of two Dates.

    4. To ‘Day of the Week’, ’Day of the Month’, ‘Day of the Year’ for specified Date.

    Execution of the each function or operation of above specified requires different set of Input and output properties.


    Execution Steps of Workflow

    · Write the Source code and register the dll file using plugin registration tool.

    · Go to “Processes” Entity and create new process by clicking on NEW. 

    clip_image002[10]

    · Enter Process Name, Select category as Workflow, Select Entity on which you wish to fire and Check Type as New blank Process. Click on Ok.


    clip_image004[5]

     

    · Check “START WHEN”, this decides when your workflow should fire.

    clip_image006[5]

     

    · Click on Add Step, select your workflow.

    · Add another step “UPDATE RECORD” for output to display. This displays the output when the record is updated.

    clip_image008[4]

     

    · Now Click on Set Properties to set input and output properties.

    · Activate the Process by clicking on “Activate ” button.

     

    1. Last Working Day Operation

    For execution four input properties and one output property is required

    Input Properties: 
    1. Field with Date Type as first Input parameter to take date.
    2. Field with Whole Number Type or Constant / Fixed Value as second Input parameter to specify the number of days.
    3. Field with Whole Number Type or Constant / Fixed Value as third Input parameter to specify the number of Hours.
    4. Field with Whole Number Type or Constant / Fixed Value as fourth Input parameter to specify the number of Minutes.
    Output Properties:
    1. Field with Date Type as Output parameter to set date.

     

    · Select the required entity and fields and then click Add then OK.

    clip_image010[4]

     

    · Select the field which displays output and set workflow into it by clicking on entity fields and click add and then ok.

    clip_image012[4]

     

    · This completes the setting of input and output properties.

    · Now go to entity forms and provide input values and click on save.

    · Check into system jobs entity to know whether the workflow got succeeded or not.

     

    2. First Working Day Operation


    For execution four input properties and one output property is required

    Input Properties: 
    1. Field with Date Type as first Input parameter to take date.
    2. Field with Whole Number Type or Constant / Fixed Value as second Input parameter to specify the number of days.
    3. Field with Whole Number Type or Constant / Fixed Value as third Input parameter to specify the number of Hours.
    4. Field with Whole Number Type or Constant / Fixed Value as fourth Input parameter to specify the number of Minutes.
    Output Properties:
    1. Field with Date Type as Output parameter to set date

    · Select the required entity and fields and then click Add then OK.
    clip_image014[4]

     

    · Select the field which displays output and set workflow into it by clicking on entity fields and click add and then ok.

    clip_image016[4]

     

    · This completes the setting of input and output properties.

    · Now go to entity forms and provide input values and click on save.

    · Check into system jobs entity to know whether the workflow got succeeded or not.

     

    3. Difference of Two Dates


    For execution two input properties and one output property is required

    Input Properties: 
    1. Field with Date Type as first Input parameter to take date1.
    2. Field with Date Type as second Input parameter to take date2.

    Output Properties:
    1. Field with Whole Number Type as Output parameter to set Days.

    · Select the required entity and fields and then click Add then OK.
    clip_image018[4]

     

    · Select the field which displays output and set workflow into it by clicking on entity fields and click add and then ok.

    clip_image020[4]

     

    · This completes the setting of input and output properties.

    · Now go to entity forms and provide input values and click on save.

    · Check into system jobs entity to know whether the workflow got succeeded or not.

    4. Day of the Week, Month and Year


    For execution one input properties and three output property is required

    Input Properties: 
    1. Field with Date Type as first Input parameter to take date.
    Output Properties:
    1. Field with Whole Number Type as first Output parameter to set Day of Week.
    2. Field with Whole Number Type as second Output parameter to set Day of Month.
    3. Field with Whole Number Type as third Output parameter to set Day of Year.


    Select the required entity and fields and then click Add then OK.
    clip_image022[4]

     

    · Select the field which displays output and set workflow into it by clicking on entity fields and click add and then ok.
    clip_image024[4]

     

    · This completes the setting of input and output properties.

    · Now go to entity forms and provide input values and click on save.

    · Check into system jobs entity to know whether the workflow got succeeded or not.

    The Basic Date and Time solution download here:    Download

  • Age Calculator (Date Time Operations)

    Date Time Operations provide Additional functionalities to find

    · Age Calculation provide exact age include years, months ,days, hours, minutes, seconds as Age Descriptor.

    · Age Calculation In Terms of Years, Months, Hours, Days, Minutes and Seconds also Available.

    Age Calculation:

    For execution four input properties and one output property is required

    Input Properties: 
    1. Field with Date Type as first Input parameter to take date.
    Output Properties:
    1. Field with Whole Number Type as first Output parameter to set Years.
    2. Field with Whole Number Type as second Output parameter to set the number of Months.
    3. Field with Whole Number Type as third Output parameter to set the number of Days.
    4. Field with Whole Number Type as fourth Output parameter to set the number of Hours.

    5. Field with Whole Number Type as fifth Output parameter to set the number of Minutes.

    6. Field with Whole Number Type as sixth Output parameter to set the number of Seconds.

    7. Field with String Type as seventh Output parameter to set the All Above Parameters as Single String.


    Execution Steps of Workflow

    · Write the Source code and register the dll file using plugin registration tool.

    · Go to “Processes” Entity and create new process by clicking on NEW. 

    clip_image002

    · Enter Process Name, Select category as Workflow, Select Entity on which you wish to fire and Check Type as New blank Process. Click on Ok.
    clip_image003

    · Check “START WHEN”, this decides when your workflow should fire.

    clip_image005

    · Click on Add Step, select your workflow.

    · Add another step “UPDATE RECORD” for output to display. This displays the output when the record is updated.

    clip_image007

    · Now Click on Set Properties to set input and output properties.

    · Activate the Process by clicking on “Activate ” button

    · Select the required entity and fields and then click Add then OK.

    clip_image009

    · Select the field which displays output and set workflow into it by clicking on entity fields and click add and then ok.

    clip_image011

    · This completes the setting of input and output properties.

    · Now go to entity forms and provide input values and click on save.

    · Check into system jobs entity to know whether the workflow got succeeded or not.

    Solution for Age Calculator Download from here    Download

  • Using Plugin Registration Tool

    Plugin Registration Tool 2015 can be downloaded from CRM 2015 SDK.

    Workflow Registration Steps

      • Run the Plugin Registration Tool from SDK(Path:SDK/Tools/Plugin Registration/Plugin Registration Tool)image

      • Create New Connection
        image

      • Register your Organization by providing required information and credentials.
        image

      • Click on Register Button and select Register New Assembly.
        image

         

      • Click on Browse button to select .dll file and click on Load Assembly.

      • Select the Select All Button to check workflows to register and then click on Register Selected Plugins.

        image

      • Click on OK.Now the dll file with workflows got registered.

        image

      • Registration process is now completed.

    Please Wait