• rishi jaykar 1
  • NEWBIE
  • 10 Points
  • Member since 2016
  • Salesforce Developer
  • Kloudrac Software Pvt. Ltd.

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 8
    Replies
In Case object there  are three queues SMB  Tier1 Queue, SMB Tier2 Queue, SMB Tier 3 Queue.(Record Owner)
In each Queue there are three to four users. 
SMB Tier 1  Queue user should not directly transfer case record to SMB Tier 3 Queue.
 

my Account detail page like this:
User-added image
i have already added these components on account record homepage layout.

but got error:
User-added image

 
We need a visualforce page that would let users search Books using Author, Title or
ISBN. Use Google Books API.
Hi
Create object : Condidate__c
Fields : (All Text fields)
First Name
Last Name
Email
Brokerage
Manage Brokerage
Condidate Status (Webinar - Attended , Webinar -Not Attended)
User Created ( checkbox)
On insert:
1. Create Account if Brokerage !=null
2. Create another account if Manage Brokerage != null and set parentId = Brokerage account id (created in 1 point)
3. Create new contact record and set accountId = Manage Brokerage account id (created in 2 point)
   create new field condidate__c(lookup) on contact and fill it with Condidate__c record id
4. Create task record for contact record (created in point 3)
Task.WhoId = contactId
Task.WhatId = Condidate__c
Task.Subject = 'Portal Contact Setup';

On Update : 
if Condidate__c  Status = Webinar - Attended and User Created = false ,
1. Create Portal user for Condidate child contact created in 3 point.
final PageReference theUrl = new PageReference(SERVER_URL + '/services/data/v37.0/query/');

for Example i am using this code for getting record now i want to insert record using same technic ??:
theUrl.getParameters().put('q','select id,name from Account limit 10');
request = new HttpRequest();
request.setEndpoint(theUrl.getUrl());
request.setMethod('GET');
request.setHeader('Authorization', 'OAuth ' + SESSION_ID);

String body = (new Http()).send(request).getBody();
System.debug('Accounts in JSON format: ' + body);
component :
<aura:component >
<aura:attribute name="newExpense" type="Expense__c"
     default="{ 'sobjectType': 'Expense__c',
                    'Name': '',
                    'Amount__c': 0,
                    'Client__c': '',
                    'Date__c': '',
                    'Reimbursed__c': false }"/>
    <!-- PAGE HEADER -->
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem >
            <lightning:icon iconName="standard:scan_card" alternativeText="My Expenses"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Expenses</h1>
                <h2 class="slds-text-heading--medium">My Expenses</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER -->

    <!-- NEW EXPENSE FORM -->
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">

       <!-- CREATE NEW EXPENSE -->
            <div aria-labelledby="newexpenseform">
            
                <!-- BOXED AREA -->
                <fieldset class="slds-box slds-theme--default slds-container--small">
            
                <legend id="newexpenseform" class="slds-text-heading--small 
                  slds-p-vertical--medium">
                  Add Expense
                </legend>
            
                <!-- CREATE NEW EXPENSE FORM -->
                <form class="slds-form--stacked">          
                    <lightning:input aura:id="expenseform" label="Expense Name"
                                     name="expensename"
                                     value="{!v.newExpense.Name}"
                                     required="true"/> 
                    <lightning:input type="number" aura:id="expenseform" label="Amount"
                                     name="expenseamount"
                                     min="0.1"
                                     formatter="currency"
                                     step="0.01"
                                     value="{!v.newExpense.Amount__c}"
                                     messageWhenRangeUnderflow="Enter an amount that's at least $0.10."/>
                    <lightning:input aura:id="expenseform" label="Client"
                                     name="expenseclient"
                                     value="{!v.newExpense.Client__c}"
                                     placeholder="ABC Co."/>
                    <lightning:input type="date" aura:id="expenseform" label="Expense Date"
                                     name="expensedate"
                                     value="{!v.newExpense.Date__c}"/>
                    <lightning:input type="checkbox" aura:id="expenseform" label="Reimbursed?"  
                                     name="expreimbursed"
                                     checked="{!v.newExpense.Reimbursed__c}"/>
                    <lightning:button label="Create Expense" 
                                      class="slds-m-top--medium"
                                      variant="brand"
                                      onclick="{!c.clickCreate}"/>
                </form>
                <!-- / CREATE NEW EXPENSE FORM -->
            
              </fieldset>
              <!-- / BOXED AREA -->
            
            </div>
            <!-- / CREATE NEW EXPENSE -->

        </lightning:layoutItem>
    </lightning:layout>
    <!-- / NEW EXPENSE FORM -->
