• Agnibha Chakrabarti 10
  • NEWBIE
  • 130 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 17
    Replies
public class CustomMetadataUtils implements Metadata.DeployCallback {
     
    //Inteface method 
    public void handleResult(Metadata.DeployResult result, Metadata.DeployCallbackContext context) {
        if (result.status == Metadata.DeployStatus.Succeeded) {
            //Success
            System.debug('Success Result-' + result);
        } else {
            //Failed
            System.debug('Failed Result-' + result);
        }
    }
     
    //Create Custom Metadata record
    
    //Update Custom Metadata record
    public static void updateCustomMetadata(String metdataName, String recordDevName, String label, Map<String, Object> metadataFieldValueMap){
        Metadata.CustomMetadata cMetadata = new Metadata.CustomMetadata();
        cMetadata.fullName = metdataName + '.' + recordDevName;
        cMetadata.label = label;
         
        for(String key : metadataFieldValueMap.keySet()){
            Metadata.CustomMetadataValue cMetadataValue = new Metadata.CustomMetadataValue();
            cMetadataValue.Field = key;
            cMetadataValue.Value = metadataFieldValueMap.get(key); 
            cMetadata.values.add(cMetadataValue);
        }
         
        Metadata.DeployContainer mdContainer = new Metadata.DeployContainer();
        mdContainer.addMetadata(cMetadata);
        CustomMetadataUtils callback = new CustomMetadataUtils();
        Id jobId = Metadata.Operations.enqueueDeployment(mdContainer, callback);
    }
}
Hi , I have this class to update custom metadata value.

I cant able to write it's test class..............Anyone has any idea?

thanks.
 
Hi,

Is there any way to provide grant type for oauth2.0 authentication in auth. provider and then use that in the named credential? or is that automatically handled by salesforce?

thanks in advance
Hi,

As salesforce provides site data transfer limit 40GB per 24hrs. can we Increase the limit. As I want no limits in that.
User-added imagethanks,
Hi,

I have a image link with ".SVG" Extension. Is there any way to show the image in lightning datatable?

thanks in advance
Hi, i have created following data table
User-added image
column of data table are
const columns = [
    { label: 'Label', fieldName: 'name', type:'url',typeAttributes: {label: { fieldName: 'name' }, 
        target: '_blank'}, wrapText: true   },
    { label: 'Website', fieldName: 'website', type: 'url' },
    { label: 'Phone', fieldName: 'phone', type: 'phone' },
    { label: 'Balance', fieldName: 'amount', type: 'currency' },
    { label: 'CloseAt', fieldName: 'closeAt', type: 'date' },
];
My requirement is............ When i'll click on the name......it will do some Onclick action

Thanks
hi,
I have used <apex:image> in Visualforce email template.
the image is showing fine in Outlook app but image is not coming in outlook.com
hi, I'm learning apex Rest web service.
i came across this code
@RestResource(urlMapping='/Account/*')
global with sharing class MyRestResource {

    @HttpDelete
    global static void doDelete() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        Account account = [SELECT Id FROM Account WHERE Id = :accountId];
        delete account;
    }
  }

but im not able to understand what does
RestResponse res = RestContext.response;

Do
Can anybody tell what exactly RestResponse do with an example

Thanks,​​​​​​​​​​​​​​
Hi,
i have ''if'' condition in vf email template body

{!IF(relatedTo.type)=='New'),,,,,,}
where, relatedTo=case..
can i get this 'New'  as label from Schema picklist ......or i have to create a custom label like{!$label.new}
??
 
hi, I am facing another issue in custom template that.... i want to add <img> tag and the source of image is in custom label......i cant use custom label name to fetch the email( But when i am giving the link in src it is working)
Hi,
Can i use styling in HTML template type or I have to use Custom template......and even if i use custom template , can i add letterheads there?
Hi,
I am new to integration, After learning about Apex web services and REST Apis ..
i want to know that, what is the use of writing Apex web service methods and exposing my apex class for web service(eg: @HttpGET, @HttpPOST etc..) while i can Get or Create records olny by Using URI from Workbench and set body using JSON?

