When does the createfrom get removed on record.sav...
# ask-stanley-ai
s
When does the createfrom get removed on record.save after a transform.
c
AI generated answer (using internal Slack threads):
The
createdfrom
field gets removed on
record.save
after a transform operation when you make changes that would remove the relationship between the original record and the transformed record. For example, if you are transforming a Sales Order record into a Return Authorization record, and then you set the customer field on the Return Authorization record, this would destroy the
createdfrom
relationship. Here is a code snippet that was shared in the conversation:
Copy code
javascript
rma = record.transform({
  fromType: record.Type.SALES_ORDER,
  fromId: soId,
  toType: record.Type.RETURN_AUTHORIZATION,
});

let rmaId = rma.save({
  enableSourcing: false,
  ignoreMandatoryFields: true,
});
In this example, if you were to set the customer field on the
rma
record before calling
rma.save()
, the
createdfrom
field would be removed. It's also worth noting that the
enableSourcing
option in the
record.save
method could potentially affect the
createdfrom
field. If
enableSourcing
is set to
false
, it prevents the system from sourcing field values from related records. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827761471
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.805060863
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.80147469
Please provide your feedback on this answer.
s
What changes to an Invoice would remove the relationship to a sales order?