Professional Documents
Culture Documents
HTML---------------------------------------------->>>
<template>
<lightning-card>
<template if:false={isShow}>
<!--<lightning-button
class="slds-m-right_xxx-small slds-m-top_none slds-m-bottom_xxx-small"
slot="actions"
label="Edit"
name="click1"
onclick={handleClick}
variant="brand"></lightning-button> -->
<lightning-record-view-form>
<div class="slds-grid">
<div class="slds-col slds-size_1-of-2">
<div class="slds-m-left_xx-small">
<div class="slds-m-left_medium">
Name
<br/>
{acc.Name}
<lightning-button-icon
icon-name="utility:edit" alternative-text="update value"
variant="bare" size="medium" onclick={handleClick} ></lightning-button-icon>
<br/><br/>
Industry
<br/>
{acc.Industry}
<lightning-button-icon icon-name="utility:edit" alternative-
text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
</div>
<br/>
</div>
</div>
<div class="slds-col slds-size_1-of-2">
AnnualRevenue
<br/>
{acc.AnnualRevenue}
<lightning-button-icon icon-name="utility:edit" alternative-
text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
<br/><br/>
Website
<br/>
{acc.Website}
<lightning-button-icon icon-name="utility:edit" alternative-
text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
</div>
</div>
</div>
</template>
<div class="slds-grid">
<div class="slds-col slds-size_1-of-2">
<div class="slds-m-left_xx-small">
<div class="slds-m-left_medium">
Name
<br/>
{asm.Name}
<lightning-button-icon
icon-name="utility:edit" alternative-text="update value" variant="bare"
size="medium" onclick={handleClick} ></lightning-button-icon>
<br/><br/>
Daily Blood sugar range
<br/>
{asm.Daily_Blood_sugar_range__c}
<lightning-button-icon icon-name="utility:edit" alternative-text="update
value" variant="bare" size="medium" onclick={handleClick} ></lightning-button-icon>
</div>
<br/>
</div>
</div>
<div class="slds-col slds-size_1-of-2">
Daily weights
<br/>
{asm.Daily_weights__c}
<lightning-button-icon icon-name="utility:edit" alternative-text="update
value" variant="bare" size="medium" onclick={handleClick} ></lightning-button-icon>
<br/><br/>
Gender
<br/>
{asm.Gender__c}
<lightning-button-icon icon-name="utility:edit" alternative-text="update
value" variant="bare" size="medium" onclick={handleClick} ></lightning-button-icon>
</div>
</div>
</div>
</template>
<div class="slds-grid">
<div class="slds-col slds-size_1-of-2">
<div class="slds-m-left_xx-small">
<div class="slds-m-left_medium">
Name
<br/>
{cas.Name}
<lightning-button-icon icon-name="utility:edit" alternative-text="update
value" variant="bare" size="medium" onclick={handleClick} ></lightning-button-icon>
<br/><br/>
Patient Status
<br/>
{cas.Patient_Status__c}
<lightning-button-icon class="float-right" icon-name="utility:edit"
alternative-text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
</div>
<br/>
</div>
</div>
<div class="slds-col slds-size_1-of-2">
Clinic Contact Name
<br/>
{cas.Clinic_Contact_Name__c }
<lightning-button-icon class="float-right" icon-name="utility:edit"
alternative-text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
<br/><br/>
Contact Number
<br/>
{cas.Contact_Number__c}
<lightning-button-icon class="float-right" icon-name="utility:edit"
alternative-text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
</div>
</div>
</div>
</template>
<div class="slds-grid">
<div class="slds-col slds-size_1-of-2">
<div class="slds-m-left_xx-small">
<div class="slds-m-left_medium">
Name
<br/>
{pt.Name}
<lightning-button-icon class="float-right" icon-name="utility:edit"
alternative-text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
<br/><br/>
Source System
<br/>
{pt.Source_System__c}
<lightning-button-icon class="float-right" icon-name="utility:edit"
alternative-text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
<br/>
</div></div>
</div>
<div class="slds-col slds-size_1-of-2">
Subject
<br/>
{pt.Subject__c}
<lightning-button-icon class="float-right" icon-name="utility:edit"
alternative-text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
<br/><br/>
Service
<br/>
{pt.Service__c}
<lightning-button-icon class="float-right" icon-name="utility:edit"
alternative-text="update value" variant="bare" size="medium" onclick={handleClick}
></lightning-button-icon>
<br/>
</div>
</div>
</div>
</template>
</lightning-record-view-form>
</template>
<template if:true={isShow}>
<lightning-record-edit-form
object-api-name={objectApiName}
record-id={recordId}>
<div class="slds-grid">
<div class="slds-col slds-size_1-of-2">
</div>
<div class="slds-col slds-size_1-of-2">
</div>
<div class="slds-col slds-size_1-of-2">
CaseAssessments Details
<lightning-record-edit-form object-api-name="Case_Assessment__c" record-
id={casmrecid}>
<div class="slds-grid">
<div class="slds-col slds-size_1-of-2">
<lightning-input-field field-name={casmName}
onchange={AccountValues}></lightning-input-field>
</div>
<div class="slds-col slds-size_1-of-2">
</div>
</div>
<br/><br/><br/>
<div class="flex-parent jc-center">
<lightning-button
variant="brand"
label="Cancel"
onclick={handleCancel}> </lightning-button>
<lightning-button
variant="brand"
label="Save"
onclick={handleSave}></lightning-button>
</div>
</lightning-record-edit-form>
</template>
</lightning-card>
</template>
<<<----------------------------------
JS--------------------------------------------------------->>>
// Edit Form
import Name_FIELD from '@salesforce/schema/Account.Name';
import Industry_FIELD from '@salesforce/schema/Account.Industry';
import AnnualRevenue_FIELD from '@salesforce/schema/Account.AnnualRevenue';
import Website_FIELD from '@salesforce/schema/Account.Website';
@track isShow=false;
handleClick(){
this.isShow=true;
}
handleCancel(){
this.isShow=false;
}
@api recordId;
@api objectApiName;
@track Accounts;
@track Assesments;
@track CaseAssesment;
@track PatientTouchPoint;
nameField=Name_FIELD;
Industry=Industry_FIELD;
AnnualRevenue=AnnualRevenue_FIELD;
Website=Website_FIELD;
nameasm=asmName_FIELD;
dailybsr=Daily_Blood_sugar_range__c_FIELD;
dailywet = Daily_weights__c_FIELD;
Gender=Gender__c_FIELD;
casmName=casmName_FIELD;
patient=patient_FIELD;
con=con_FIELD;
ccon=ccon_FIELD;
ptn=ptn_FIELD;
ser=ser_FIELD;
src=src_FIELD;
sub=sub_FIELD;
if(result.data){
console.log('its working')
console.log(result.data);
//console.log(data.Id);
this.Accounts = result.data;
console.log('value is'+this.Accounts);
this.error = undefined;
}else{
this.error =result.error;
this.Accounts =undefined;
}
}
@wire(getAssessments, {accId:'$recordId'})
WireAssessmentsRecords(result){
if(result.data){
console.log('its working')
console.log(result.data);
//console.log(data.Id);
this.Assesments = result.data;
console.log('value is'+this.Assesments);
this.error = undefined;
}else{
this.error =result.error;
this.Assesments =undefined;
}
}
//Passing Account Id to CaseAssessment Record
@wire(getCaseAssessment, {accId:'$recordId'})
WireCaseAssessmentsRecords(result){
if(result.data){
console.log('its working')
console.log(result.data);
//console.log(data.Id);
this.CaseAssesment = result.data;
console.log('value is'+this.CaseAssesment);
this.error = undefined;
}else{
this.error =result.error;
this.CaseAssesment =undefined;
}
}
@wire(getpatientTouchPoint, {accId:'$recordId'})
WirePatientRecords(result){
if(result.data){
console.log('its working')
console.log(result.data);
//console.log(data.Id);
this.PatientTouchPoint = result.data;
console.log('value is'+this.PatientTouchPoint);
this.error = undefined;
}else{
this.error =result.error;
this.PatientTouchPoint =undefined;
}
}
//nameField = NAME_FIELD;
//IndustryField = INDUSRTY_FIELD;
//AnnualRevenueField = ANNUALREVENUE_FIELD;
//WebsiteField = WEBSITE_FIELD;
actrecid;
asmrecid;
casmrecid;
ptrecid;
@wire(getAccEdit, {accId:'$recordId'})
WireAcceditRecords(result){
if(result.data){
console.log('its working')
console.log(result.data);
//console.log(data.Id);
this.actrecid = result.data;
console.log('value is'+this.actrecid);
this.error = undefined;
}else{
this.error =result.error;
this.actrecid =undefined;
}
}
@wire(getasmedit, {accId:'$recordId'})
WireAsmeditRecords(result){
if(result.data){
console.log('its working')
console.log(result.data);
//console.log(data.Id);
this.asmrecid = result.data;
console.log('value is'+this.asmrecid);
this.error = undefined;
}else{
this.error =result.error;
this.asmrecid =undefined;
}
}
@wire(getcasmedit, {accId:'$recordId'})
WireCasmeditRecords(result){
if(result.data){
console.log('its working')
console.log(result.data);
//console.log(data.Id);
this.casmrecid = result.data;
console.log('value is'+this.casmrecid);
this.error = undefined;
}else{
this.error =result.error;
this.casmrecid =undefined;
}
}
@wire(getptedit, {accId:'$recordId'})
WirepteditRecords(result){
if(result.data){
console.log('its working')
console.log(result.data);
//console.log(data.Id);
this.ptrecid = result.data;
console.log('value is'+this.ptrecid);
this.error = undefined;
}else{
this.error =result.error;
this.ptrecid =undefined;
}
}
Aname
AIndustry
ARevenue
AWebsite
AsmDailyBloodSugar
AGender
Aweights
Astatus
Acontact
Aclinic
Aservice
Asource
Asubject
inputvalue
// onChange Event
AccountValues(event)
{
this.inputvalue=event.target.name
if(this.inputvalue=='Namefields')
{
this.Aname=event.target.value
}
else if(this.inputvalue=='IndustryField')
{
this.AIndustry=event.target.value
}
else if(this.inputvalue=='AnnualrevenueField')
{
this.ARevenue=event.target.value
}
else if(this.inputvalue=='WebsiteField')
{
this.AWebsite=event.target.value
}
// Assessments
else if(this.inputvalue=='BloodSugarField')
{
this.AsmDailyBloodSugar=event.target.value
}
else if(this.inputvalue=='GenderField')
{
this.AGender=event.target.value
}
else if(this.inputvalue=='DailyWeightsField')
{
this.Aweights=event.target.value
}
// case Assessments
else if(this.inputvalue=='PatientStatusField')
{
this.Astatus=event.target.value
}
else if(this.inputvalue=='ContactField')
{
this.Acontact=event.target.value
}
else if(this.inputvalue=='ClinicContactField')
{
this.Aclinic=event.target.value
}
//Patient Touchpoint
else if(this.inputvalue=='ServiceField')
{
this.Aservice=event.target.value
}
else if(this.inputvalue=='SourceField')
{
this.Asource=event.target.value
}
else if(this.inputvalue=='SubjectField')
{
this.Asubject=event.target.value
}
}
//saveAc=this.recordId
handleSave(){
if(this.Aname != null)
{
updateAccountName({SAid:this.recordId,Sname:this.Aname})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('working method1')
}
if(this.AIndustry!= null)
{
updateAccountIndustry({SAid:this.recordId,Sind:this.AIndustry})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('working method2')
}
if(this.ARevenue!= null)
{
updateAccountRevenue({SAid:this.recordId,Srev:this.ARevenue})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('working method3')
}
if(this.AWebsite!= null)
{
updateAccountWebsite({SAid:this.recordId,Sweb:this.AWebsite})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('working method4')
}
//Assessment
if(this.AsmDailyBloodSugar!= null)
{
updateAssessmentBsr({asmid:this.recordId,AsmBloodSugar:this.AsmDailyBloodSugar})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('Assessment working method1')
}
if(this.AGender!= null)
{
updateAssessmentGen({asmid:this.recordId,AsmGender:this.AGender})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('Assessment working method2')
}
if(this.Aweights!= null)
{
updateAssessmentWeight({asmid:this.recordId,AsmWeight:this.Aweights})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('Assessment working method3')
}
// case Assessment
if(this.Astatus!= null)
{
updateCaseAssessmentStatus({casmid:this.recordId,casmStatus:this.Astatus})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('CaseAssessment working method1')
}
if(this.Acontact!= null)
{
updateCaseAssessmentContact({casmid:this.recordId,casmContact:this.Acontact})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('CaseAssessment working method2')
}
if(this.Aclinic!= null)
{
updateCaseAssessmentClinic({casmid:this.recordId,casmClinic:this.Aclinic})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('CaseAssessment working method3')
}
//Patient TouchPoint
if(this.Aservice!= null)
{
updatePatientTouchPointService({Ptid:this.recordId,ptService:this.Aservice})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('PatientTouchPoint working method1')
}
if(this.Asource!= null)
{
updatePatientTouchPointSource({Ptid:this.recordId,ptSource:this.Asource})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('PatientTouchPoint working method2')
}
if(this.Asubject!= null)
{
updatePatientTouchPointSubject({Ptid:this.recordId,ptSubject:this.Asubject})
.then((result)=>console.log(result))
.catch((error)=>alert('Error:'+JSON.stringify(error)));
console.log('PatientTouchPoint working method3')
}