CoreBOSBB

Full Version: Automatically filling relation type fields when creating a record from a related one
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
try with <OrgfieldName>record_id</OrgfieldName>

or recordid (don't remember)
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).
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/comm...fc1a577b8e

update your code or apply that change and 'record_id' should work
(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/comm...fc1a577b8e

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

Now it works. Thank you Smile