분류 전체보기
-
apex 숫자 원화 표시하는 방법 - ( apex How to display numbers ₩0,000,000 )Apex 2024. 4. 5. 16:00
1. setScale(0).format(); 숫자 -> 원화표시 10000000 -> ₩ 10,000,000 Decimal numberA = 10000000; String stringA = '₩' + numberA.setScale(0).format(); 2. Decimal.valueOf([원화형식StringValue].replaceAll(...)); 원화 -> 숫자표시 ₩ 10,000,000 -> 10000000 String stringA = '₩10,000,000'; Decimal numberA = Decimal.valueOf(stringA.replaceAll('[^0-9]', '')); 3. 예시 코드 원화표시된 기존 금액 ₩ 10,000,000에 청구금액(BillingAmount__c)을 더하여 원..
-
lwc 페이지 리다이렉트 방법 - NavigationMixin, widow.location.href ( How to redirect lwc page - NavigationMixin, widow.location.href )LWC 2024. 4. 5. 15:02
1. NavigationMixin 1-1 : import { NavigationMixin } from 'lightning/navigation'; /* js 파일 */ import { LightningElement,wire, track, api } from 'lwc'; import { NavigationMixin } from 'lightning/navigation'; 1-2 : extends NavigationMixin(LightningElement) { ... } export default class zz_clvs_MDE_Template_Create extends NavigationMixin(LightningElement) { .... } 1-3 : this[NavigationMixin.Navigate]..
-
XML 응답 값 파싱하는 방법 - How to parse XML response valuesApi 2024. 3. 28. 22:12
1. Response에서 DOM 개체 가져오기 Dom.Document doc = resp.getBodyDocument(); 2. Dom에서 Root Element 가져오기 Dom.XmlNode rootNode = doc.getRootElement(); 3. RootElement에서 depth에 따라 값 가져오기 Dom.XmlNode result = rootNode.getChildElement(’result’, null); Dom.xmlNode items = result.getChildElement('items',null); 4. 주요 메서드 getBodyDocument() getRootElement() getChildElement() getText() 5. 구조 확인 6. 값 추출하기 Dom.xmlNod..
-
JSON 직렬화 하는 방법 - How to serialize JSONApi 2024. 3. 28. 21:54
1. 주제 : 사업자 등록 상태 조회 API 요청 Request 요청 시 body 값 JSON 직렬화하여 요청하기 조회할 사업자등록번호를 request body에 포함해서 보내야 한다. 2. 요청 구조 확인 및 세팅 조회할 사업자 등록번호 - 보라색 - String 한 번에 여러 개의 사업자 등록 상태를 요청할 수 있다. - 파란색 - List 제일 크게 감싸고 있는 부분 - 빨간색 - Map 3. 세팅한 구조 JSON 직렬화하여 request body에 담기 String body = JSON.serialize(); request.setBody(body); //요청 데이터 세팅 Map businessMap = new Map(); List bNum = new List(); String businessNum..
-
lwc for:each 에서 index 활용하는 방법 - How to use index in lwc for:eachLWC 2024. 3. 27. 22:42
1. LWC 반복문 2. 추가 3. 반복되는 행에 index 및 event 부여 data-index={인덱스} onclick = {이벤트} {pli.Name} {pli.UnitPrice} 4. event로 부여한 index 가져오기 및 활용 index 체크 -> const index = event.target.dataset.index; index 활용 -> this.리스트[index]; //js파일 addOrderList(event){ const index = event.target.dataset.index; co..
-
LWC 성공, 실패, 에러 알람 띄우기 (ShowToast) - Display success, failure, and error alarm messagesLWC 2024. 3. 19. 22:26
1. import {ShowToastEvent} 및 showToast 메서드 생성 JS 파일 import { ShowToastEvent } from 'lightning/platformShowToastEvent'; showToast(title, message, variant){ ... } showToast 메서드 호출 import { ShowToastEvent } from 'lightning/platformShowToastEvent'; //1번 export default class zz_clvs_MDE_Template_Create extends LightningElement { //취소버튼 클릭 시 전자계약 템플릿 개체 목록보기 페이지로 이동 returnListVeiw(event){ var titleInp..
-
lwc 로딩 중 아이콘 화면에 표시하기 (Spineer) - Displaying icon on screen while loading LWCLWC 2024. 3. 19. 22:21
1. 를 사용하면 된다. 2. 작업예시 //JS파일 import { LightningElement, track } from 'lwc'; export default class MyComponent extends LightningElement { @track isLoading = false; // 백엔드 작업을 수행하는 메서드 handleBackendWork() { // 작업 중인 상태를 true로 설정하여 작업 중 아이콘을 화면에 보여줌 this.isLoading = true; // 백엔드 작업 수행 // (예: Apex 호출, 비동기 작업 등) // 작업이 완료되면 작업 중인 상태를 false로 설정하여 아이콘을 감춤 this.isLoading = false; } } 3. developer 라이브러리 참..
-
LWC 컴포넌트 url로 호출하는 방법 - How to call with LWC component urlLWC 2024. 3. 18. 21:46
원래 불가능했는데 가능하게 수정되었다! 2024 summer https://gsohclvs.tistory.com/entry/LWC-%EC%BB%B4%ED%8F%AC%EB%84%8C%ED%8A%B8-url%EB%A1%9C-%ED%98%B8%EC%B6%9C%ED%95%98%EB%8A%94-%EB%B0%A9%EB%B2%95-How-to-call-with-LWC-component-url-1 LWC 컴포넌트 url로 호출하는 방법 - How to call with LWC component url원하던 기능이 드디어 Release 되었다! 기존에는 lwc 컴포넌트를 url로 직접 호출하는 것이 불가능하여불필요한 aura 컴포넌트를 생성하고 url로 aura 컴포넌트를 호출하여aura 컴포넌트 내부에서 lwcgso..