Play Games

Search This Blog

Wednesday, August 28, 2019

Sunday, August 25, 2019

How to rotate an image in visualforce page


How to rotate an image in visualforce page

Sample VF Code:
<apex:page showHeader="false" sidebar="false">
    <html>
    <head>
        <title>Image Rotation</title>
        <style>
            body {
                background: gold;
            }
            .loadingImage {
                border-top:5px solid green;
                border-bottom:5px solid green;
                border-left:5px solid green;
                border-right:5px solid green;
                border-radius:50%;
                left:45%;
                top:25%;
                width:200px;
                height:200px;
                background:black;
                animation:spin 10s linear infinite;
                position:absolute;
             
            }
         
            .circularImage {
            border-radius:50%;
            width:200px;
            height:200px;
         
        }
            @-webkit-keyframes spin {
                0% {
                    transform:rotate(0deg);
                }
                100% {
                    transform:rotate(360deg);
                }
             
             
            }
        </style>
    </head>
    <body>
        <div>
            <p style="font-size: 18px;text-align: center;color: green;"> Image is Rotating in Visualforce Page</p>
            <br/>
            <div>
                <img class="loadingImage circularImage" src="Logo URL"/>
            </div>

        </div>
    </body>
    </html>
</apex:page>

Output:

Demo


Saturday, August 24, 2019

How to display heart symbol in visualforce page salesforce


How to display heart symbol in visualforce page salesforce

We can use the &#10084; ASCII code to display heart symbol.

Sample VF Code:
<apex:page >
    <html>
    <head>
    </head>
    <body>
    <br/> 
     <span style="font-size:1000%;color:red;">&#10084;</span>
    </body>
    </html>
</apex:page>

Output:

How to display image as circular or rounded in visualforce page salesforce

How to display image as circular or rounded in visualforce page salesforce

Sample Visualforce Page Code:

<apex:page >
    <html>
    <head>
        <style>
        .circularImage {
            border-radius:50%;
            width:350px;
            height:350px;
         
        }
        </style>
    </head>
    <body>
    <br/> 
    <img class="circularImage"  src="imageURL"/>
    </body>
    </html>
</apex:page>


Output:

Wednesday, August 7, 2019

How to link contact with Account in Salesforce


How to link contact with Account in Salesforce

We can use AccountId field of contact to associate contact with particular Account.

check the below link to see the fields of contact object for better idea

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contact.htm


Example: Run the following code in Execute anonymous window.

Account objAccount = new Account();
objAccount.Name ='Test Account';
insert objAccount;
system.debug('Account:'+objAccount);
Contact objContact = new Contact();
objContact.lastName ='Last Name';
objContact.firstName = 'First Name';
objContact.AccountId = objAccount.Id;
insert objContact;
system.debug('Contact:'+objContact);


Output: It creates Account and then it associates this Account with the newly created contact.

Happy Coding !!!

Friday, August 2, 2019

A Surprise for You

A Surprise for You