• amar kumar10
  • NEWBIE
  • 10 Points
  • Member since 2016
  • amar

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Hi,

My requirement is to delete an existing value from picklist, for that i am using Metadata API but still i am not able to perform deletion.
I have created Metadata Service class and added respective method related to deletion and invoking delete operation through Batch for the time being i have hard coded few values like field name. 
Any help will be appriciated.
//Batch Class code
global class UpdatePicklistBatchJob1 implements Database.Batchable<sObject>, Database.AllowsCallouts {
    
    global String sessionId;
    
    global UpdatePicklistBatchJob1(String sId) {
        sessionId = sId;
    }
    
    global Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator('SELECT Object__c, Picklist_New__c, Picklist_Old__c from Picklist_Config__c WHERE Status__c =\'Ready To Process\'');
    }
    
    global void execute(Database.BatchableContext bc, List<Picklist_Config__c> configs) {
        
        MetadataSrv.MetadataPort service = new MetadataSrv.MetadataPort();
        service.SessionHeader = new MetadataSrv.SessionHeader_element();
        service.SessionHeader.sessionId = sessionId; // UserInfo.getSessionId();
        
        // Read Custom Field
        MetadataSrv.CustomField customField = (MetadataSrv.CustomField)
        service.readMetadata('CustomField', new String[] { 'Demo__c.Alternate_Email__c' }).getRecords()[0];
        
        List<MetadataSrv.DeleteResult> results = service.deleteMetadata('CustomField', new String[] { 'Demo__c.Alternate_Email__c' });
        
    }
    
    global void finish(Database.BatchableContext bc) {
        
    }
}

Hi,
i have assigned a string to a variable and want to display the string in 2 lines.
expected result:

User-added image
Sample code

VF Code
-----------------------------------------------------------
<apex:page controller="BreakString1Controller">

    <apex:outputText value="{!str2}"></apex:outputText>

</apex:page>

Controller code
-----------------------------------------------------------------------
public class BreakString1Controller {

    public string str1 = 'Quick brown fox jumps \n '+' <br/>'+' over the lazy dog';
    public string str2 {get; set;}

    public BreakString1Controller (){
        str2 = str1;
    }

}
Any help would pe appreciated
I have created a Visualforce page in which i am displaying wave analytic dashboards.
Now i am trying to fetch the filters which is applied by the user on the dashboard, and want to assign the filters to different variables in controller, so that i can do further operations. I have attached a image of the dashboard and i want to fetch the filter which is applied on the dropdown..

Any help would be appreciated

User-added image
I am tryng to implement Image Slider in visualforce. This is my code so far can anyone please help me with this. In this code i have added 3 images but Its only showing the first image and slider is also not working.

<apex:page showHeader="false" sidebar="false" standardStylesheets="false">
<html lang="en">
    <head>
        <!-- Bootstrap core CSS --> 
        <apex:stylesheet value="{!URLFOR($Resource.bootstrap, 'bootstrap-3.3.6-dist/css/bootstrap.min.css')}"/>
        <title>Image Slider Using Bootstrap</title>
        
        <!-- <apex:image alt="Challenge Image1" title="Challenge1" url="{!URLFOR($Resource.Challenge1, 'Challenge1.jpg')}"/> -->
        <!-- <apex:image url="{!$Resource.Challenge1}"/> -->
    </head>
<body>
<div class="container text-center">
<!-- Inside body ----------------------------------------------------------------------------------------------------------------------------------- -->

    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
            <li data-target="#carousel-example-generic" data-slide-to="2"></li>
        </ol>
     
        <!-- Wrapper for slides -->
        <div class="carousel-inner">
            <div class="item active">
                <!-- <img src="http://placehold.it/1200x315" alt="..." /> -->
                <apex:image url="{!$Resource.Challenge1}"/>
                <div class="carousel-caption">
                    <h3>Caption Text</h3>
                </div>
            </div>
            
            <div class="item">
                <!-- <img src="http://placehold.it/1200x315" alt="..." /> -->
                <apex:image url="{!$Resource.Challenge2}"/>
                <div class="carousel-caption">
                    <h3>Caption Text</h3>
                </div>
            </div>
    
            <div class="item">
                <!-- <img src="http://placehold.it/1200x315" alt="..." /> -->
                <apex:image url="{!$Resource.Challenge3}"/>
                <div class="carousel-caption">
                    <h3>Caption Text</h3>
                </div>
            </div>
        </div><!-- Wrapper for slides End -->
 
        <!-- Controls -->
        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left"></span>
        </a>
        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right"></span>
        </a>
        
    </div> <!-- Carousel -->

<!--Inside Body end -------------------------------------------------------------------------------------------------------------------------------- -->    
</div>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <apex:includescript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"/>
    <apex:includescript value="{!URLFOR($Resource.bootstrap, 'bootstrap-3.3.6-dist/js/bootstrap.min.js)"/>
    
    <apex:includeScript value="{!URLFOR($Resource.bootstrap, 'bootstrap-3.3.6-dist/js/bootstrap.js)"/>
