• Shun Kosaka
  • NEWBIE
  • 444 Points
  • Member since 2016

  • Chatter
    Feed
  • 19
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 62
    Replies
Hi all,
I am doing trialhead modules with a production account(because of my company's policy).
When i clicked this: 
User-added image
it will redirect to https://playful-bear-489989-dev-ed.my.salesforce.com/home/home.jsp,
a new environment and i can do my trailhead there.

But i can't create a new project on my IDE(using Sublime - mavensmate) as the following:
User-added image

i tried all options there but failed.
Or it just can't be done when using this kind of account?
Thanks for answering.

Reggie.
Here is my button code: 


{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")} 
var result = sforce.apex.execute("SendAccountUsingRESTAPI","callgetContact",{IDD:"{! 
Account.Id}"});



APex class which i m calling: 

Global class SendAccountUsingRESTAPI {
  

  Global class deserializeResponse
   {
      public String id;
      public String access_token;
   } 
 
   webservice static void callgetContact(Id IDD)
   { }
}

When i am clicking on button it gives me an error: {faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/SendAccountUsingRESTAPI }callgetContact, please check the WSDL for the service.', }"

Thank you in advance!
コミュニティではなく、組織のログアウト機能を実装したいと思っています。
しかし、調べたところで実装方法は見つからず、ログインページに飛ばせという記述のみ見つけました。

ログアウト機能は本当に実装できないのでしょうか。
また、できない場合はログインページに飛ばそうと思いますが、
組織のドメインが変わっても問題なく機能するリンクの記述方法はありますか?(URLFORなど)

よろしくお願いします。
I wanted to display a case details as a table when user enters a case number and hit ''search" button.
I dont know what is wrong with my code. I also tried to display the searched element on browser console and log.. but its not working. Pleae help me out!!

My Controller:
global with sharing class CaseSearch {
    
    public string searchElement {get; set;}
    public static Case c;
    
    public CaseSearch(ApexPages.StandardController controller) {

    }
    
    @RemoteAction
    global static Case caseSearchMethod(string searchElement){
        c = [SELECT Id,Account.name,status FROM Case WHERE CaseNumber= :searchElement LIMIT 1];
        system.debug(searchElement);
        return c;
        }
}

and here is my Visualforce Page:
<apex:page standardController="Case" extensions="CaseSearch">
<apex:messages />
<style>
    input{
        float: center;
        width: 100%;
        padding: 12px  50px;
        margin: 8px 0;
        display: inline-block;
        border: 2px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
    }
    .center{
        margin: auto;
        width: 60%;
        //border: 3px solid #73AD21;
        padding: 10px;
    }
    h{
        font-size: 20px; 
        text-align: center;
    }
    table {
        border: 1px solid;
        padding: 12px 20px;
    }
</style>
<script type="text/javascript"> 
    function search(){
    var searchElement = document.getElementById.('case_number').value;
        window.alert("Hello!");
        console.log(searchElement);
        Visualforce.remoting.manager.invokeAction("{!$remoteAction.CaseSearch.caseSearchMethod}",searchElement,function(result,event){
            if(event.status){
                console.log(searchElement);
            }
        });
    }
</script>
    <br/><br/><br/><br/>
    <div class="center">
        <input placeholder="Please Enter Your Case Number Here" id="case_number"></input>
        <Button type="button" value="Search" onclick="search()">Search</button>
    </div>
    <div id="caseDetails" class="center" rendered="false">
        <table style="width:100%">
            <tr>
                <th style="25%">Case Number</th>
                <th style="25%">Name</th>
                <th style="25%">Status</th>
            </tr>
            <tr>
                <td><apex:outputText value="{!C.CaseNumber}"></apex:outputText></td>
                <td><apex:outputText value="{!C.account.name}"></apex:outputText></td>
                <td><apex:outputText value="{!C.status}"></apex:outputText></td>
            </tr>
        </table>
    </div>

</apex:page>
*It would be nice if you help me to show the case details table only after I hit 'Search' button and align the search button to center.

Thanks in Advance!!
Javeed Shaik
こちらを参照してトリガとハンドラを作っています

商談オブジェクト(Opportunity)の中にカスタム項目で親商談(parentOpp__c)という項目を作り、商談に親子関係を作っています。
親商談1に対して子商談が複数付く事があります。

トリガで実現したいのは、
1:子商談の紐付けがされた時に親商談の親商談フラグ(parentOppFlag__c)をTRUEにするということと
2:子商談の親商談の紐付け(parentOpp__c)が削除された時、子商談自体が削除された時に、削除された parentOpp__cのIDを持っている商談をSELECTしてそのリストが1以上だった場合は親の商談のparentOppFlag__cはTRUEのまま。0だった場合にはparentOppFlag__cをFALSEにする
というものです。

1については、冒頭のリンク先を参照して以下のように実装しました。
2については、Trigger.oldを使ってデータを取得する必要がありどのように実装すべきかがわかっておりせん。
どなたかお知恵を拝借できないでしょうか。

1のコードは以下の通り

Trigger
trigger updateChildOppTrigger on Opportunity (after update , after delete , after insert) {
    
    updateChildOppTriggerHandler handler = new updateChildOppTriggerHandler();
    
    if (Trigger.isAfter) {
        if (Trigger.isInsert) {
            // 新規の場合:親商談がある商談を更新
            handler.updateOpportunityInsert(Trigger.new);
        }

    }
}


Handler
public with sharing class updateChildOppTriggerHandler {

    public updateChildOppTriggerHandler() {
        
    }

    public void updateOpportunityInsert(List<Opportunity> prmOpportunities) {
        
        // 最初に商談に紐付く親商談IDを取得
    	Set<Id> opportunityIds = new Set<Id>();
        for (Opportunity o : prmOpportunities) {
            if (String.isNotEmpty(o.parentOpp__c )) {
            	opportunityIds.add(o.parentOpp__c );
            }
        }

        // 取引先IDを条件に取引先を取得する
        List<Opportunity> opportunities = [SELECT Id,parentOpp__c  FROM Opportunity WHERE Id IN: opportunityIds];

        // 取引先に値をセットする
        for (Opportunity a : opportunities) {
        	a.parentOppFlag__c = True;
        }

        // 取引先を更新する
        update opportunities;
    }
}

 
Hello,

I have a custom object like below:
CustomObj__c
CustomField1__c (Picklist, values = Val1, Val2, val3)
CustomField2__c (lookup)

I want to control the display of the CustomField2__c depending on CustomField1__c

if(CustomField1__c = 'val1')
then CustomField2__c should be mandatory
else if (CustomField1__c = 'val2')
then CustomField2__c is hidden and should be not mandatory
else if (CustomField1__c = 'val3')
then the CustomField2__c is visible but not mandatory
<apex:inputField value="{!CustomObj__c.CustomField2__c }" required="{!logic1}" rendered="{logic2}"/>
thank you for suggestions !
  • December 26, 2016
  • Like
  • 0
hello Everyone,
actually i want to automate the process of  'add to campaign member' but i am getting some error.
Here are the scenario details : 
Whenever any lead enters in the database with LeadSource = Linkedin (PicklistValue) it should automatically get added to the particular campaign which will be having a specific campaign id.
I think this secnario can handle with Trigger , Flows and Process Builder 
I have tried Everything to implement this secnario but i am getting Some errors. please help me to complete this automation.
Any help will be appreciable :)

here is the Trigger
trigger add_member_to_camp on Lead (before insert,after insert) {
   List<CampaignMember> members = new List<CampaignMember>();
    
    for(lead l : Trigger.new){
        
        if(l.LeadSource == 'linkedin'){
            CampaignMember cm = new CampaignMember(CampaignId = '70128000000Btjj');
        }
        try{
        insert members;
    } catch(DmlException e) {
        System.debug('An unexpected error has occured: ' + e.getMessage());
    }
    }

}

Flow 

User-added image

User-added image


User-added image


User-added image

User-added image


And Process builder also  showing some Error 
please help me 

Thanks 
Bharat Sharma
Dear All,
I have a below field, Age main, on a custom object " Quote", The " Main Driver" field is replicating from the account name ( personal account).
User-added image

The age & other details also get replicate from the account, i.e here the age 23 is maintained in the account " Chimni", But the user have the flexibility to edit the age on the same page or while cloning the page to get a new quote. But i need to set a validation rule where , the user can set only one year gap from the maintained one ( i.e he can edit it as either 23 or 25), it should show validation error if its 22 or 27 etc. If you can help me out in setting. Thnx

I tried to write the below VR but its showing syntax error, and failing.
 
(Age_MainD__c) <> OR(PRIORVALUE(Age_MainD__c)+1, PRIORVALUE(Age_MainD__c)-1)


Alternatives : 

Age_MainD__c <> PRIORVALUE(Age_MainD__c)+1
OR Age_MainD__c <> PRIORVALUE(Age_MainD__c)-1

 
I was trying to get Superbadge Reports & Dashboards Specialist
https://trailhead.salesforce.com/en/super_badges/superbadge_reports

I have imported all the data in the excel sheet provided
http://developer.salesforce.com/files/Sanditas_Import_File.xlsx

Issue is there is no Hobby type in excel as I see in the trailhead scenario, Is the excel sheet updated ?

I created a bucket field 'Hobby Type" in report but there are no matching hobbies

User-added image

 
component code:

<aura:component>
    <aura:attribute name="items" type="Camping_Item__c[]" />
    <aura:attribute name="newItem" type="Camping_Item__c" default="{
                                                                 'sObjectType' : 'Camping_Item__c',
                                                                   'Name' : '',
                                                                   'Price__c' : 0 ,
                                                                   'Quantity__c' : 0}"/>
    
    
   <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputText aura:id="name" label="Name"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.name__c}" 
                  required="true"/>
          </div>
      </div>

     <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputCurrency aura:id="price" label="Price"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Price__c}"
                  required="true"/>
          </div>
      </div>

     <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputNumber aura:id="Quantity" label="Quantity"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Quantity__c}"
                  required="true"/>
          </div>
      </div>
  
     <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:button label="Add Camping Item"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  press="{!c.submitForm}"/>
          </div>
      </div>

    <aura:iteration items="{!v.items}" var="item">
         <c:campingListItem item="{!item}"/>
     </aura:iteration>  
