Is it possible to organize the objects directory f...
# sdf
r
Is it possible to organize the objects directory for a #C42JX79UZ project? Some projects have an substantial amount leaning just their id as a means of organizing them.
s
Yes, you can use sub-directories within the objects directory to help organize the files
👍 1
e
^ Yep seconding this; we organize all of ours by type e.g.
/Objects/Records/
,
/Objects/Scripts/Client/
, etc
👍 1
r
How do we move current objects then? or is this something to adopt and use moving forward only?
e
Nope, you can just move em. I don't think the path of the XML affects the Object in any way or vice versa. The only thing you'd need to update is your
deploy.xml
if you've got anything more specific in there than the default
src/Objects/*
👍 2
If you're using git or similar source control, move them using that so your repo tracks the move as well
r
Nice thanks! My deploy file is dynamically generated now from our got log, so that should work fine. I didn’t know if it was like the file cabinet where we had to go manually remove scripts that are renamed or moved after refactoring.
1
@erictgrubaugh, that does not seem to be the case.
deploy.xml
Copy code
<objects>
  <path>~/Objects/commHeader/sch/customscript_sch_***.xml</path></objects>
Copy code
Validation failed.

An error occurred during custom object validation. (customscript_sch_***)
Details: The script ID customscript_sch_*** is a duplicate. Please use a different script ID.
Details: The script ID custscript_sch_*** (scriptcustomfield) for the customscript_sch_***.custscript_sch_*** subrecord is a duplicate.
e
What is not the case, exactly?
I don't believe SDF supports arbitrary wildcards. It's my understanding that you can use an
*
to indicate an entire directory, but not to expand a subset of filenames. If you wanted to deploy everything under
Objects/commHeader/sch
, I'd expect your
deploy.xml
to have
Copy code
<path>~/Objects/commHeader/sch/*</path>
r
No, the issue is that the objects already existed on the server. So when I organized them in the objects directory and tried deploying, it said it was a duplicate scriptId and canceled deployment. I ended up needing to write in a script to squash the objects directory tree before deploying.
Also, you can directly specify which objects you want uploaded instead of a wildcard. You can then use multiple path entries for focused deployments.
d
^ is this for a SuiteApp or AccountCustomization projecttype, and for "server" you just mean the netsuite account right? although I just tried this with SuiteApp type which generally seems to be more sensitive to file changes and worked fine for me granted for my deploy xml I am just deploying everything in my local object directory as <objects> <path>~/Objects/*</path> </objects>
e
I'm not sure I can speak to why it thinks they're duplicates, but I would be skeptical that the cause is the organization of your Objects directory. I have not myself encountered this problem when rearranging Object files - but I acknowledge that's entirely anecdotal.
s
usually, you can redeploy the same objects over and over, and it either updates them or just leaves them as is if there are no changes. I’ve not seen issues with relocating my object files either.
On the other hand, relocating script files or anything in the filing cabinet, could cause issues. I usually move them through the UI first, then make the same change in the SDF structure.
this 1