Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Step - 1 : Create screen by name "main-decorator" in CommonScreens.xml file.(Take reference from CommonScreens.xml file of Example component.)

Code Block
<screen name="main-decorator">
        <section>
            <actions>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="PracticeUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="layoutSettings.companyName" from-field="uiLabelMap.PracticeCompanyName" global="true"/>
                <set field="activeApp" value="practice" global="true"/>
                <set field="applicationMenuName" value="PracticeAppBar" global="true"/>
                <set field="applicationMenuLocation" value="component://practice/widget/PracticeMenus.xml" global="true"/>
            </actions>
            <widgets>
                <include-screen name="GlobalDecorator" location="component://common/widget/CommonScreens.xml"/>
            </widgets>
        </section>
</screen>

...

- Here for the creation of record for person entity we will need to have the partyId for that so we will first call the service createPracticeParty then after getting the partyId we will create the record for person.
- Here we will be adding one add form in the bottom of the list form which we have for the person entity. This form will be calling the services for creating a record for person.
Step - 1 : Create the add form for the creation of person and add this in the same screen for person form.

Code Block

<form name="CreatePerson" type="single" target="createPracticePerson">
      <auto-fields-service service-name="createPracticePerson"/>
      <field name="submitButton" title="Create" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>

Step - 2 : Write CRUD operations for person entity.

this is a code for createPracticePerson,

Code Block

<service name="createPracticePerson" default-entity-name="Person" engine="simple"
          location="component://practice/script/org/hotwax/practice/PracticeServices.xml" invoke="createPracticePerson" auth="true">
     <description>Create a Person</description>
     <auto-attributes include="pk" mode="OUT" optional="false"/>
     <attribute name="salutation" mode="IN" type="String" optional="true"/>
     <attribute name="firstName" mode="IN" type="String" optional="false"/>
     <attribute name="middleName" mode="IN" type="String" optional="true"/>
     <attribute name="lastName" mode="IN" type="String" optional="false"/>
     <attribute name="suffix" mode="IN" type="String" optional="true"/>
</service>  

similar for Update and Delete 

Step - 3: Now convert the List form with editable field(Ref. ListExampleItems from ExampleForms.xml) and add Update and delete option with it and also in the same screen there is add form also.
Step - 4 :  Create controller entries for these services which are going to be called by this form.

...