</aura:component>

controller code:

({
    submitForm : function(component, event, helper) {
        var validItem = true;
        
        if($A.utils.isEmpty(component.find("name").get("v.value"))){
            validItem = false;
            component.find("name").set("v.errors",[{message : "Please give a name"}]);
        }
        else{
            component.find("name").set("v.errors" , null);
        }
        
        if($A.utils.isEmpty(component.find("price").get("v.value"))){
            validItem = false;
            component.find("price").set("v.errors",[{message : "Please give a price"}]);
        }
        else{
            component.find("price").set("v.errors" , null);
        }
        
        if($A.utils.isEmpty(component.find("Quantity").get("v.value"))){
            validItem = false;
            component.find("Quantity").set("v.errors",[{message : "Please give a Quantity"}]);
        }
        else{
            component.find("Quantity").set("v.errors" , null);
        }
        
        if(validItem){
            var item = component.get("v.newItem");
            helper.createItem(component , item);
        }
       
    }
})


Helper code:

({
    createItem : function(component , newItem) {
        var items = component.get("v.items");
        items.push(newItem);
        component.set("v.items" , items);
    }
})
Hi,

Is there any soql, meta data, or other ways,
to get the list of custom object permissions data (such as read, write,..),
that already assigned to every profiles.

Regards,
LinThaw.
I want to place a custom button in existing component and once i click on that button need to open a new window with the existing visual force page please suggest me 
salesforce1アプリで、参照関係にあるオブジェクトを入力しようとした時に検索条件がNameの項目しか出てこないです。
PCサイトでは正常に設定が出来て、探したい項目が条件に入っているのですが、モバイルの設定はどの様にしたらよいのでしょうか?
モバイル用の検索条件がどこかにあるのでしょうか。

