• 병훈 송
  • NEWBIE
  • 85 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 7
    Replies
My code : 

var hiddenElement = document.createElement('a');
            
            hiddenElement.href = 'data:application/vnd.ms-excel,' + encodeURI(component.get('v.excelTemp'));
            hiddenElement.target = '_blank';
            hiddenElement.download = supplier + ' ' + today.getFullYear() + monthDigit + dayDigit + '.xls'; 
            hiddenElement.click();


This code is working in CHROME..
and... not working in IE

How do I make it work in IE?
I want know Field Type.
Um..  Not REFERENCE.!
LookUp or Master-Detail..

I want to make =  "I can't make bigger than two of Master-Detail Field."...


 
Map<String, Schema.SObjectField> typeMap = Schema.getGlobalDescribe().get(obj.name).getDescribe().fields.getMap();
        for(Schema.SObjectField ff : typeMap.values()) {
            Object typeO = ff.getDescribe().getType();
            typeTemp = String.valueOf(typeO);
            System.debug('typeO = ' + typeO);
            if(typeTemp == 'REFERENCE') {
......................................
            }

        }

 
I develop Apex Code, is Create Field.
That made by Metadata API..

A Object and B Object must have Only one master-detail Field, right?

I created Master(A)-Detail(B) Field in B Object. and

When I create Master-Detail Field, I want know Master-detail Field related to A Object.

How to get Master SObject Name of Master-Detail Field?
 
Map<String, Schema.SObjectField> fieldMap = Schema.getGlobalDescribe().get('B__c').getDescribe().fields.getMap();
            for(Schema.SObjectField f : fieldMap.values()) {
                System.debug(f.getDescribe());
            }

I was execute code.
But I can't find Object A Name....
 
I'm a novice salesforce developer with 5 months of experience.

I used Development Tools is Developer Console

I want use Intellij.. but I don't know setting Intellij for salesforce.

Help me..!  I try search that, but it was not exist..

 
How can I find Salesforce's every relationship?

I want create Master-Detail Field or LookUp Relationship Field by "Salesforce Metadata Api"
Problem occurred here!

When Child Relationship Name duplicated, that make error.
So.....First, I find every RelationShip by Salesforce Query and,
I want Find overlapping Child Relationship Name..

How can I do it?
How to, Javascript Library in Salesforce Lightning Component?

I want make Draw Flow Chart in Lightning Component, (just draw)

I found this : https://gojs.net/latest/samples/flowchart.html 

I want apply Library in Lightning Component


I made component, and Component Code is  : 
 
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" > 
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> 
<ltng:require scripts="{!join($Resource.Tree + '/release/go.js', $Resource.Tree + '/assets/js/goSamples.js')}"/> </aura:component>

Controller Code is : 
 
