CSM 10.2.2 Documentation

Home

Configure Web-Forms to Run One-Step Actions

You can configure Cherwell Web-Forms™ to automatically run a One-Step™ Action.

To run a One-Step Action from a Web-Form:

Create Config File for Each Business Object

  1. Create or edit a One-Step Action that fits the needs of your organization's Web-Forms.
  2. Create a web.config file for each Business Object that is involved in the One-Step Action (example: Change and E-mail).
Example code:
<WebFormActions Name="Change"><ActionList><Action Name="Approve">       <OneStep Scope="Global" ScopeOwner="">Approve Change</OneStep>         <HeaderText AppendObjectID="true">Approving Incident</HeaderText>         <SuccessText>Your change has been approved.</SuccessText>         <FailureText>Unable to approve your change. The system reported the following error:</FailureText>      </Action>      <Action Name="Deny">         <OneStep Scope="Global" ScopeOwner=" ">Deny Change</OneStep>         <HeaderText AppendObjectID="true">Denying Change</HeaderText>         <SuccessText>Your change has been denied.</SuccessText>         <FailureText>Unable to deny change. The system reported the following error:</FailureText>      </Action>   </ActionList></WebFormActions>

Create a URL to Run a Web-Forms One-Step

Users can run the One-Step Action by using a URL:

                                http://ServerNameorIP/CherwellWebForms/Action.aspx?BusObName=Change&RecId=1692&Action=Approve
        
      
                            

The Action.aspx page is used for running One-Step Actions.

There are three parameters you pass in the URL string:

  • BusObName: Business Object that the One-Step Action runs against.
  • RecId: ID of particular record to run against (only needed if the One-Step Action is running against an existing Business Object).
  • Action: Name of the <Action> to run in the config file.
If desired, you can leave off the BusObName parameter and instead add a DefaultActionObject entry in the appSettings section of the web.config file.
<appSettings>            <add key="LoginName" value="Henri"/>            <add key="LoginPassword" value="password"/><add key="DefaultActionObject" value="Change" />            <add key="TrebuchetDataSource" value="[Common]Cherwell Browser"/>      </appSettings>
Note: If the DefaultActionObject is not specified in the web.config file it must specified in the URL string.
Parameters such as View, New, or Edit can also be established on the URL used to open a Web-Form. Incorporate the following parameters into your web.config file if desired:
  • cmd: New, Edit, View.
  • BusObName: Any Cherwell Business Object. If not passed, the one in the web.config file is used.
  • RecID: If csm=View or cmd=Edit ensure that the parameter contains the Record ID of the Business Object.

Create a Customized HTML Page

If desired, create a custom HTML page to display to the user after visiting the Web-Form.

Example lines of code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head>    Action for Incident</title></head><body><p>Business Object Definition's DisplayName: $$(DisplayName)$$</p><p>Business Object Definitions's PluralDisplayName: $$(PluralDisplayName)$$</p><p>Business Object Definitions's Image: <img src='$$(Image)$$' /> </p><p>Record ID: $$(RecordID)$$</p><p>Header: <b>$$(Header)$$</b></p><p>Message: $$(Message)$$</p></body></html>
Use any of the following variables, in any order, and as many times as needed:
  • $$(DisplayName)$$
  • $$(PluralDisplayName)$$
  • $$(Image)$$
  • $$(RecordID)$$
  • $$(Header)$$
  • $$(Message)$$

Good to Know

  • There are several web.config files used by CSM.
  • When an application starts, the web.config file is backed up in a separate folder.
  • Content of the web.config files is retained during both upgrade and reinstallation, so any changes you make to web.config files are preserved.

Was this article useful?