Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatically filling relation type fields when creating a record from a related one
#1
Hi,

We are trying to define a Business Mapping that would automatically fill some of the fields on a new record when creating a new record from a related one (i.e. Asset -> Support Ticket; Sales Order -> Purchase Order).
This works fine with Text type fields, however, we cannot make this work for Relation type fields on the creating record.

What would be the proper way to do this to make it work?

Example: we need the Mapping to fill the "Asset" field (cf_713) in the Support Ticket record with the Asset name when creating Support Ticket from Asset. "Asset" field (cf_713) is relation type. Map name is Assets2HelpDesk.

<map>
<originmodule>
 <originid>40</originid>
 <originname>Assets</originname>
</originmodule>
<targetmodule>
 <targetid>13</targetid>
 <targetname>HelpDesk</targetname>
</targetmodule>
<fields>
   <field>
   <fieldname>cf_713</fieldname>
   <Orgfields>
     <Orgfield>
       <OrgfieldName>assetname</OrgfieldName>
       <OrgfieldID>FIELD</OrgfieldID>
     </Orgfield>
    </Orgfields>
 </field>
</fields>
</map>

Many thanks.
Reply
#2
try with <OrgfieldName>record_id</OrgfieldName>

or recordid (don't remember)
Joe
TSolucio
Reply
#3
Many thanks.
But neither works.

However, this type of mapping does work for some relation type fields (usually not the custom fields) as well as for not relation type fields (cf included).
Reply
#4
I searched for how to do this beause i am almost positive I have done this in the past but could not find it.

so i implemented it: https://github.com/tsolucio/corebos/commit/59df6b5119a828de8ddbec346ed71ffc1a577b8e

update your code or apply that change and 'record_id' should work
Joe
TSolucio
Reply
#5
(10-08-2020, 12:40 AM)joebordes Wrote: I searched for how to do this beause i am almost positive I have done this in the past but could not find it.

so i implemented it: https://github.com/tsolucio/corebos/commit/59df6b5119a828de8ddbec346ed71ffc1a577b8e

update your code or apply that change and 'record_id' should work

Now it works. Thank you Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)