-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualforce Override Generator #31
Open
itmightbecody
wants to merge
5
commits into
master
Choose a base branch
from
visualforce-override-generator
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+395
−0
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Visualforce Override Generator | ||
|
||
Instead of handwriting Visualforce pages while overriding Salesforce pages with Skuid, this page parses out what you need through a set of options and generates the Visualforce markup and page record using Salesforce's Tooling API. From there, you can select the generated page as your Visualforce override as needed. | ||
|
||
## Before you begin | ||
|
||
1. Salesforce connected app | ||
2. A properly configured authentication provider for your Salesforce org | ||
See [Skuid docs](https://docs.skuid.com/latest/en/data/salesforce/#set-up-a-salesforce-connected-app) for more info. | ||
3. A REST API Skuid data source called ToolingAPI which points to your Salesforce authentication provider | ||
4. This Skuid page! Copy and paste the included XML into a Skuid page. | ||
|
||
## How to Use | ||
|
||
1. Select your options, and you'll see your VF code dynamically generate. | ||
2. Press the button to create the page on your org. | ||
|
||
From there, all you have to do is set your override on your object/action! | ||
|
||
## How It Works | ||
|
||
1. A Template component processes all of your options and generates the code in the text box. Options are kept in globally stored JS variables. | ||
2. A button press activates the following sequence of events: | ||
|
||
- Creating the ApexPage | ||
- A blank apex page is created on a row in the ApexPage model, titled after the VFPageName variable | ||
- That row is then saved. | ||
- After successfully saving, the model is updated to we can see the Salesforce assigned ID. | ||
|
||
- Creating the Metadata Container | ||
- A Metadata Container is generated using the same process as ApexPage (create row, save, updateData) | ||
|
||
- Creating the ApexPageMember | ||
- An ApexPageMember is created, which pulls in the SF IDs from the apex page and the metadata container. | ||
- The ACTUAL page markup is inserted at this point, since we finally have permissions. | ||
|
||
- Creating the ContainerAsyncRequest | ||
- A ContainerAsyncRequest is generated and pulls in the Metadata container ID. | ||
- The ContainerAsyncRequest saves, deploying the page to the org. | ||
|
||
## Other Notes | ||
|
||
- I tried to see if the object-action override was changeable via the API, but I couldn't find the appropriate object to POST to when I made this. More research to be done. | ||
https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_standardaction.htm?search_text=override |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need info about URL endpoint for the REST data source.