Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

createCase(className, targetContext, options)

Updated on July 20, 2021

Creates a case and loads the view into a container.

Returns

An empty Promise.

Parameters

NameTypeDescriptionRequired
classNamestringThe name of the class that the created case should belong to.
targetContextstringThe context where the view must be loaded.
Note: If the value of targetContext is not provided, the default value is app.
optionsobjectThe JavaScript object containing the property that can be used to load a specific view.

The following table contains the properties of the options object:

NameTypeDescriptionRequired
pageNamestringThe name of the view that must be loaded into a container.
startingFieldsobjectThe JSON object that contains the fields to be set while creating a case.

Usage example

In this example, the API creates a case and updates the Redux Store.

const options = {
     pageName: "pyEmbedAssignment",
     startingFields: {
         FirstName: "Adam",
         LastName: "Smith",
         Vehicle: {
             Make: "Honda",
             Model: "Accord"
         }
     }
 };

PCore.getMashupApi().createCase('OXJ4P4-CoWin-Work-Feedback', options);

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us