thanks,
Hi,
I have a requirement to sent Email alert to all account in account hierarchy when the child account do something.

I want to send alert to all level(to Parent,Grand parent...)

how to set the recipient in Email alert by configuration?

Thanks,
can we send hard coded value to Apex through @wire?
 like,
@wire(getVal,{caseId:'523hahdu34567'}) case
i found that i cant use @wire without setting cacheable=true.  But i dont want to cache the data... is there any solution?
hi,
when i am trying to deploy a am having 
Error parsing file: LWC Metadata Xml Parser: ParseError at [row,col]:[2,26]
Message: Element type "LightningComponentBundle" must be followed by either attribute specifications, ">" or "/>".LightningComponentBundle error inn my XML file.


im attaching my xml
User-added image

when if removing <targets> tag ...then the component is getting deployed.

did anybody face this issue?
pls help..
hi, i have created an lwc component. when i am trying to deploy it into org it is showing  XML parse error: Unexpected xml:   .
User-added imagethis is my XML file.

when if removing <targets> tag ...then the component is getting deployed.

did anybody face this issue?
pls help..
Hi all,
I have a requirement of showing small icon beside records in datatable 
I am adding a picture for reference
User-added imagehow to do this?

thanks in advance
Hi,
I have a custom label with values. When i am changing a value in custom label(e.g.'hello' to 'welcome').......I need to query it in Web component.
I have to push the component to scratch org everytime i am changing the custom label value.

my requirement is--> when i am changing a value in custom label  it should reflect in the lightning web page dynamically without pushing it again.
can anyone help?

thanks
 
Im learning the usefulness of LDS.but having a problem to understand the work of  targetRecord in recordData. can we use targetRecord attribute as {!V.targetRecord} ?
I read the documentations, but still not clear with it
Hi,
I have to replicate the New Case to create a new case in lightning component. I have to create look up input box in that page.
and Store the value in case object after clicking the Save button.

Can anybody help me with the creation of lookup input field and storing it into the Case object?

Thanks
hi, i have created an lwc component. when i am trying to deploy it into org it is showing  XML parse error: Unexpected xml:   .
User-added imagethis is my XML file.

when if removing <targets> tag ...then the component is getting deployed.

did anybody face this issue?
pls help..
Hi,
I have to replicate the New Case to create a new case in lightning component. I have to create look up input box in that page.
and Store the value in case object after clicking the Save button.

Can anybody help me with the creation of lookup input field and storing it into the Case object?

Thanks
Hi,

Is there any way to provide grant type for oauth2.0 authentication in auth. provider and then use that in the named credential? or is that automatically handled by salesforce?

thanks in advance
Hi, i have created following data table
User-added image
column of data table are
const columns = [
    { label: 'Label', fieldName: 'name', type:'url',typeAttributes: {label: { fieldName: 'name' }, 
        target: '_blank'}, wrapText: true   },
    { label: 'Website', fieldName: 'website', type: 'url' },
    { label: 'Phone', fieldName: 'phone', type: 'phone' },
    { label: 'Balance', fieldName: 'amount', type: 'currency' },
    { label: 'CloseAt', fieldName: 'closeAt', type: 'date' },
];
My requirement is............ When i'll click on the name......it will do some Onclick action

Thanks
Hi,
Can i use styling in HTML template type or I have to use Custom template......and even if i use custom template , can i add letterheads there?
hi, i have created an lwc component. when i am trying to deploy it into org it is showing  XML parse error: Unexpected xml:   .
User-added imagethis is my XML file.

when if removing <targets> tag ...then the component is getting deployed.

did anybody face this issue?
pls help..
Hi All,

I have installed Salesforce CLI and VS code in my machine. When i try to create project  by using  (Ctrl+Shift+P). it shows as Salesforce CLI is not insalled.

below is path of both installations

salesforce CLI : C:\Program Files\Salesforce CLI\bin
VS Code: C:\Users\paka\AppData\Local\Microsoft VS code