({  
    init: function() {
        if (window.goSamples) goSamples();  // init for these samples -- you don't need to call this
        var ab = go.GraphObject.make;  // for conciseness in defining templates
        
        myDiagram =
            ab(go.Diagram, 'myDiagramDiv',  // must name or refer to the DIV HTML element
              {
                  initialContentAlignment: go.Spot.Center,
                  allowDrop: true,  // must be true to accept drops from the Palette
                  'LinkDrawn': showLinkLabel,  // this DiagramEvent listener is defined below
                  'LinkRelinked': showLinkLabel,
                  scrollsPageOnFocus: false,
                  'undoManager.isEnabled': true  // enable undo & redo
              })
        
        // when the document is modified, add a "*" to the title and enable the "Save" button
        myDiagram.addDiagramListener('Modified', function(e) {
            var button = document.getElementById('SaveButton');
            if (button) button.disabled = !myDiagram.isModified;
            var idx = document.title.indexOf('*');
            if (myDiagram.isModified) {
                if (idx < 0) document.title += '*';
            } else {
                if (idx >= 0) document.title = document.title.substr(0, idx);
            }
        }
	}
})



does not saved.... error

How can I do?​

plz
Help me
Number fields in 'classic' are right aligned and in 'lightning' are left aligned.
I want in 'lightning' are right aligned..

If visualforce page, then I use css.
but standard page..........

How can I do?
How can I split components?

I created 1 Components.
but I want split them....

How to split component?


My Component Code is :
<aura:component controller="AccountListController" implements="force:appHostable" >
    <aura:attribute name="accounts" type="List"/>
    <aura:attribute name="pageSize" type="Integer" default="5"/>
    <aura:attribute name="pageNumber" type="Integer" default="1"/>
    <aura:attribute name="searchName" type="String"/>
    <aura:attribute name="totalPage" type="Integer" default="1"/>

  <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    
    <c:ListSearch/>
    
    <table class="slds-table slds-table--bordered slds-table--striped slds-table--cell-buffer slds-table--fixed-layout">
    <thead>
      <tr class="slds-text-heading--label">
        <th scope="col"><div class="slds-truncate" title="검색">검색</div></th>
        <th scope="col"><div class="slds-truncate" title="버튼">버튼</div></th>
      </tr>
    </thead>
    <tbody>
        <tr>
          <td><div class="slds-truncate" title="{!v.searchName}">
              <lightning:input name="SearchName" label="SearchName" value="{!v.searchName}"/>
              </div></td>
          <td><div class="slds-truncate" title="검색버튼">
              <lightning:button variant="brand" label="Search" onclick="{!c.search }" />
              </div></td>
        </tr>
    </tbody>
  </table>
    
    
    <br></br>
    
  <table class="slds-table slds-table--bordered slds-table--striped slds-table--cell-buffer slds-table--fixed-layout">
    <thead>
      <tr class="slds-text-heading--label">
        <th scope="col"><div class="slds-truncate" title="Name">Name</div></th>
        <th scope="col"><div class="slds-truncate" title="Phone">Phone</div></th>
      </tr>
    </thead>
    <tbody>
      <aura:iteration items="{!v.accounts}" var="account">
        <tr>
          <td><div class="slds-truncate" title="{!account.Name}">{!account.Name}</div></td>
          <td><div class="slds-truncate" title="{!account.Phone}">{!account.Phone}</div></td>
        </tr>
      </aura:iteration>
    </tbody>
  </table>
    
    
    
   <div align="center">
              <lightning:button variant="brand" label="First" onclick="{!c.first }" />
              <lightning:button variant="brand" label="Prev" onclick="{!c.prev }" />
       <ui:outputText value="{!v.pageNumber}" />/<ui:outputText value="{!v.totalPage}" />
              <lightning:button variant="brand" label="Next" onclick="{!c.next }" />
              <lightning:button variant="brand" label="Last" onclick="{!c.last }" />

    </div>
    
    
</aura:component>

and Controller is :
 
({
    doInit: function(component, event, helper) {      
    var action = component.get('c.getAccountList');
    component.get("c.getAccountList");
        action.setParams({
            pageSize: component.get("v.pageSize"),
            pageNumber: component.get("v.pageNumber")
        });
    action.setCallback(this, function(actionResult) {
     component.set('v.accounts', actionResult.getReturnValue());
    });
    $A.enqueueAction(action);
        
    var action2 = component.get('c.getTotalPage');
    action2.setCallback(this, function(actionResult) {
     component.set('v.totalPage', actionResult.getReturnValue());
    });

    $A.enqueueAction(action2);
  },
    search: function(component, event, helper) {      
    var action = component.get('c.getAccountList');
    component.get("c.getAccountList");
        action.setParams({
            pageSize: component.get("v.pageSize"),
            pageNumber: component.get("v.pageNumber"),
            name: component.get("v.searchName")
        });
    action.setCallback(this, function(actionResult) {
     component.set('v.accounts', actionResult.getReturnValue());
    });
    $A.enqueueAction(action);
        
        var action2 = component.get('c.getTotalPage');
        action2.setParams({
            name: component.get("v.searchName")
        });
    action2.setCallback(this, function(actionResult) {
     component.set('v.totalPage', actionResult.getReturnValue());
    });

    $A.enqueueAction(action2);
  } , 
    next: function(component, event, helper) {      
    var action = component.get('c.getAccountList');
    var next = component.get("v.pageNumber") + 1;
    component.set('v.pageNumber', next);
    component.get("c.getAccountList");
        action.setParams({
            pageSize: component.get("v.pageSize"),
            pageNumber: component.get("v.pageNumber"),
            name: component.get("v.searchName")
        });
    action.setCallback(this, function(actionResult) {
     component.set('v.accounts', actionResult.getReturnValue());
        component.set('v.firstC', false);
    });
    $A.enqueueAction(action);
  }, 
    prev: function(component, event, helper) {      
    var action = component.get('c.getAccountList');
    if(component.get("v.pageNumber")>1)
    {
        var next = component.get("v.pageNumber") - 1;
        component.set('v.pageNumber', next);
    }
    
    component.get("c.getAccountList");
        action.setParams({
            pageSize: component.get("v.pageSize"),
            pageNumber: component.get("v.pageNumber"),
            name: component.get("v.searchName")
        });
    action.setCallback(this, function(actionResult) {
     component.set('v.accounts', actionResult.getReturnValue());
        if(component.get("v.pageNumber")==1) {
            var btn = event.getSource();
			btn.set("v.disabled",true);
        }
    });
    $A.enqueueAction(action);
  }, 
    first: function(component, event, helper) {      
    var action = component.get('c.getAccountList');
   	component.set('v.pageNumber', 1);    
    component.get("c.getAccountList");
        action.setParams({
            pageSize: component.get("v.pageSize"),
            pageNumber: 1,
            name: component.get("v.searchName")
        });
    action.setCallback(this, function(actionResult) {
     component.set('v.accounts', actionResult.getReturnValue());
        if(component.get("v.pageNumber")==1) {
            var btn = event.getSource();
			btn.set("v.disabled",true);
        }
    });
    $A.enqueueAction(action);
  }, 
    last: function(component, event, helper) {      
    var action = component.get('c.getAccountList');
   	component.set('v.pageNumber', component.get("v.totalPage"));    
    component.get("c.getAccountList");
        action.setParams({
            pageSize: component.get("v.pageSize"),
            pageNumber: component.get("v.totalPage"),
            name: component.get("v.searchName")
        });
    action.setCallback(this, function(actionResult) {
        component.set('v.accounts', actionResult.getReturnValue());
        component.set('v.firstC', false);
    });
    $A.enqueueAction(action);
  }
    
    
})

and Apex Controller is :
 
public class AccountListController {
	@AuraEnabled
    public static List<Account> getAccountList (Integer pageSize, Integer pageNumber, String name) {
        
        String sName = '%' + name + '%';
        Integer size = integer.valueof(pageSize);
        Integer page = integer.valueof(pageNumber) - 1;
        Integer offsetSize = size * page;
        
        if(name==null){
            return [SELECT Id, Name, Phone FROM Account LIMIT :size OFFSET :offsetSize];
        }
        
        return [SELECT Id, Name, Phone FROM Account Where Name Like :sName LIMIT :size OFFSET :offsetSize];
     }
    
    @AuraEnabled
    public static Integer getTotalPage (String name) {
        String sName = '%' + name + '%';
        List<Account> aList = new List<Account>();
        if(name==null){
            aList = [SELECT Id, Name, Phone FROM Account];
        } else {
        aList = [SELECT Id, Name, Phone FROM Account Where Name Like :sName];
		}
        Integer flag = math.mod(aList.size(), 5);
        if(flag>0) {
           return aList.size()/5+1; 
        }
        return aList.size()/5;
        
     }
    
    
   
  }



I want split Component.

1. List Search Component
2. List View Component
​3. List Pagination Button Component
4. This Component is include 1, 2, 3

Are you busy? then Teach me just once.


I want, clicked  <apex:outputLink value="{!URLFOR($Page.CampaignEdit, cp.Id)}">{! cp.Name }</apex:outputLink>
then go to capmaign detail page(bottom code page)

How to make connect ObjectId in visualforce page

Maybe I setting Url this? force.com/apex/CampaignEdit?Id=7017F000000UKEeQAO
or other way?
How is "Lightning Data Service "know which record from "record id"?
Does "record id" included "record type"?
Code reference only record id, not record type
 
<aura:component implements="flexipage:availableForRecordHome,force:lightningQuickActionWithoutHeader, force:hasRecordId">

    <aura:attribute name="record" type="Object"/>
    <aura:attribute name="simpleRecord" type="Object"/>
    <aura:attribute name="recordError" type="String"/>

    <force:recordData aura:id="recordLoader"
      recordId="{!v.recordId}"
      layoutType="FULL"
      targetRecord="{!v.record}"
      targetFields="{!v.simpleRecord}"
      targetError="{!v.recordError}"
      recordUpdated="{!c.handleRecordUpdated}"
      />

    <!-- Display a header with details about the record -->
    <div class="slds-page-header" role="banner">
        <p class="slds-text-heading_label">{!v.simpleRecord.Name}</p>
        <h1 class="slds-page-header__title slds-m-right_small
            slds-truncate slds-align-left">{!v.simpleRecord.BillingCity}, {!v.simpleRecord.BillingState}</h1>
    </div>

    <!-- Display Lightning Data Service errors, if any -->
    <aura:if isTrue="{!not(empty(v.recordError))}">
        <div class="recordError">
            <ui:message title="Error" severity="error" closable="true">
                {!v.recordError}
            </ui:message>
        </div>
    </aura:if>
</aura:component>


and
Can I skip targetRecord?
Can I just using targetFields?


How to make action in block table column?
I want make action in block table column
But column onclick only include property...
How to make it?

If I click Campaign List's Type (each value, and any field)
I want all the information(many fields) to appear in Campaign Detail Page Block.
 
<apex:page StandardController="Campaign" extensions="Campaign1">
  <apex:form >
  
    <apex:pageBlock title="Campaign Search">
            <h2>Name</h2>
            <apex:inputText label="SearchName" value="{!searchName}"/>
            <apex:commandButton value="Search" action="{!searchbox}"> </apex:commandButton>
    </apex:pageBlock>
    
    <apex:pageBlock title="Campaign Detail">
        
    </apex:pageBlock>
    <apex:pageBlock title="Campaign List">
        <apex:pageBlockTable value="{! campaigns}" var="cp">
            <apex:column value="{! cp.Name }"/>
            <apex:column value="{! cp.StartDate }"/>
            <apex:column value="{! cp.EndDate }"/>
            <apex:column value="{! cp.Type}"/>
        </apex:pageBlockTable>
        
     
    </apex:pageBlock>
    <!-- Pagination -->
<table style="width: 100%"><tr>
    <td>
        Page:
    </td>            
    <td align="center">
        
        
        <apex:commandLink value="« Previous"    />
<apex:outputText style="color: #ccc;" value="« Previous"   />
&nbsp;&nbsp;  
<apex:commandLink value="Next »"    />
<apex:outputText style="color: #ccc;" value="Next »"   />
        
        
    </td>
    
    <td align="right">
        
        
        Records per page:
<apex:selectList size="1">
    <apex:selectOption itemValue="5" itemLabel="5"/>
    <apex:selectOption itemValue="20" itemLabel="20"/>
    <apex:actionSupport event="onchange" reRender="contacts_list"/>
</apex:selectList>
        
        
    </td>
</tr></table>
    </apex:form>
</apex:page>

 
My Visualforce Page Code is
<apex:page standardController="Campaign" recordSetVar="contacts" extensions="Campaign1">
    
    <apex:form >
    <apex:pageBlock title="Campaign Search">
            <h2>Name : </h2>
            <apex:inputText label="SearchName" value="{!searchName}"/>
            <apex:commandButton value="Search" action="{!searchbox}"> </apex:commandButton>
    </apex:pageBlock>
    
    <apex:pageBlock title="Campaign Detail">
        
    </apex:pageBlock>
    
        <apex:pageBlock title="Contacts List" id="contacts_list">
            <apex:pageBlockTable value="{! campaigns}" var="ct">
                <apex:column value="{! ct.Name }"/>
                <apex:column value="{! ct.Type }"/>
            </apex:pageBlockTable>
<table style="width: 100%"><tr>
    <td>
       Page: <apex:outputText value=" {!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>
    </td>            
    <td align="center">
<apex:commandLink action="{! Previous }" value="« Previous"
     rendered="{! HasPrevious }"/>
<apex:outputText style="color: #ccc;" value="« Previous"
     rendered="{! NOT(HasPrevious) }"/>
&nbsp;&nbsp;  
<apex:commandLink action="{! Next }" value="Next »"
     rendered="{! HasNext }"/>
<apex:outputText style="color: #ccc;" value="Next »"
     rendered="{! NOT(HasNext) }"/>
    </td>
    
    <td align="right">
        Records per page:
<apex:selectList value="{! PageSize }" size="1" >
    <apex:selectOption itemValue="5" itemLabel="5"/>
    <apex:selectOption itemValue="20" itemLabel="20"/>
    <apex:actionSupport event="onchange" reRender="contacts_list"/>
</apex:selectList>
    </td>
</tr></table>
        </apex:pageBlock>
    </apex:form>
</apex:page>

and My Custom Controller Code is
 
public class Campaign1 {

    public Campaign1(ApexPages.StandardSetController controller) {

    }


 public string searchName {get;set;}
 public list < Campaign> campaigns{get;set;}
 public Campaign c {get;set;}
   
   
   
   
 public Campaign1(apexPages.standardController con) {
 c = (Campaign)con.getRecord();
  campaigns= new list <Campaign> ();
  campaigns= [select ID, Name, StartDate, EndDate, Type from Campaign];
 }
 
 
 
 
 
 
 public void searchbox() {
  campaigns= new list <Campaign> ();
  String name = '%' + searchName + '%';
  campaigns= [select ID, Name, StartDate, EndDate, Type from Campaign where Name Like :name];
 }
 
 
 
}

I want make the search campaign page in 2 functions
First, Result was pagination
Second, Searched result about keyword.


How to development pagination in custom controller?
Maybe I write Pagination Code on custon controller? but I don't know make it..

Can you help me?
Url is here
https://trailhead.salesforce.com/modules/visualforce_fundamentals/units/visualforce_standard_list_controllers

This module include visualforce code
Please teach me. I want controller code....
I have a question. During Challenge.....

I have many Contacts, and
make Visualforce Code and
execute, but I can't see my Contact.

Why can I just see only one Contact?

User-added image

User-added image

User-added image


<apex:page standardController="Contact" recordSetVar="contacts">
               <apex:slds /> 
             <apex:repeat value="{!contacts}" var="c">
            <dl class="slds-list_horizontal slds-wrap">
  <dt class="slds-item_label slds-text-color_weak slds-truncate" title="First Label">First Label:</dt>
  <dd class="slds-item_detail slds-truncate" title="Description for first label">{!c.Name}</dd>
  <dt class="slds-item_label slds-text-color_weak slds-truncate" title="Second Label">Second Label:</dt>
  <dd class="slds-item_detail slds-truncate" title="Description for second label">{!c.Phone}</dd>
    </dl>
    </apex:repeat>
</apex:page>
I can't complete, Execute Anonymous Blocks Challenge

I made Custom Object name is Candidate.

Can't edit Plural Label in Playground. Is right?


I clicked 'Verify Step'
and...     Challenge Not yet complete... here's what's wrong: 
Could not find an object with Plural Label Candidates.

User-added image


Then I changed Singular Label : Candidates.
and : 
There was an unhandled exception. Please reference ID: TPOJWISC. Error: Faraday::ResourceNotFound. Message: NOT_FOUND: The requested resource does not exist


Okay, Then...
I made Candidate, and Candidates. Two Custom Object...
and : Challenge Not yet complete... here's what's wrong: 
Could not find an object with Plural Label Candidates.


What happen....?
How can I complete this unit?


Please need your help.....
I'm not complete simple challenge...
Message : Challenge Not yet complete... here's what's wrong: 
Could not find a sharing solution 'Volunteerism Board'.

I made this :

User-added image



User-added image





Maybe.. I think problem is 
" Also, provide edit access to this field on an individual-by-individual basis without modifying profiles. Call this solution "Volunteerism Board". "

How can I do?
I have a question. During Challenge.....

I have many Contacts, and
make Visualforce Code and
execute, but I can't see my Contact.

Why can I just see only one Contact?

User-added image

User-added image

User-added image


<apex:page standardController="Contact" recordSetVar="contacts">
               <apex:slds /> 
             <apex:repeat value="{!contacts}" var="c">
            <dl class="slds-list_horizontal slds-wrap">
  <dt class="slds-item_label slds-text-color_weak slds-truncate" title="First Label">First Label:</dt>
  <dd class="slds-item_detail slds-truncate" title="Description for first label">{!c.Name}</dd>
  <dt class="slds-item_label slds-text-color_weak slds-truncate" title="Second Label">Second Label:</dt>
  <dd class="slds-item_detail slds-truncate" title="Description for second label">{!c.Phone}</dd>
    </dl>
    </apex:repeat>
</apex:page>
I develop Apex Code, is Create Field.
That made by Metadata API..

A Object and B Object must have Only one master-detail Field, right?

I created Master(A)-Detail(B) Field in B Object. and

When I create Master-Detail Field, I want know Master-detail Field related to A Object.

How to get Master SObject Name of Master-Detail Field?
 
Map<String, Schema.SObjectField> fieldMap = Schema.getGlobalDescribe().get('B__c').getDescribe().fields.getMap();
            for(Schema.SObjectField f : fieldMap.values()) {
                System.debug(f.getDescribe());
            }

I was execute code.
But I can't find Object A Name....
 
How can I find Salesforce's every relationship?

I want create Master-Detail Field or LookUp Relationship Field by "Salesforce Metadata Api"
Problem occurred here!

When Child Relationship Name duplicated, that make error.
So.....First, I find every RelationShip by Salesforce Query and,
I want Find overlapping Child Relationship Name..

How can I do it?


I want, clicked  <apex:outputLink value="{!URLFOR($Page.CampaignEdit, cp.Id)}">{! cp.Name }</apex:outputLink>
then go to capmaign detail page(bottom code page)

How to make connect ObjectId in visualforce page

Maybe I setting Url this? force.com/apex/CampaignEdit?Id=7017F000000UKEeQAO
or other way?
I have a question. During Challenge.....

I have many Contacts, and
make Visualforce Code and
execute, but I can't see my Contact.

Why can I just see only one Contact?

User-added image

User-added image

User-added image


<apex:page standardController="Contact" recordSetVar="contacts">
               <apex:slds /> 
             <apex:repeat value="{!contacts}" var="c">
            <dl class="slds-list_horizontal slds-wrap">
  <dt class="slds-item_label slds-text-color_weak slds-truncate" title="First Label">First Label:</dt>
  <dd class="slds-item_detail slds-truncate" title="Description for first label">{!c.Name}</dd>
  <dt class="slds-item_label slds-text-color_weak slds-truncate" title="Second Label">Second Label:</dt>
  <dd class="slds-item_detail slds-truncate" title="Description for second label">{!c.Phone}</dd>
    </dl>
    </apex:repeat>
</apex:page>
I can't complete, Execute Anonymous Blocks Challenge

I made Custom Object name is Candidate.

Can't edit Plural Label in Playground. Is right?


I clicked 'Verify Step'
and...     Challenge Not yet complete... here's what's wrong: 
Could not find an object with Plural Label Candidates.

User-added image


Then I changed Singular Label : Candidates.
and : 
There was an unhandled exception. Please reference ID: TPOJWISC. Error: Faraday::ResourceNotFound. Message: NOT_FOUND: The requested resource does not exist


Okay, Then...
I made Candidate, and Candidates. Two Custom Object...
and : Challenge Not yet complete... here's what's wrong: 
Could not find an object with Plural Label Candidates.


What happen....?
How can I complete this unit?


Please need your help.....
I'm not complete simple challenge...
Message : Challenge Not yet complete... here's what's wrong: 
Could not find a sharing solution 'Volunteerism Board'.

I made this :

User-added image



User-added image





Maybe.. I think problem is 
" Also, provide edit access to this field on an individual-by-individual basis without modifying profiles. Call this solution "Volunteerism Board". "

How can I do?