</body>
</html>
</apex:page>
Hi,

My requirement is to delete an existing value from picklist, for that i am using Metadata API but still i am not able to perform deletion.
I have created Metadata Service class and added respective method related to deletion and invoking delete operation through Batch for the time being i have hard coded few values like field name. 
Any help will be appriciated.
//Batch Class code
global class UpdatePicklistBatchJob1 implements Database.Batchable<sObject>, Database.AllowsCallouts {
    
    global String sessionId;
    
    global UpdatePicklistBatchJob1(String sId) {
        sessionId = sId;
    }
    
    global Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator('SELECT Object__c, Picklist_New__c, Picklist_Old__c from Picklist_Config__c WHERE Status__c =\'Ready To Process\'');
    }
    
    global void execute(Database.BatchableContext bc, List<Picklist_Config__c> configs) {
        
        MetadataSrv.MetadataPort service = new MetadataSrv.MetadataPort();
        service.SessionHeader = new MetadataSrv.SessionHeader_element();
        service.SessionHeader.sessionId = sessionId; // UserInfo.getSessionId();
        
        // Read Custom Field
        MetadataSrv.CustomField customField = (MetadataSrv.CustomField)
        service.readMetadata('CustomField', new String[] { 'Demo__c.Alternate_Email__c' }).getRecords()[0];
        
        List<MetadataSrv.DeleteResult> results = service.deleteMetadata('CustomField', new String[] { 'Demo__c.Alternate_Email__c' });
        
    }
    
    global void finish(Database.BatchableContext bc) {
        
    }
}

Hi,
i have assigned a string to a variable and want to display the string in 2 lines.
expected result:

User-added image
Sample code

VF Code
-----------------------------------------------------------
<apex:page controller="BreakString1Controller">

    <apex:outputText value="{!str2}"></apex:outputText>

</apex:page>

Controller code
-----------------------------------------------------------------------
public class BreakString1Controller {

    public string str1 = 'Quick brown fox jumps \n '+' <br/>'+' over the lazy dog';
    public string str2 {get; set;}

    public BreakString1Controller (){
        str2 = str1;
    }

}
Any help would pe appreciated
I am tryng to implement Image Slider in visualforce. This is my code so far can anyone please help me with this. In this code i have added 3 images but Its only showing the first image and slider is also not working.

<apex:page showHeader="false" sidebar="false" standardStylesheets="false">
<html lang="en">
    <head>
        <!-- Bootstrap core CSS --> 
        <apex:stylesheet value="{!URLFOR($Resource.bootstrap, 'bootstrap-3.3.6-dist/css/bootstrap.min.css')}"/>
        <title>Image Slider Using Bootstrap</title>
        
        <!-- <apex:image alt="Challenge Image1" title="Challenge1" url="{!URLFOR($Resource.Challenge1, 'Challenge1.jpg')}"/> -->
        <!-- <apex:image url="{!$Resource.Challenge1}"/> -->
    </head>
<body>
<div class="container text-center">
<!-- Inside body ----------------------------------------------------------------------------------------------------------------------------------- -->

    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
            <li data-target="#carousel-example-generic" data-slide-to="2"></li>
        </ol>
     
        <!-- Wrapper for slides -->
        <div class="carousel-inner">
            <div class="item active">
                <!-- <img src="http://placehold.it/1200x315" alt="..." /> -->
                <apex:image url="{!$Resource.Challenge1}"/>
                <div class="carousel-caption">
                    <h3>Caption Text</h3>
                </div>
            </div>
            
            <div class="item">
                <!-- <img src="http://placehold.it/1200x315" alt="..." /> -->
                <apex:image url="{!$Resource.Challenge2}"/>
                <div class="carousel-caption">
                    <h3>Caption Text</h3>
                </div>
            </div>
    
            <div class="item">
                <!-- <img src="http://placehold.it/1200x315" alt="..." /> -->
                <apex:image url="{!$Resource.Challenge3}"/>
                <div class="carousel-caption">
                    <h3>Caption Text</h3>
                </div>
            </div>
        </div><!-- Wrapper for slides End -->
 
        <!-- Controls -->
        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left"></span>
        </a>
        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right"></span>
        </a>
        
    </div> <!-- Carousel -->

<!--Inside Body end -------------------------------------------------------------------------------------------------------------------------------- -->    
</div>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <apex:includescript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"/>
    <apex:includescript value="{!URLFOR($Resource.bootstrap, 'bootstrap-3.3.6-dist/js/bootstrap.min.js)"/>
    
    <apex:includeScript value="{!URLFOR($Resource.bootstrap, 'bootstrap-3.3.6-dist/js/bootstrap.js)"/>
</body>
</html>
</apex:page>