Can't select field for Default Value field of "Create New Row(s)" action within "Action Sequence"

Pat VachonPat Vachon Member ✭✭
edited June 25 in Problems
image
Tagged:

Comments

  • Luzie BaumgartLuzie Baumgart Skuid Mod
    edited March 2018
    Thank you for the screenshot. Can you reproduce this issue after re-opening the page in the composer?

    Looks like it was possible before to select "RecordTypeID" as field. I can reproduce the scenario shown in the screenshot if I do the following:

    1. create a new action sequence
    2. add the action "Create new row(s)"
    3. select an existing model (which is listed in "Models" on the left below "Components")
    4. add a default value, all model fields are available
    5. go to tab "Inputs" and create a new input with type = model
    6. go back to tab "Actions" and to action type "Create new row(s)"
    7. change "Model" from existing model to the new model (input) that I created in step 5
    8. add a default value and try to select a field

    Now there are no fields available because the input model has no fields, yet. You should see fields if you go to "Inputs" of your action sequence and add input fields for your input model. If you did the latter and still see no fields, please let me know which version you are currently using. Could you please also share a screenshot of the "Inputs" tab?
  • Pat VachonPat Vachon Member ✭✭
    edited June 25
    The issue is seemingly only present when the default value is being set for a new row in an input model in an action sequence. The default value in the that was set in the provided screenshot was set before I converted to an Action Sequence.
  • Luzie BaumgartLuzie Baumgart Skuid Mod
    edited June 25
    Hi Pat,
    We are excited to see that you are using the new action sequence features in Millau. Sorry that you are running into issues. We want to make sure that the new features are easy to use. If you can reproduce this on a new page that only includes the necessary components and standard salesforce objects and fields, could you please paste the XML here? I'll be happy to investigate. 
  • Pat VachonPat Vachon Member ✭✭
    edited April 2018
    Here you go. 2 pics that point out the issue. Creating a new row in an action sequence using input model doesn't allow for the selection of a field for a default value.

    image

    image
    <skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">     <models>         <model id="Task" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Task">             <fields>                 <field id="CallDurationInSeconds"/>                 <field id="Description"/>             </fields>             <conditions/>             <actions/>         </model>     </models>     <components>         <pagetitle model="Task" uniqueid="sk-2Ltu-247">             <maintitle>                 <template>{{Subject}}</template>             </maintitle>             <subtitle>                 <template>{{Model.label}}</template>             </subtitle>             <actions>                 <action type="multi" label="Create Task" uniqueid="sk-2Ltu-252">                     <actions>                         <action type="action-sequence" action-sequence-id="e1a259bb-a454-44b8-9420-4c34be1a1cc8">                             <inputs>                                 <input name="Task Model" value="Task"/>                             </inputs>                         </action>                     </actions>                 </action>             </actions>         </pagetitle>         <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Task" uniqueid="sk-2Ltu-337" mode="edit">             <columns>                 <column width="100%">                     <sections>                         <section title="Section A" collapsible="no">                             <fields>                                 <field uniqueid="sk-2Ltu-352" id="CallDurationInSeconds"/>                                 <field uniqueid="sk-2Ltu-353" id="Description"/>                             </fields>                         </section>                     </sections>                 </column>             </columns>         </basicfieldeditor>     </components>     <resources>         <labels/>         <javascript/>         <css/>         <actionsequences uniqueid="sk-2Ltu-303">             <actionsequence id="e1a259bb-a454-44b8-9420-4c34be1a1cc8" label="Create New Row" type="reusable">                 <actions>                     <action type="createRow" model="{{$Input.Task Model}}" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">                         <defaults>                             <default type="fieldvalue" field="CallDurationInSeconds" fieldtargetobjects="Task" enclosevalueinquotes="false" value="60"/>                             <default type="fieldvalue" value="Now I can't select the field when there's an input model being used."/>                         </defaults>                     </action>                 </actions>                 <description/>                 <inputs>                     <input type="model" name="Task Model"/>                 </inputs>             </actionsequence>         </actionsequences>     </resources>     <styles>         <styleitem type="background" bgtype="none"/>     </styles> </skuidpage>  
  • Luzie BaumgartLuzie Baumgart Skuid Mod
    edited April 2018
    Thank you for the screenshots and the XML. Let me shed some light on the additional options of "Create new row(s)" in an Action Sequence. As usual, you could select an existing model and its fields, e.g. the model "Task" of your sample page. This model would be fix in the Action Sequence. And you are able to select its fields and enter default values. Wherever you use this Action Sequence, it will create a new row in the model "Task". If that is the desired result, please choose "Task" as model in the Action Sequence (not "Task Model" as seen in your second screenshot).

    But maybe you want to create a more general Action Sequence that creates a new row in a model, without having an existing model assigned fix. So that you can use it several times on your page and choose a different models. More like a template Action Sequence with flexible model settings. Wherever you use this Action Sequence, you will be able to select a model (and its fields) individually. Therefore you can use the tab "Inputs". I can see that you already created a model input named "Task Model ". Since you selected this in the Action Sequence instead of the model "Task", you can no longer see the "Task" model fields.

    Next step would be to create a model field input. As soon as you created a model field input, this is what you will see in the list of fields for that input model. You can select it and enter a default value. More information can be found in our documentation here: https://docs.skuid.com/latest/en/skuid/action-framework/action-sequences/#reusable-action-sequences

    I adjusted your page and it contains two samples of the action sequence now: one Action Sequence which creates a new row in the model "Task". And another Action Sequence which uses variable model and model field inputs. I also added two more models and buttons to show the flexibility of the variable inputs.

    Please find the sample XML below and let me know if this is helpful for you. Thanks!
  • Luzie BaumgartLuzie Baumgart Skuid Mod
    edited April 2018
    <skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" useviewportmeta="true" showheader="false">
        <models>
            <model id="Task" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Task">
                <fields>
                    <field id="CallDurationInSeconds"/>
                    <field id="Description"/>
                </fields>
                <conditions/>
                <actions/>
            </model>
        <model id="Account" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Account">
    <fields>
        <field id="RecordTypeId"/>
        <field id="Name"/>
    </fields>
    <conditions/>
    <actions/>
    </model>
    <model id="Opportunity" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity">
        <fields>
            <field id="RecordTypeId"/>
            <field id="Name"/>
        </fields>
        <conditions/>
        <actions/>
    </model>
    </models>
        <components>
            <pagetitle model="Task" uniqueid="sk-2Ltu-247">
                <maintitle>
                    <template>{{Subject}}</template>
                </maintitle>
                <subtitle>
                    <template>{{Model.label}}</template>
                </subtitle>
                <actions>
                    <action type="multi" label="Create Task" uniqueid="sk-2Ltu-252">
                        <actions>
                            <action type="action-sequence" action-sequence-id="e1a259bb-a454-44b8-9420-4c34be1a1cc8">
                                <inputs>
                                    <input name="Task Model" value="Task"/>
                                </inputs>
                            </action>
                        </actions>
                    </action>
                <action type="multi" label="Create Opportunity" uniqueid="sk-2MCJ-1618">
    <actions>
        <action type="action-sequence" action-sequence-id="72eab9c8-6341-4b5a-8f04-f54d2bf6139e" input-Field1="Name">
            <inputs>
                <input name="Model1" value="Opportunity"/>
                <input name="Field1" value="Name"/>
            </inputs>
        </action>
    </actions>
    </action>
    <action type="multi" label="Create Account" uniqueid="sk-2MCJ-1622">
        <actions>
            <action type="action-sequence" model="Task" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context" action-sequence-id="72eab9c8-6341-4b5a-8f04-f54d2bf6139e" input-Field1="Name">
                <inputs>
                    <input name="Model1" value="Account"/>
                    <input name="Field1" value="Name"/>
                </inputs>
            </action>
        </actions>
    </action>
    </actions>
            </pagetitle>
            <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Task" uniqueid="sk-2Ltu-337" mode="edit">
                <columns>
                    <column width="100%">
                        <sections>
                            <section title="Section A" collapsible="no">
                                <fields>
                                    <field uniqueid="sk-2Ltu-352" id="CallDurationInSeconds"/>
                                    <field uniqueid="sk-2Ltu-353" id="Description"/>
                                </fields>
                            </section>
                        </sections>
                    </column>
                </columns>
            </basicfieldeditor>
    <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Opportunity" uniqueid="sk-2MCJ-2470" mode="edit">
        <columns>
            <column width="100%">
                <sections>
                    <section title="Section A">
                        <fields>
                            <field id="Name" uniqueid="sk-2MCJ-2481">
                                <label>Opportunity name</label>
                            </field>
                        </fields>
                    </section>
                </sections>
            </column>
        </columns>
    </basicfieldeditor>
        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Account" uniqueid="sk-2MCJ-2401" mode="edit">
    <columns>
        <column width="100%">
            <sections>
                <section title="Section A">
                    <fields>
                        <field id="Name" uniqueid="sk-2MCJ-2412"/>
                    </fields>
                </section>
            </sections>
        </column>
    </columns>
    </basicfieldeditor>
    </components>
        <resources>
            <labels/>
            <javascript/>
            <css/>
            <actionsequences uniqueid="sk-2Ltu-303">
                <actionsequence id="e1a259bb-a454-44b8-9420-4c34be1a1cc8" label="Create New Row in Task model" type="reusable" uniqueid="sk-2MCJ-2019">
                    <actions>
                        <action type="createRow" model="Task" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
                            <defaults>
                                <default type="fieldvalue" field="CallDurationInSeconds" fieldtargetobjects="Task" enclosevalueinquotes="false" value="60"/>
                                
                            </defaults>
                        </action>
                    </actions>
                    <description>This action sequence creates a new row in the model "Task"</description>
                    <inputs>
                        
                    </inputs>
                </actionsequence>
            <actionsequence id="72eab9c8-6341-4b5a-8f04-f54d2bf6139e" label="Create new row in any model" type="reusable" uniqueid="sk-2MCJ-2021">
    <description>This action sequence creates a new row in an input model. Choose the respective model and field in the button action.</description>
    <actions>
        <action type="createRow" model="{{$Input.Model1}}" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
            <defaults>
                <default type="fieldvalue" field="{{$Input.Field1}}" enclosevalueinquotes="true" value="default value of your choice"/>
            </defaults>
        </action>
    </actions>
    <inputs>
        <input type="model" name="Model1"/>
        <input type="model-field" name="Field1" model-source="Model1"/>
    </inputs>
    </actionsequence>
    </actionsequences>
        </resources>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
    </skuidpage>

  • Pat VachonPat Vachon Member ✭✭
    edited April 2018
    Ugh .... I guess we're not communicating properly. This is a bug where if you select an input model to create a new row in an action sequence, the option to select a field for a defult value is not possible.

    Of course I can perform a work around.

    So please reproduce for engineers to address. ;)
  • edited April 2018
    Hello Pat
    Luzie just got me involved in this potential issue. It indeed seems like there is a bit of misunderstanding. But as far as we can tell, the behaviour of Inputmodels seem to work as intended.

    I've made you an example based on the Page Luzie built to reproduce the issue:

    Inputmodels in action sequences are just placeholder JS objects with no connection to an actual model until you call the action sequence. This is intentional, since Inputmodels are intended as placeholders.

    imageimage


    So when you select an Inputmodel rather than a regular model for your Action, you can only select the fields you defined within your placeholder model. (Since you defined no Fields for your Input timeoffmodel, no selectable fields show for rowcreation)


    If you choose to use Inputmodels, upon calling of the action sequence you have the ability to choose what your placeholder Model & Its field represent.
    image
    image

    Please let me know if this explanation fits your problem or if you need a more in depth description

    Regards

  • Pat VachonPat Vachon Member ✭✭
    edited April 2018
    I understand the explanation. I don't the reasoning though. 

    As a user, I wouldn't be privy to this construct of "placeholders" when clicking on the select field button. To alleviate this I suggest displaying a message that only input fields can be selected when selecting a input model.
  • Luzie BaumgartLuzie Baumgart Skuid Mod
    edited April 2018
    Thank you for your feedback! I suggested it to the responsible team :-)
Sign In or Register to comment.