ご存知の方がいらっしゃれば教えて頂けると幸いです。
I have built a lightning page where I want to display summarized data from an aggregate apex method. my method has some return value problem. this is my method and I want to return Ass and Credits 
my code is below
public class OutstandingCreditAuraController {
@AuraEnabled public static List<Assessment_Schedule__c> getOutstandingCredits(){
List<AggregateResult> agrResults = [SELECT Assessor_name__c ass,
Sum(Credits__c) credits
FROM Assessment_Schedule__c
WHERE (TEC_Status__c = 'Active' OR TEC_Status__c = 'On Hold') and (Company__c = 'CityFitness HO')
Group By Assessor_name__c];

for (AggregateResult ar: agrResults){
return((decimal)ar.get('credits'));
}
}
}
商談からメールを送る時に、商談の項目の値により、ポップアップウィンドウを表示したいと考えています。
カスタムボタンでJavaScriptにより、条件式がtrueならポップアップを表示後、メール作成画面へ遷移。
falseならメール作成画面に遷移するようにしたいです。

JavaScriptでポップアップ表示の判定後に、活動の標準ボタン「メールの送信」を起動することは実現可能でしょうか。
ご教授ください。よろしくお願いします。

流れとしては下記を想定しています。
1).商談のカスタムボタン「メール送信」をクリック
2).(1)のボタンクリック時に、商談の項目値A = Trueならポップアップを表示、ユーザーOKクリック後、活動標準ボタンの「メール作成画面」へ遷移
  商談の項目値A = falseなら直接、活動標準ボタンの「メール作成画面」へ遷移
