Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in Salesforce by (11.9k points)

I want to create a new Visual force page with visual force markup code

<apex:page >

<apex:iframe src="**ReportID**?isdtp=nv" scrolling="true" id="theIframe"/>

</apex:page>

Where the report will be already created programmatically and the report id from that URL is given as a parameter.

Please post the details and snippets if possible, I am a very newbie to salesforce development.

Thanks In advance.

1 Answer

+1 vote
by (32.1k points)
edited by

The following code will help you create a visual force page:

byte[] ContentBytes;

String Content = "<apex:page >//PageContent In Apex Code//</apex:page>";

ApexCode= Content.getBytes("UTF-8");

double version = 15.00;

com.sforce.soap.metadata.ApexPage pag = new com.sforce.soap.metadata.ApexPage();

pag.setFullName("Name");

pag.setDescription("Description");

pag.setLabel("Label");

pag.setAvailableInTouch(true);

pag.setApiVersion(version);

pag.setContent(ApexCode);

pag.setConfirmationTokenRequired(false);

Metadataconnection.create(new Apexpage[](pag);

And check the status by Checkstatus() method of metadata API.

If you are planning to break into the Salesforce domain, and are not sure where to start, I would recommend you start by enrolling yourself in a Salesforce course from Intellipaat!

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...