<c:expensesList expenses="{!v.expenses}"/>

</aura:component>

controller:
({
    clickCreate: function(component, event, helper) {
        var validExpense = component.find('expenseform').reduce(function (validSoFar, inputCmp) {
            // Displays error messages for invalid fields
            inputCmp.showHelpMessageIfInvalid();
            return validSoFar && inputCmp.get('v.validity').valid;
        }, true);
        // If we pass error checking, do some real work
        if(validExpense){
            // Create the new expense
            var newExpense = component.get("v.newExpense");
            console.log("Create expense: " + JSON.stringify(newExpense));
            helper.createExpense(component, newExpense);
        }
    }
})

Helper:
({
    createExpense: function(component, expense) {
        var theExpenses = component.get("v.expenses");
 
        // Copy the expense to a new object
        // THIS IS A DISGUSTING, TEMPORARY HACK
               
        console.log("Expenses before 'create': " + JSON.stringify(theExpenses));
        theExpenses.push(newExpense);
        component.set("v.expenses", theExpenses);
        console.log("Expenses after 'create': " + JSON.stringify(theExpenses));
        
    }
})

 
1) Make two DateTime fields on contact object.

LastTaskCreatedTime

LastEmailSentTime


2) Whenever a task is created on Contact LastTaskCreatedTime field should be updated.


3) Whenever you send an email LastEmailSentTime field should be updated.

4) Make trigger as bulk
Scenario :

1) Make two number fields on contact object
Amount_X
Amount_Y

2) Make one picklist field "Type" , values ('Positive', 'Negative')

3) Make two number fields on account
Rollup_Amount_X
Rollup_Amount_Y
Rollup_Amount

4) Make one trigger on contact object, which will do following:
--> Sum all child of contact's field "Amount_X" and store in parent account's "Rollup_Amount_X" Where Type is "Positive"
--> Sum all child of contact's field "Amount_Y" and store in parent account's "Rollup_Amount_Y" Where Type is "Negative"
--> Sum all child of contact's field "Amount_X" + "Amount_Y" and store in parent account's "Rollup_Amount"
 
1. Following object and fields that you need to create.
a. Object: Employee
 i. Employee Designation
ii. Account Name(Required Field)(Lookup Field)
iii. Contact Name(Required Field)(Lookup Field)
 2. Create a Visualforce page that will display above mentioned 3 fields.
 3. Create following two buttons on the Visualforce created in #2. a. Create b. Cancel
4. Both fields “Account Name” and “Contact Name” will have functionality of autocomplete and search. For example “Account Name” field will have search functionality of all account.(When you click inside of text field it will display 10 records and similarly when you type first 3 character of any account name it will display that account name).
5. For second field which will be “Contact name”, it will search the contact based on Account selected in Account field.
 a. For example, let’s say if you selected one account name as “Acc” then it will display contact based on the account name selected in Account field.
 b. This field “Contact Name” should also have the the functionality same as “Account Name” field
● Please see below screenshot If you have any confusion on Autocomplete.
User-added image
Account Name field and Contact Name field should be mandatory. That means if user is try to create new Employee record without selecting any value in those fields then it should display error message as Account and Contact Name is mandatory.
  public contact con{get;set;}
    private contact conttt;
    global contact cont;
    public contact contt;
this is the code for standard controller = "Forecast__c" to get the field Picklist1__c
<div class="slds-form-element__control">
<div class="slds-select_container">
<apex:inputField value="{!Forecast__c.Picklist1__c}" styleClass="slds-select slds-input slds-input--small" />
</div>
</div>
final PageReference theUrl = new PageReference(SERVER_URL + '/services/data/v37.0/query/');

for Example i am using this code for getting record now i want to insert record using same technic ??:
theUrl.getParameters().put('q','select id,name from Account limit 10');
request = new HttpRequest();
request.setEndpoint(theUrl.getUrl());
request.setMethod('GET');
request.setHeader('Authorization', 'OAuth ' + SESSION_ID);