3).メール作成後、送信
4).活動履歴にメール送信履歴を保存
Hello.

I am fairly new to salesfroce and here's my scenario - I created a custom object to add to the Opportunity related list called Transactions - users enter the transaction data manually as part of a Proof of Concept.  The requirement is to carry over the related list with the associated data to the Contact object.  I can add the Transactions custom object as a related list in the Contact object with the associated fields; however, the data does not carry over.  Can you please assist in identifyig what I'm missing?

Thanks,

Marvin 
Dear All, I need here your suggestion urgently. Now i know that we can make field dependencies for picklist values, but its only one to one . But my requirement is as per below,
User-added image
Now, i want the field " Model Family" is to make dependent upon above two field " Make" and " Year of manufacture". To note that,, its not a hierarchy, i.e Make and Year of manuf. are not linked. If it would be a hierarchy, i could have created two field dependencies. But here how to go ahead. plz suggest? e.g here Model family should be show the picklists depends upon what been choosen on " Make" & "Year of manuf".
User-added image
お世話になっております。

ToDoを新規作成する際の入力項目である任命先や件名について、
初期値を変更したいと考えております。

アラームに関しては、個人のアラーム設定を変更することで
オフにすることができましたが、任命先や件名についても対応が可能でしょうか?

よろしくお願いいたします。
  • September 27, 2016
  • Like
  • 0
Hi,
I have two custom picklist fields on Contact object - Country and Country Code. Both fields have 250 picklist values each. I want to auto-populate the country code as soon as the value of country is filled by the user while creating/editing a Contact. Can anyone please guide me? I am quite new to salesforce development.
Thanks for your help !
i got this error need help...
Here is the Apex Class