User-added image
Hi, 
I have n object student, which has two fields Completed Course(Text) and Course requested(pick List)
User-added image

I have a trigger which update the Completed course field automatically.......
My requirement is to restrict Any user from Editing the Completed Course field manually.
I tried to make this field 'Read Only' , but System Admin Still can edit the record manually.

is there any way such that Completed couse field gets updated only by trigger and nothing else?


Thank you
 
Hi,
User-added imageI want an action that, when i will click ine of those link then my input box with that name.


im giving my codes..
Component:
<aura:attribute name="String" type="String[]"/>
    
<aura:handler name="init" value="{!this}" action="{!c.init}" />
<lightning:card title="Filtered Values">
<div class="search-field">
<lightning:input aura:id="nameFilter" label="Filter names" onchange="{!c.handleNameFilterChange}" />
</div>
    <!--
<div class="results">
<aura:if isTrue="{!v.contacts.length > 0}">
<p class="has-results">
Showing {!v.contacts.length} contact(s):
</p>
<ol class="slds-list_dotted">
-->
   
    <ol>
        
<aura:iteration items="{!v.String}" var="s">
<li>
<a id="getId" onclick="{!c.handleClick}">
{!s}
</a> 
</li>
       
</aura:iteration>
                                       
    </ol></lightning:card></aura:component>


controller
({
init: function(component, event, helper) {
helper.loadList(component);
},

handleNameFilterChange: function (component, event, helper) {
helper.loadList(component);
},

})

helper
 
({
loadList: function(component) {
var action = component.get("c.allContacts");
var nameFilterString = component.find("nameFilter").get("v.value");
action.setParams({
nameFilterString: nameFilterString
});
action.setCallback(this, function(a) {
component.set("v.String", a.getReturnValue());
});
$A.enqueueAction(action); 
}
})
thanks,
​​​​​​​
Suppose there is an inputfield/picklist field.........i want to populate an output textbox with the value of input field or value selected in picklist.
how to do this?
in my code
List<Student_Batch_Junction__c > c=new List<Student_Batch_Junction__c>([select Student__r.id from Student_Batch_Junction__c where Batch__r.Name in :b]);
variable c contains:
11:55:42:011 VARIABLE_ASSIGNMENT [11]|this.c|[{"Student__c":"a022v00001GmqnrAAB","Batch__c":"a042v00002CobkCAAR","Id":"a052v00000l4WxtAAE","Student__r":{"Id":"a022v00001GmqnrAAB"}},{"Student__c":"a022v00001GnNHiAAN","Batch__c":"a042v00002CobkCAAR","Id":"a052v00000l4c5dAAA","Student__r":{"Id":"a022v00001GnNHiAAN"}}]

I want to get only Student__r id field values.
how to get that?

 
hi,
i have 3 objects, 
1.Batch
2.student
3.student batch junction

now,my requirement is- after a batch is completed(a checkbox is checked), no one candelete the record of Student related to that batch.
User-added imageI wrote a validation rule on Student batch junction-- (Batch__r.complted__c =true) && (  ISNULL(Student__r.Id ))
but it is not working
hi,
my requirement is

 After the batch is over, Teacher will mark the batch as complete. Then the course will be moved from Requested Courses to Completed Coursed for all the students of the batch. Before marking a batch as complete, the teacher can remove any student from the batch. This will not be possible after the batch is completed.
Relationship:
User-added imageim trying to access the students whose batch is completed(batch has a checkbox mark as complete or not)
trigger Batch on Batch__c (before insert,after update) {
    List<String> b= new List<String>();  
     for(Batch__c p: Trigger.new){
         b.add(p.Name);
     }
    List<Student__c> c=new List<Student__c>([select Student__r.Name from Student_Batch_Junction__c where Batch__r.Name in :b]);
    
    
}

I tried to access student in this way..it is showing error
this is the requirement: On approval, a relationship between the Student and the batch(two custom object) will be created in the system.