salesforce-learning-note

1. Task 1. Learn Apex, Trigger, and the simple use of object fields 1.1. File upload 1.2. Permission control 1.3. SOQL 1.4. Trigger 1.5. Learning Apex 1.5.1. List 2. Task 2. Learn the development of Visualforce pages and be able to make Visualforce pages that interact with the background 2.1. Visualforce generates PDF 2.1.1. Pitfall […]

salesforce small knowledge

1Severalwaystogettherecordtype //Thefirsttypeisrecommended,becausenosqlqueryisrequired StringrecordType=Schema.SObjectType.Good__c.getRecordTypeInfosByName().get(‘mid-rangebrand’).getRecordTypeId(); system.debug(‘Type1:’+recordType); //Thesecondtype: List<RecordType>list_type=[Selectid,Name,IsActive,DeveloperNameFROMRecordTypewhereName=’LuxuryBrand’andIsActive=true]; System.debug(‘Thesecondtype:’+list_type); //Thethirdtype List<RecordType>list_type3=[selectId,DeveloperName,NamefromRecordTypewhere(DeveloperName=’MiddleBrand’ORDeveloperName=’extravagant’) ANDSObjectType=’Good__c’]; System.debug(‘Thethirdtype:’+list_type3); //fourth List<RecordType>list_type2=[SelectId,Name,DeveloperNameFromRecordTypewheresobjecttype=’Good__c’]; System.debug(‘Thefourthtype:’+list_type2); 2ConversionofListandJSONstring Stringjson_String=JSON.serialize(List<Opportunity>list_object); List<Opportunity>)JSON.deserialize(Stringjson_String,List<Opportunity>.class); 3BASE64bitandMD5encryption //base64Encode:base64encoding StringAccountId=’X66666694292’; Stringmytime=Datetime.now().format(‘yyyyMMddHHmmss’); StringauthorizationHeader=EncodingUtil.base64Encode(Blob.valueOf(AccountId+’:’+mytime)); System.debug(‘authorizationHeader:’+authorizationHeader); //Thevalueofsigis32-bituppercaseMD5encryption(accountID+accountAPISecret+timestamp) Stringsig=AccountId+APISecret+mytime; Stringtoken=EncodingUtil.convertToHex(Crypto.generateDigest(‘MD5′,Blob.valueOf(sig))).toUpperCase(); 4Getthesqlofallfields SELECTFIELDS(ALL)FROMVehicle__cLIMIT5 OR Stringquery=’select’; for(StringfieldApi:Schema.SobjectType.Opportunity.fields.getMap().keySet()){<!—-> if(fieldApi==’Id’) continue; query+=fieldApi+’,’; } query+=’IdfromOpportunity’; System.debug(query); 5Executescheduledtasksatspecifiedtime //Queryscheduledtasks SELECTId,NextFireTime,StartTime,EndTime,State,PreviousFireTime,CronJobDetail.Name,OwnerId,CreatedById,CreatedDate,TimesTriggeredFROMCronTriggerWHERECreatedById=’0051v00000AOGwyAAH’ //Querytheapexjob,whereyoucanfindtheclassnamecorrespondingtothescheduledtask selectApexClassId,Id,JobItemsProcessed,JobType, Status,NumberOfErrors,MethodName fromAsyncApexJob whereJobTypein(‘BatchApexWorker’,’ScheduledApex’) privatevoidcreateNewSchedule(){<!—-> SyncFromSapToSfSchedulesc=newSyncFromSapToSfSchedule(); System_Setting__cssc=System_Setting__c.getValues(‘Setting’); Datetimedt=Datetime.now().addMinutes(Integer.valueOf(ssc.SAP_Interval_Minutes__c)); List<String>args=newList<String>(); args.add(String.valueOf(dt.minute())); args.add(String.valueOf(dt.hour())); args.add(String.valueOf(dt.day())); args.add(String.valueOf(dt.month())); args.add(String.valueOf(dt.year())); […]