public class FileUploadController{
public Document document {get; set;}
public String url {get; set;}
public boolean hasImage {get; set;}
public static final String hasImage;
public static final String document;

public static void FileUpload()
    {
        hasImage = false;
        document = new document();
    }

public PageReference doUpload()
    {
if (document.body != null)
{
     System.debug('@@@@@@@@ document:' + document.name);
     if (document.name != null)
     {
         System.debug('@@@@@@@@ doSave');
         Document d = document;
         System.debug(document);
         System.debug('@@@@@@@@ document name: '+d.name);
         System.debug(d);
         d.folderid = UserInfo.getUserId(); //store in Personal Documents
         System.debug('@@@@@@@@ document folder id: '+d.folderid);
         d.IsPublic = true;
        try
        {
            insert d;
            url = DocumentUtil.getInstance().getURL(d);
            hasImage = true;
        }
        catch (Exception e)
        {
            ApexPages.addMessages(e);
            url = '';
        }
        d.body = null;
        System.debug('@@@@@@@@ document object id: '+d.id);
        String url = DocumentUtil.getInstance(d).getURL();
        System.debug('######## document content type: '+d.type);
    }
 }
     PageReference page = new PageReference('/apex/FileUpload');
     return page;

    }

/*  static testmethod void testFileUpload()
    {
        FileUpload fu = new FileUpload();
        fu.doUpload();
        fu.document.Name = 'test1';
        fu.document.Body = Blob.valueOf('test1');
        fu.doUpload();
    } */

 }


 
Hi, This might be a tall order, but I'm a Salesforce admin at a nonprofit with only basic level admin skills, so no knowledge of Visualforce or Apex. But my users are getting frustrated by the tediousness of having to create 4 records every time they want to track a conversation with someone new. They're creating the contact record, the account record, and two custom object records - affiliation and conversation. Is there any chance that someone out there has some simple code to help me create one page view that allows them to create all 4 records? With some guidance on how to insert custom fields and objects?

Thanks!
Dear Folks,

I'm struggling to figure out the error and need your help. I'm trying to workout SOAP Integration between 2 salesforce org, encounteres below error. Pls help me out. 

Error: Invalid Data. Review all error messages below to correct your data. Apex trigger AccountSyncSOAP caused an unexpected exception, contact your administrator: AccountSyncSOAP: execution of AfterInsert caused by: System.CalloutException: Callout from triggers are currently not supported.: Class.partnerSoapSforceCom.Soap.login: line 3410, column 1

APEX class:
public class AccountSyncSOAP {

    public static void Connector(String name){
        partnerSoapSforceCom.soap myPartnerSOAP = new partnerSoapSforceCom.soap();
        partnerSoapSforceCom.LoginResult partnerLoginResult = myPartnerSOAP.login('username@username.com','PASSWORD+TOKENHgaWESnkrmTdX8ouH0BPJGmhE');
        
        system.debug('partnerLoginResult >>>>>'+partnerLoginResult);
        system.debug('partnerLoginResult >>>>>'+partnerLoginResult.sessionId);
        
        soapAccount.SessionHeader_element webserviceSessionHeader = new soapAccount.SessionHeader_element();
        webserviceSessionHeader.sessionId = partnerLoginResult.sessionId;
        
        soapAccount.AccountSyncSOAP objA1 = new soapAccount.AccountSyncSOAP();
        objA1.SessionHeader = webserviceSessionHeader;
        String Id = objA1.createAccount(name);
        system.debug('ID >>>>>> '+Id);
    }
}

WSDL(Partner):
//Generated by wsdl2apex