String body = (new Http()).send(request).getBody();
System.debug('Accounts in JSON format: ' + body);
component :
<aura:component >
<aura:attribute name="newExpense" type="Expense__c"
     default="{ 'sobjectType': 'Expense__c',
                    'Name': '',
                    'Amount__c': 0,
                    'Client__c': '',
                    'Date__c': '',
                    'Reimbursed__c': false }"/>
    <!-- PAGE HEADER -->
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem >
            <lightning:icon iconName="standard:scan_card" alternativeText="My Expenses"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Expenses</h1>
                <h2 class="slds-text-heading--medium">My Expenses</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER -->

    <!-- NEW EXPENSE FORM -->
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">

       <!-- CREATE NEW EXPENSE -->
            <div aria-labelledby="newexpenseform">
            
                <!-- BOXED AREA -->
                <fieldset class="slds-box slds-theme--default slds-container--small">
            
                <legend id="newexpenseform" class="slds-text-heading--small 
                  slds-p-vertical--medium">
                  Add Expense
                </legend>
            
                <!-- CREATE NEW EXPENSE FORM -->
                <form class="slds-form--stacked">          
                    <lightning:input aura:id="expenseform" label="Expense Name"
                                     name="expensename"
                                     value="{!v.newExpense.Name}"
                                     required="true"/> 
                    <lightning:input type="number" aura:id="expenseform" label="Amount"
                                     name="expenseamount"
                                     min="0.1"
                                     formatter="currency"
                                     step="0.01"
                                     value="{!v.newExpense.Amount__c}"
                                     messageWhenRangeUnderflow="Enter an amount that's at least $0.10."/>
                    <lightning:input aura:id="expenseform" label="Client"
                                     name="expenseclient"
                                     value="{!v.newExpense.Client__c}"
                                     placeholder="ABC Co."/>
                    <lightning:input type="date" aura:id="expenseform" label="Expense Date"
                                     name="expensedate"
                                     value="{!v.newExpense.Date__c}"/>
                    <lightning:input type="checkbox" aura:id="expenseform" label="Reimbursed?"  
                                     name="expreimbursed"
                                     checked="{!v.newExpense.Reimbursed__c}"/>
                    <lightning:button label="Create Expense" 
                                      class="slds-m-top--medium"
                                      variant="brand"
                                      onclick="{!c.clickCreate}"/>
                </form>
                <!-- / CREATE NEW EXPENSE FORM -->
            
              </fieldset>
              <!-- / BOXED AREA -->
            
            </div>
            <!-- / CREATE NEW EXPENSE -->

        </lightning:layoutItem>
    </lightning:layout>
    <!-- / NEW EXPENSE FORM -->
<c:expensesList expenses="{!v.expenses}"/>

</aura:component>

controller:
({
    clickCreate: function(component, event, helper) {
        var validExpense = component.find('expenseform').reduce(function (validSoFar, inputCmp) {
            // Displays error messages for invalid fields
            inputCmp.showHelpMessageIfInvalid();
            return validSoFar && inputCmp.get('v.validity').valid;
        }, true);
        // If we pass error checking, do some real work
        if(validExpense){
            // Create the new expense
            var newExpense = component.get("v.newExpense");
            console.log("Create expense: " + JSON.stringify(newExpense));
            helper.createExpense(component, newExpense);
        }
    }
})

Helper:
({
    createExpense: function(component, expense) {
        var theExpenses = component.get("v.expenses");
 
        // Copy the expense to a new object
        // THIS IS A DISGUSTING, TEMPORARY HACK
               
        console.log("Expenses before 'create': " + JSON.stringify(theExpenses));
        theExpenses.push(newExpense);
        component.set("v.expenses", theExpenses);
        console.log("Expenses after 'create': " + JSON.stringify(theExpenses));
        
    }
})

 
Hi Expert,
 I have created a connected app and now I want to access the salesforce account object in another javascript project, how to access this object in javascript i am using below below code  
var clientId = "4MVG98dostKihXN5oBoP6A8TICyfESSuGPgzHBiJq8XH4PuqTtB.pxOTyitM4r46cHGX2d1tXRl4Jp0Ab58";    
var consumerSecret = "2388376451203";     //Authorization endpoint    
var authEndPoint = "https://login.salesforce.com/services/oauth2/authorize";     //response_type must be set to token    
var responseType = "token";     //This is the callback URL from the connected app     var redirectURI = "https://login.salesforce.com/services/oauth2";     //Construct the URL with the required parameters    
var requestURL = authEndPoint+'?client_id='+clientId+'&response_type='+responseType+'&redirect_uri='+redirectURI;  

Can you please suggest   
Thanks


 
$customField = new SforceCustomField();
$customField->fullName='Account.Test2__c';
  $customField->description='Description of New Field';
  $customField->label='My Custom Field Label';
  $customField->type='Text';
  $customField->length=255;
  $customField->unique=true;
  $customField->isVisible=true;
  $customField->externalId=true;
//$customField->fieldLevelSecurities=true;
 // $customField->visibility=true;
 //$customField->readable = true;
  //$customField->readableSpecified = true;
  //$customField->permissionsRead =true;
  //$customField->accessible=true;
//$customField->sharingModel=true;
  //$appVisibility->appVisibility(true);