ReasonTableRef::checkCreateInCompany Method
Checks whether the record is in the specified company; and if not, creates a copy of the record in the specified company.
Syntax
client server public static ReasonRefRecID checkCreateInCompany(ReasonRefRecID _oldRecId, DataAreaId _inCompany)
Run On
Called
Parameters
- _oldRecId
Type: ReasonRefRecID Extended Data Type
- _inCompany
Type: DataAreaId Extended Data Type
Return Value
Type: ReasonRefRecID Extended Data Type
0 if the _oldRecId parameter is 0; the value of the _oldRecId parameter if the record is already in the target company; or the ReasonRefRecID of the new ReasonTableRef record.
Remarks
The method is intended to be used in assignments of the ReasonTableRefRecId fields in linked tables.
It automatically handles the case of intercompany references. For intercompany transactions, it creates a copy of the original record in the new company, so that both linked records exist in the same company.