public class soapAccount {
    public class LogInfo {
        public String category;
        public String level;
        private String[] category_type_info = new String[]{'category','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] level_type_info = new String[]{'level','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'category','level'};
    }
    public class DebuggingInfo_element {
        public String debugLog;
        private String[] debugLog_type_info = new String[]{'debugLog','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'debugLog'};
    }
    public class address {
        public String city;
        public String country;
        public String countryCode;
        public String geocodeAccuracy;
        public String postalCode;
        public String state;
        public String stateCode;
        public String street;
        private String[] city_type_info = new String[]{'city','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] country_type_info = new String[]{'country','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] countryCode_type_info = new String[]{'countryCode','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] geocodeAccuracy_type_info = new String[]{'geocodeAccuracy','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] postalCode_type_info = new String[]{'postalCode','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] state_type_info = new String[]{'state','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] stateCode_type_info = new String[]{'stateCode','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] street_type_info = new String[]{'street','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'city','country','countryCode','geocodeAccuracy','postalCode','state','stateCode','street'};
    }
    public class SessionHeader_element {
        public String sessionId;
        private String[] sessionId_type_info = new String[]{'sessionId','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'sessionId'};
    }
    public class CallOptions_element {
        public String client;
        private String[] client_type_info = new String[]{'client','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'client'};
    }
    public class DebuggingHeader_element {
        public soapAccount.LogInfo[] categories;
        public String debugLevel;
        private String[] categories_type_info = new String[]{'categories','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'0','-1','false'};
        private String[] debugLevel_type_info = new String[]{'debugLevel','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'categories','debugLevel'};
    }
    public class location {
        public Double latitude;
        public Double longitude;
        private String[] latitude_type_info = new String[]{'latitude','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] longitude_type_info = new String[]{'longitude','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'latitude','longitude'};
    }
    public class AllowFieldTruncationHeader_element {
        public Boolean allowFieldTruncation;
        private String[] allowFieldTruncation_type_info = new String[]{'allowFieldTruncation','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'allowFieldTruncation'};
    }
    public class createAccount_element {
        public String Name;
        private String[] Name_type_info = new String[]{'Name','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'Name'};
    }
    public class createAccountResponse_element {
        public String result;
        private String[] result_type_info = new String[]{'result','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'result'};
    }
    public class AccountSyncSOAP {
        public String endpoint_x = 'https://ap1.salesforce.com/services/Soap/class/AccountSyncSOAP';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        public soapAccount.SessionHeader_element SessionHeader;
        public soapAccount.DebuggingInfo_element DebuggingInfo;
        public soapAccount.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        public soapAccount.CallOptions_element CallOptions;
        public soapAccount.DebuggingHeader_element DebuggingHeader;
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP', 'soapAccount'};
        public String createAccount(String Name) {
            soapAccount.createAccount_element request_x = new soapAccount.createAccount_element();
            request_x.Name = Name;
            soapAccount.createAccountResponse_element response_x;
            Map<String, soapAccount.createAccountResponse_element> response_map_x = new Map<String, soapAccount.createAccountResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/schemas/class/AccountSyncSOAP',
              'createAccount',
              'http://soap.sforce.com/schemas/class/AccountSyncSOAP',
              'createAccountResponse',
              'soapAccount.createAccountResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.result;
        }
    }
}
I need to pass some URL/query parameters between Visualforce pages which are embedded in the lightning app.

Let's assume URL is -
https://cs1.lightning.force.com/one/one.app#/sObject/Opportunity/new?Unit__c=a0Zp0000002mja8ETA&isdtp=p1

So how can I access Unit__c in the controller?

The following code segment is not working with Lightning.
ApexPages.currentPage().getParameters().get('Unit__c')
Is there a way to redirect to a Lighting Component from a Visualforce Page and pass in attribute values?
I am working on the Reporting Superbadge in Trailheads and seems like the challenge is incorrectly saying my dashboard is set up wrong. It is the Sales Manager dashboard and the error says that my headers and titles are wrong. I have gone over and over them, even copied and pasted exactly from the table in the directs, careful to avoid unnecessary spaces and match case. Both by comparing to the pic of the dasbhoad and the chart with details in the directions, it looks exactly correct. Anyone else have this issue or have a clue what else I could look at? 
In a simple test, searching for portions of a record id return different results.  The problem is searching for the smaller subset of the record id returns less records.  How is it possible the shorter string is not found in every record where the larger string is found?

Example:
FIND {a0rK0000004F} returns 416 records
FIND {a0rK0000004} returns 112 records

How is this possible?

Additional Details:
- Both searches are returning the same object type and fields
- This is being executed in Query Editor within Developer Console.
HI All,

I am going through the "Customize Your Login Process with My Domain" topic and have created a new domain called "TrailheadNew". But when I click on Check challenge it is redirecting to :playful-raccoon-375867-dev-ed.my.salesforce.com and getting an error as Server not found.Do to this, I am unable to take any more challenges.

Can someone suggest me on this?

Thanks
 
Hi all,
I am doing trialhead modules with a production account(because of my company's policy).
When i clicked this: 
User-added image
it will redirect to https://playful-bear-489989-dev-ed.my.salesforce.com/home/home.jsp,
a new environment and i can do my trailhead there.

But i can't create a new project on my IDE(using Sublime - mavensmate) as the following:
User-added image

i tried all options there but failed.
Or it just can't be done when using this kind of account?
Thanks for answering.

Reggie.
Here is my button code: 


{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")} 
var result = sforce.apex.execute("SendAccountUsingRESTAPI","callgetContact",{IDD:"{! 
Account.Id}"});



APex class which i m calling: 

Global class SendAccountUsingRESTAPI {
  

  Global class deserializeResponse
   {
      public String id;
      public String access_token;
   } 
 
   webservice static void callgetContact(Id IDD)
   { }
}

When i am clicking on button it gives me an error: {faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/SendAccountUsingRESTAPI }callgetContact, please check the WSDL for the service.', }"

Thank you in advance!
コミュニティではなく、組織のログアウト機能を実装したいと思っています。
しかし、調べたところで実装方法は見つからず、ログインページに飛ばせという記述のみ見つけました。

ログアウト機能は本当に実装できないのでしょうか。
また、できない場合はログインページに飛ばそうと思いますが、
組織のドメインが変わっても問題なく機能するリンクの記述方法はありますか?(URLFORなど)

よろしくお願いします。
I wanted to display a case details as a table when user enters a case number and hit ''search" button.
I dont know what is wrong with my code. I also tried to display the searched element on browser console and log.. but its not working. Pleae help me out!!

My Controller:
global with sharing class CaseSearch {
    
    public string searchElement {get; set;}
    public static Case c;
    
    public CaseSearch(ApexPages.StandardController controller) {

    }
    
    @RemoteAction
    global static Case caseSearchMethod(string searchElement){
        c = [SELECT Id,Account.name,status FROM Case WHERE CaseNumber= :searchElement LIMIT 1];
        system.debug(searchElement);
        return c;
        }
}

and here is my Visualforce Page:
<apex:page standardController="Case" extensions="CaseSearch">
<apex:messages />
<style>
    input{
        float: center;
        width: 100%;
        padding: 12px  50px;
        margin: 8px 0;
        display: inline-block;
        border: 2px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
    }
    .center{
        margin: auto;
        width: 60%;
        //border: 3px solid #73AD21;
        padding: 10px;
    }
    h{
        font-size: 20px; 
        text-align: center;
    }
    table {
        border: 1px solid;
        padding: 12px 20px;
    }
</style>
<script type="text/javascript"> 
    function search(){
    var searchElement = document.getElementById.('case_number').value;
        window.alert("Hello!");
        console.log(searchElement);
        Visualforce.remoting.manager.invokeAction("{!$remoteAction.CaseSearch.caseSearchMethod}",searchElement,function(result,event){
            if(event.status){
                console.log(searchElement);
            }
        });
    }
</script>
    <br/><br/><br/><br/>
    <div class="center">
        <input placeholder="Please Enter Your Case Number Here" id="case_number"></input>
        <Button type="button" value="Search" onclick="search()">Search</button>
    </div>
    <div id="caseDetails" class="center" rendered="false">
        <table style="width:100%">
            <tr>
                <th style="25%">Case Number</th>
                <th style="25%">Name</th>
                <th style="25%">Status</th>
            </tr>
            <tr>
                <td><apex:outputText value="{!C.CaseNumber}"></apex:outputText></td>
                <td><apex:outputText value="{!C.account.name}"></apex:outputText></td>
                <td><apex:outputText value="{!C.status}"></apex:outputText></td>
            </tr>
        </table>
    </div>

</apex:page>
*It would be nice if you help me to show the case details table only after I hit 'Search' button and align the search button to center.

Thanks in Advance!!
Javeed Shaik
こちらを参照してトリガとハンドラを作っています

商談オブジェクト(Opportunity)の中にカスタム項目で親商談(parentOpp__c)という項目を作り、商談に親子関係を作っています。
親商談1に対して子商談が複数付く事があります。

トリガで実現したいのは、
1:子商談の紐付けがされた時に親商談の親商談フラグ(parentOppFlag__c)をTRUEにするということと
2:子商談の親商談の紐付け(parentOpp__c)が削除された時、子商談自体が削除された時に、削除された parentOpp__cのIDを持っている商談をSELECTしてそのリストが1以上だった場合は親の商談のparentOppFlag__cはTRUEのまま。0だった場合にはparentOppFlag__cをFALSEにする
というものです。

1については、冒頭のリンク先を参照して以下のように実装しました。
2については、Trigger.oldを使ってデータを取得する必要がありどのように実装すべきかがわかっておりせん。
どなたかお知恵を拝借できないでしょうか。

1のコードは以下の通り

Trigger
trigger updateChildOppTrigger on Opportunity (after update , after delete , after insert) {
    
    updateChildOppTriggerHandler handler = new updateChildOppTriggerHandler();
    
    if (Trigger.isAfter) {
        if (Trigger.isInsert) {
            // 新規の場合:親商談がある商談を更新
            handler.updateOpportunityInsert(Trigger.new);
        }

    }
}


Handler
public with sharing class updateChildOppTriggerHandler {

    public updateChildOppTriggerHandler() {
        
    }

    public void updateOpportunityInsert(List<Opportunity> prmOpportunities) {
        
        // 最初に商談に紐付く親商談IDを取得
    	Set<Id> opportunityIds = new Set<Id>();
        for (Opportunity o : prmOpportunities) {
            if (String.isNotEmpty(o.parentOpp__c )) {
            	opportunityIds.add(o.parentOpp__c );
            }
        }

        // 取引先IDを条件に取引先を取得する
        List<Opportunity> opportunities = [SELECT Id,parentOpp__c  FROM Opportunity WHERE Id IN: opportunityIds];

        // 取引先に値をセットする
        for (Opportunity a : opportunities) {
        	a.parentOppFlag__c = True;
        }

        // 取引先を更新する
        update opportunities;
    }
}

 
I am relatively new to SF development. I have created a custom VisualForce lead page. I need to add activity list for the lead, with the ability to view / add to that activity list for the lead as is possible on the standard SF lead page. I have searched this forum and the web, but not found exactly what I need and would like an example if possible to put the pieces together. Thanks!
i have a trigger which shows error while trying to delete a record . it is working fine but after that the requirement is to send email to owner of that record . it is not working . i am posting my code . please check and provide the solution .

Trigger : 
Trigger ErrorDelete on Course__c(before delete) {
    Messaging.reserveSingleEmailCapacity(trigger.size);
    List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>();
    for (Course__c c: Trigger.old) {
        c.adderror ('can not delete');
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
        email.setToAddresses(new String[] {'ranjan.soubhagya2015@gmail.com'});
        email.setSubject('Deleted Account Alert');
        email.setPlainTextBody('This message is to alert you that the account  has been deleted.');
        emails.add(email);
    Messaging.sendEmail(emails);
        
    }
    
}




whenever i am commenting the adderror line then mail is sending but at a time error showing and email sending not working 
hello Everyone,
actually i want to automate the process of  'add to campaign member' but i am getting some error.
Here are the scenario details : 
Whenever any lead enters in the database with LeadSource = Linkedin (PicklistValue) it should automatically get added to the particular campaign which will be having a specific campaign id.
I think this secnario can handle with Trigger , Flows and Process Builder 
I have tried Everything to implement this secnario but i am getting Some errors. please help me to complete this automation.
Any help will be appreciable :)

here is the Trigger
trigger add_member_to_camp on Lead (before insert,after insert) {
   List<CampaignMember> members = new List<CampaignMember>();
    
    for(lead l : Trigger.new){
        
        if(l.LeadSource == 'linkedin'){
            CampaignMember cm = new CampaignMember(CampaignId = '70128000000Btjj');
        }
        try{
        insert members;
    } catch(DmlException e) {
        System.debug('An unexpected error has occured: ' + e.getMessage());
    }
    }

}

Flow 

User-added image

User-added image


User-added image


User-added image

User-added image


And Process builder also  showing some Error 
please help me 

Thanks 
Bharat Sharma