Analysis of get and post requests in salesforce rest integration mode (continued) —- get salesforce access_token

Get salesforce access_token In the previous article, we have briefly introduced the rest interface of salesforce. If you have a better understanding of java servlet, it should be easy to understand. Our article mainly introduces how to obtain the access_Token of salesforce through the java program, how to understand the access_token here, in layman’s terms, […]

Connect Salesforce with Android

In this article, we’ll explore building a simple native Android application that leverages the Chatter REST API within the Salesforce platform. For this, we’ll be using the Salesforce Mobile SDK 2.1 (acting as a wrapper around the low-level HTTP functions), allowing us to easily handle OAuth and subsequent REST API calls. The TemplateApp provided in […]

salesforce Aura upload file

1. Use input type=”file” tag cmp <!–Upload file interface–> <div>{!v.fileMessage}</div> <div class=”slds-file-selector__dropzone” style=”height:200px;width: 98%;margin-top:10px” ondragleave=”{!c.ondragleave}” ondrop=”{ !c.ondrop}” ondraenter=”{!c.ondraenter}”> <input type=”file” class=”slds-file-selector__input slds-assistive-text” id=”file-upload-input-01″ aria-labelledby=”file-selector-primary- label file-selector-secondary-label” onchange=”{<!– –>!c.uploadFile}” /> <label class=”slds-file-selector__body” for=”file-upload-input-01″ id=”file-selector-secondary-label”> <span class=”slds-file-selector__button slds-button slds-button_neutral” style=”left:45%; top:90px;color:black;”> File upload</span> </label> <br /> <aura:iteration items=”{!v.fileList}” var=”item” indexVar=”index”> <lightning:buttonIcon iconName=”utility:close” variant=”bare” onclick=”{<!– –>! c.shanchu }” […]

[Salesforce / LWC] Use third-party library development in LWC Use Third-Party JavaScript Libraries In LWC

Using third-party library development in LWC Article directory Use third-party library development in LWC Preparation Standard method explanation DOM manipulation in JavaScript example A few things to note in the above code: Replenish In LWC, we can of course use code from third-party libraries. today i will use highCharts will teach you how to call […]

BLIP-2: salesforce proposes efficient training of multimodal large models based on frozen visual encoder and LLM model parameters

Paper link: https://arxiv.org/abs/2301.12597 Project code: https://github.com/salesforce/LAVIS/tree/main/projects/blip2 Experience address: https://huggingface.co/spaces/Salesforce/BLIP2 Document introduction: https://huggingface.co/docs/transformers/main/en/model_doc/blip-2 Fine-tuning reference: https://github.com/salesforce/LAVIS Huggingface Space address: https://hf.co/spaces/Salesforce/BLIP2 In the past few years, visual language pre-training (VLP) has continuously refreshed SOTA when the model is getting larger and larger, but due to the end-to-end training method, a large amount of computational cost is required […]

Salesforce Lightning Web コンポーネントのCreation

Lightning Web コンポーネント environment configuration 1. Salesforce DX environment settings ①Salesforce CLI をインストールする. https://developer.salesforce.com/tools/sfdxcli から CLI をインストールします. CLI が正しくインストールされていることを证しし, the latest version of でコマンドラインからののんマンドを実行してします. sfdx update sfdx-cli: Updating CLI…. のように力力が means されます. ②Visual Studio Code と Salesforce DX をインストールする to け拡 Zhang function. このプロジェクトでは、Visual Studio Code と推奨される Salesforce Extension Pack をインストールします. Development environment が overall […]

This product is fully accessible for development: SalesForce

This product is fully accessible: SalesForce Article directory This product is fully accessible for development: SalesForce 1. Product introduction 2. Development Introduction 3. Development mode 4. Code testing Background: I have used a lot of product-based secondary development components and systems, and there are more or less pitfalls. I have also used a lot of […]