Skip to main content

Hi,

Is there a way where we can move data from a Record X to Record Y where Both Record X and Record Y or of the same object called MyCustomObject.

This MyCustomObject is a detail object to a Master object called Entitlement.

So what i wanted to accomplish is,

I have an expired entitlement record called (My Entitlement1) and it is linked to an account called My Accounts. My Entitlement1 has a child record Called Record X(this Record X is from the object MyCustomObject) which is used to save information related to the Entitlement like no of licences, servers, no of operating systems etc.

Now, I have a another entitlement called My Entitlement2 and this Entitlement also belongs to the same account(My Accounts).  

Now, Record Y is child record to My Entitlement2 and the purpose of creating Record Y is same as like why Record X is created, that means the information saved Record X will be same as the Information that we are going to enter on Record Y because both the entitlements belongs to the same account.

 So Instead of manually entering all the details in to the child record, is there a way where we can use Action framework to move the existing detail object record (Record X) to a new detail record (Record Y) under the Newly created Entitlement (My Entitlement2).


Can anyone please tell me the steps the i have to follow to achieve my requirement.

Thank you.
-Avinash

Does Record Y always exist, or can you create Record Y from Record X? If so, you can use action framework for this really easily. Adopt the Record X into another model and then update the Master-Detail relationship to My Entitlement2.

You can also do this with action framework even if Record Y exists already, but it would be a “Update a field on row(s)” action for each field.


Record Y Does not exist always.

Moving Record x will have to create Record Y. which means when i click the move buutton a new row or record(Record Y) has to created.

 OR

It would be perfect if Record X is moved under from My Entitlement1 to My Entitlement2 when i click the move button. Where both the entitlements (My Entitlement1 and My Entitlement2) belong to the same account.

This way we will not have any child record under My Entitlement1 after the move has happened.




Hi Pat,

Just a quick question.

The models shown in the above screen shot Entitlement1Accounts and Entitlement2Accounts are the different model names of the Child object (child object to Entitlements). Is my understanding correct?
 


Correct. You need two models in order to make use of the “Adopt Rows” action.


I tried what you said. but it is not working.

Please look at the following screen shot. this is just to make your self clear about the issue.


If required, I can send you xml also. somehow i have solve this issue.


Thanks.

-Avinash


I’d have to look at it to get a sense of what’s going on. Maybe this evening around 9pm EST.


Ok. No Problem. i will paste the Xml code of the Page.i will available at that time.






















Active

Expired

Inactive





















































    <model id="CurrentUser" limit="20" query="true" createrowifnonefound="false" adapter="salesforce" type="" sobject="User">
<fields>
<field id="Id"/>
<field id="SmallPhotoUrl"/>
</fields>
<conditions>
<condition type="userinfo" value="" field="Id" operator="=" enclosevalueinquotes="true" userinfotype="userid"/>
</conditions>
<actions/>
</model>

</models>
<components>
<grid uniqueid="sk-pzCNM-318">
<divisions>
<division behavior="flex" minwidth="100px" ratio="1">
<components>
<skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="25" createrecords="true" model="Entitlement" buttonposition="" mode="read" uniqueid="sk-6rwo7-72">
<fields>
<field id="Status" valuehalign="" type="CUSTOM" snippet="icon" columnwidth="30px"/>
<field id="On_Hold__c" type="" valuehalign="" columnwidth="40px"/>
<field id="Name" valuehalign="" type="" columnwidth="300px" allowordering="true"/>
<field id="AccountId" valuehalign="" type="" columnwidth="450px" allowordering="true">
<label>Account Name</label>
</field>
<field id="StartDate" valuehalign="" type="" columnwidth="100px" allowordering="true"/>
<field id="EndDate" valuehalign="" type="" columnwidth="100px" allowordering="true"/>
<field id="Contract_SLA__c" valuehalign="" type="" columnwidth="100px"/>
<field id="Systems__c" valuehalign="" type="" columnwidth="150px"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
<action type="multi" label="Move Site Doc from old Entitlement" icon="ui-silk-application-go">
<actions>
<action type="emptyModelData">
<models>
<model>expEnt</model>
</models>
</action>
<action type="setCondition" model="expEnt" condition="accId" value="{{Account.Id}}"/>
<action type="setCondition" model="cuRent" condition="Id" value="{{Id}}"/>
<action type="requeryModels" model="expEnt" behavior="standard">
<models>
<model>expEnt</model>
<model>cuRent</model>
</models>
</action>
<action type="drawer">
<drawer title="Drawer Area" width="90%" closehandle="true">
<components>
<skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="false" model="expEnt" buttonposition="" mode="readonly" uniqueid="sk-1c5F1t-309">
<fields>
<field id="Customer_Entitlement__r.Name" name="customerEntitlementrName" valuehalign="" type="" snippet="removeLater"/>
<field id="Customer_Entitlement__r.Account.Name" name="customerEntitlementrAccou" valuehalign="" type=""/>
<field id="Customer_Entitlement__r.EndDate" name="customerEntitlementrEndDa" valuehalign="" type=""/>
<field id="Customer_Entitlement__r.Contract_SLA__c" name="customerEntitlementrContr" valuehalign="" type=""/>
<field id="Customer_Entitlement__r.On_Hold__c" name="customerEntitlementrOnHol" valuehalign="" type=""/>
<field id="Customer_Entitlement__r.StartDate" name="customerEntitlementrStart" valuehalign="" type=""/>
<field id="Customer_Entitlement__r.Status" name="customerEntitlementrStatu" valuehalign="" type=""/>
</fields>
<rowactions>
<action type="multi" label="Add Site Doc" icon="ui-silk-add">
<actions>


























<action type="adoptRows" sourcemodel="Applications" targetmodel="Applications"/>

We’ll have to do a screenshare as the XML has custom objects that I wouldn’t have.


sure. Let me know how to connect and i can share my screen. 


6pm EST. join.me/mblazonry


Yeah. 6.PM EST. I’ll join.


Hi,

I just joined the meeting.

Thanks


HI Pat,  

I solved the issue with no extra JavaScript being used.

Thanks you for you time.