Giter Club home page Giter Club logo

Comments (14)

neowit avatar neowit commented on June 7, 2024

It does sound like a useful feature. It may be a bit problematic though because vim plugin would have to parse and manipulate package.xml.
I had considered this feature some time ago but decided against because thought that the result is not worth the effort.
Perhaps I shall give it another thought now when I am not the only potential user of this feature.

Thanks for the suggestion.

from vim-force.com.

cwarden avatar cwarden commented on June 7, 2024

I don't think it would have to parse package.xml. It could just generate a temporary package.xml.

from vim-force.com.

neowit avatar neowit commented on June 7, 2024

Agreed. A temporary package.xml should do.
The ease of use of this function is of some concern however.

  1. If we were to use an instruction like :ApexRetrieve object Account then one would have to remember that - in order to specify that Account is an object - one has to use object term. Perhaps there should be some way to bring a list of metadata types to choose from.
  2. Assume package.xml does not include <name>CustomObject</name>.
    Consider a scenario:
    • retrieve Account with all fields using :ApexRetrieve object Account (remember we do not change existing package.xml and just use a temporary one, so <name>CustomObject</name> does not get added into main package.xml)
    • amend a field (e.g. field label) on Account
    • try to deploy updated field label (since .object does not have '-meta.xml' counterpart we have to use ApexDeployAll)

the result is - SFDC complains that Account is 'Not in package.xml'

from vim-force.com.

cwarden avatar cwarden commented on June 7, 2024

A way of choosing the type of object would be good. If you're feeling ambitious, you could even show the actual objects using the Metadata REST API.

Maybe ApexDeployAll should also create a temporary package.xml with wildcards for all components, or perhaps just encourage the use of wildcards in the user's package.xml. Except when deleting components, I haven't found a reason to name individual components during a deploy.

from vim-force.com.

neowit avatar neowit commented on June 7, 2024

It is easy to retrieve a list of metadata type names (like CustomObject, ApexClass, etc) with salesforce library for Ant.

Maybe we could do something like:

  1. Retrieve complete list of metadata types into a text file and open it in vim buffer
  2. put some sort of mark (or just delete un-needed types) against types to be retrieved and add actual component names (indented under Type Name) like so:
CustomObject
+Account
+MyObject__c
CustomTab
*
ReportType
+MyReportType__c

You would still have to remember that in order to retrieve individual component it has to be specified with + and in order to retrieve all components of a given metadata type (where it is allowed by Ant library) you have to specify *
So not sure how user friendly is this.

  1. Create a temporary package.xml and use it for "retrieve" Ant task to download stuff into a temp folder
  2. copy downloaded results into the actual Project folder
    (Temp folder is needed to make sure that we do not mess with the main package.xml)

Potential issue with this is that we may end up bringing too many metadata files into the project and ApexDeployAll will no longer work because:

  • some types (Like Profiles or Workflows) will cause error because Ant complains when you try to deploy Profiles (even if you have not changed anything)
  • there is a limit on the number of files you can deploy in one go, so ApexDeployAll for a large project (e.g. lots of objects and fields) will fail due to this limit

from vim-force.com.

neowit avatar neowit commented on June 7, 2024

I have done a first stab at :ApexRetrieve command.
For more details see :h ApexRetrieve and this short video: http://youtu.be/M-XQCykF6nU

from vim-force.com.

cwarden avatar cwarden commented on June 7, 2024

Thanks, @neowit. This works, but it's a little painful for lots of objects. I'm trying to retrieve custom fields on Task, and I have 109 objects in the org, so stepping through all of them is time consuming. When I get past a screen full of objects, I get four -- More -- prompts before the Overwrite (Y)es / (N)o / all / (A)bort / (C)ompare prompt.

How about showing a list of retrieved objects like the one you display to choose the type of object so you can tag the ones you want?

from vim-force.com.

neowit avatar neowit commented on June 7, 2024

Funny you should say that. I actually started the individual object selection part in September, but then run out of spare time and later abandoned it.
This issue is now reopened.

from vim-force.com.

neowit avatar neowit commented on June 7, 2024

FYI - if you pull current version then --More-- prompt should not bug you any more.

from vim-force.com.

neowit avatar neowit commented on June 7, 2024

Christian, I have pushed new version which supports selection of child components to retrieve. Parent being things like CustomObject, child things like Account.
Here is updated video: http://youtu.be/umO86ji2Iqw

I have not had a chance to use this functionality properly yet so It is probably quite buggy. Make sure to backup your project before testing and let me know if you find problems.

from vim-force.com.

cwarden avatar cwarden commented on June 7, 2024

Thanks, @neowit. The new :Expand command works great.

from vim-force.com.

neowit avatar neowit commented on June 7, 2024

Christian,
Have you had a chance to test this functionality?
My day-to-day workflow does not require this functionality so I can not test it thoroughly.
Did you find any problems?

from vim-force.com.

cwarden avatar cwarden commented on June 7, 2024

I've used it a couple times. No problems so far.

from vim-force.com.

neowit avatar neowit commented on June 7, 2024

Good to know.
I will close this issue then.

from vim-force.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.