Skip to main content

I have a custom object “Art_Request__c”.  This object contains a number of fields - Account, Book, etc.  I have a Skuid page that is launched from an Account and pulls in records related to the account.  On one of the page tabs I have a table that shows records from an object related to the Account…I want to use a Row Action to somehow create a new Art Request and prepopulate some its fields with data contained in one of the rows (records) of the related object table.  Is this possible?

Eric,


Using a Row Action, you can create a new record of any type. You just need to use the Create new row(s) model action. You can pre-populate the new row with values from the row of your table object. You can create a new row in the same model as your table or setup a different model and create a different object.


Here is a sample page that shows an Account with related Contacts and Events. Look at the Meetings tab for a row action to clone the event. I use a different model but create the same type of object. When I create the new event (meeting), I copy the Description from the current row (i.e. current meeting).


Thanks,


Bill


<skuidpage unsavedchangeswarning="" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Account">
<models>
<model id="Account" limit="1" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account" type="">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
<field id="Id"/>
<field id="Description"/>
<field id="SicDesc"/>
</fields>
<conditions>
<condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
</conditions>
<actions/>
</model>
<model id="Contacts" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Contact">
<fields>
<field id="RecordTypeId"/>
<field id="AccountId"/>
<field id="Account.Name"/>
<field id="Name"/>
<field id="Phone"/>
<field id="Email"/>
<field id="FirstName"/>
<field id="LastName"/>
</fields>
<conditions>
<condition type="modelmerge" value="" field="AccountId" fieldtargetobjects="Account" operator="=" model="Account" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
</conditions>
<actions/>
</model>
<model id="NewMeeting" limit="1" query="false" createrowifnonefound="false" datasource="salesforce" type="" sobject="Event">
<fields>
<field id="Description" overridemetadata="true" ogdisplaytype="TEXTAREA" displaytype="MULTIPICKLIST" picklistsource="rowsinmodel" picklistmodel="Contacts" entryvalue="{{Name}}"/>
<field id="EndDateTime"/>
<field id="WhatId"/>
<field id="What.Name"/>
<field id="StartDateTime"/>
</fields>
<conditions>
<condition type="modelmerge" value="" field="WhatId" fieldtargetobjects="Account,Asset,AssetRelationship,Campaign,Case,ChannelProgram,ChannelProgramLevel,Contract,Ghost__c,Goal,LiveAgentSession,LiveChatTranscript,Metric,Opportunity,Order,PartnerFundAllocation,PartnerFundClaim,PartnerFundRequest,PartnerMarketingBudget,Product2,Quote,Solution,Store__c,WorkCoaching" operator="=" model="Account" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
</conditions>
<actions/>
</model>
<model id="Meetings" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Event">
<fields>
<field id="Description" overridemetadata="true" ogdisplaytype="TEXTAREA" displaytype="MULTIPICKLIST" picklistsource="rowsinmodel" picklistmodel="Contacts" entryvalue="{{Name}}"/>
<field id="EndDateTime"/>
<field id="WhatId"/>
<field id="What.Name"/>
<field id="StartDateTime"/>
</fields>
<conditions>
<condition type="modelmerge" value="" field="WhatId" fieldtargetobjects="Account,Asset,AssetRelationship,Campaign,Case,ChannelProgram,ChannelProgramLevel,Contract,Ghost__c,Goal,LiveAgentSession,LiveChatTranscript,Metric,Opportunity,Order,PartnerFundAllocation,PartnerFundClaim,PartnerFundRequest,PartnerMarketingBudget,Product2,Quote,Solution,Store__c,WorkCoaching" operator="=" model="Account" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
</conditions>
<actions/>
</model>
</models>
<components>
<pagetitle model="Account" uniqueid="sk-2QWWAR-202">
<maintitle>
<template>{{Name}}</template>
</maintitle>
<subtitle>
<template>{{Model.label}}</template>
</subtitle>
<actions>
<action type="multi" label="New Meeting" uniqueid="sk-2QXIzI-572" icon="sk-icon-calendar">
<actions>
<action type="emptyModelData">
<models>
<model>NewMeeting</model>
</models>
</action>
<action type="createRow" model="NewMeeting" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context"/>
<action type="showPopup">
<popup title="New Meeting for {{$Model.Account.data.0.Name}}" width="70%">
<components>
<pagetitle model="Meetings" uniqueid="sk-2QYLSx-1070">
<actions>
<action type="multi" label="Save" uniqueid="sk-2QYOdC-1083" icon="sk-icon-save">
<actions>
<action type="blockUI" message="Saving new meeting..."/>
<action type="save" rollbackonanyerror="true">
<models>
<model>NewMeeting</model>
</models>
<onerroractions>
<action type="blockUI" message="There was an error" timeout="3000"/>
<action type="unblockUI" message="There was an error" timeout="3000"/>
</onerroractions>
</action>
<action type="requeryModel" model="Meetings" behavior="standard"/>
<action type="closeTopmostPopup"/>
<action type="unblockUI"/>
</actions>
</action>
<action type="multi" label="Cancel" uniqueid="sk-2QYOjy-1087" icon="sk-icon-cancel">
<actions>
<action type="cancel">
<models>
<model>NewMeeting</model>
</models>
</action>
<action type="closeTopmostPopup"/>
</actions>
</action>
</actions>
</pagetitle>
<basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="NewMeeting" buttonposition="" uniqueid="sk-2QXk4G-824" mode="edit">
<columns>
<column width="50%">
<sections>
<section title="Section A" collapsible="no">
<fields>
<field uniqueid="sk-2QXsBq-876" id="Description"/>
</fields>
</section>
</sections>
</column>
<column width="50%">
<sections>
<section title="Section B" collapsible="no">
<fields>
<field uniqueid="sk-2QXnRl-852" id="StartDateTime" valuehalign="" type=""/>
<field uniqueid="sk-2QXnRk-851" id="EndDateTime"/>
<field uniqueid="sk-2QXpHs-866" id="WhatId"/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
</popup>
</action>
</actions>
</action>
<action type="savecancel" window="self" uniqueid="sk-2QWWAQ-200">
<models>
<model>Contacts</model>
</models>
</action>
</actions>
</pagetitle>
<tabset rememberlastusertab="true" defertabrendering="true" uniqueid="sk-2QWXyN-243" renderas="">
<tabs>
<tab name="Details">
<components>
<basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read" uniqueid="sk-2QWWB0-218" buttonposition="">
<columns>
<column width="50%">
<sections>
<section title="Basics" collapsible="no">
<fields>
<field id="Name" uniqueid="sk-2QWWAd-210"/>
<field uniqueid="sk-2dmOvS-308" id="Description"/>
<field uniqueid="sk-2dmOvS-309" id="SicDesc" valuehalign="" type="" readonly="true"/>
</fields>
</section>
</sections>
</column>
<column width="50%">
<sections>
<section title="System Info">
<fields>
<field id="CreatedDate" uniqueid="sk-2QWWAr-216"/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
</tab>
<tab name="Contacts" loadlazypanels="true">
<components>
<skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="Contacts" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-2QWmiR-411">
<fields>
<field id="FirstName" hideable="true" uniqueid="fi-3T0rGk-360" valuehalign="" type=""/>
<field id="LastName" hideable="true" uniqueid="fi-3T0rGk-361" valuehalign="" type=""/>
<field id="Phone" hideable="true" uniqueid="fi-2QWrE9-443"/>
<field id="Email" hideable="true" uniqueid="fi-2QWrE9-444"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
</tab>
<tab name="Meetings" loadlazypanels="true">
<components>
<skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="Meetings" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-2QYCTE-997">
<fields>
<field id="Description" hideable="true" uniqueid="fi-2QYEC--1017" selectedlist="3" valuehalign="" type=""/>
<field id="StartDateTime" hideable="true" uniqueid="fi-2QYED0-1018" valuehalign="" type=""/>
<field id="EndDateTime" hideable="true" uniqueid="fi-2QYEC--1016"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
<action type="multi" label="Create New Meeting" icon="sk-icon-clone">
<actions>
<action type="emptyModelData">
<models>
<model>NewMeeting</model>
</models>
&nbsp