Can I get the XML definition of a custom field (li...
# ask-stanley-ai
l
Can I get the XML definition of a custom field (like the Objects XML in SDF) in a scrip and use it? How? Provide example snippets
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** Yes, you can get the XML definition of a custom field in SuiteScript. However, the easiest way to do this would be through SuiteCloud Development Framework (SDF) - using XML to create all those fields in one shot. Here is an example of how you can define a custom field in XML:
Copy code
xml
<itemcustomfield scriptid="custitem_mynewfield">
    <accesslevel>2</accesslevel>
    <appliestoinventory>T</appliestoinventory>
    <displaytype>NORMAL</displaytype>
    <fieldtype>TEXT</fieldtype>
    <label>My New Field</label>
    <searchlevel>2</searchlevel>
    <storevalue>T</storevalue>
</itemcustomfield>
To capture all custom objects from the Sandbox through SDF, you can start collecting customizations you/your team have created with searching against "custbody_abc" when importing through Eclipse. However, this depends on the environment and the naming convention used. If some of the older stuff does not follow the naming convention, it might be worth the 30-60 minutes of work to fix it and then push into the SDF package.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839062393
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837592125
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.815752089
Please provide your feedback on this answer.