• Snehil_Jaiswal
  • NEWBIE
  • 35 Points
  • Member since 2018
  • Dazeworks

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 8
    Replies
Hi, 

I am trying to make a post request if a field value updates. Below is the code.
trigger StatusChange on User_Story__c (after update) {
    
    User_Story__c u = trigger.new[0];
    User_Story__c updacc=[select id,name,userStory_reason__c from User_Story__c where id = :u.id];
    
    if(Trigger.oldmap.get(updacc.id).userStory_reason__c  != Trigger.newmap.get(updacc.id).userStory_reason__c ){

       Getrequest.apicall();
 }

}
Apex Class:
global class Getrequest {

    @Future(callout=true)
    public static void apicall(){
            HttpRequest req = new HttpRequest();
        	String endpoint = 'https://xxxxxxxx.xxxxxxxxxxxxx.com/xxxx';
        	String temp ='A';
        	String temp1 = 'B';
        	String jsonData = '[{"name":"'+temp+'"},{"Request":"'+temp1+'"}]';
      		req.setBody(jsonData);
        	req.setEndpoint(endpoint);
            req.setHeader('Accept', 'application/json');
      		req.setMethod('POST');
      		Http http = new Http();
       		http.send(req);
    }

}

Above code is working fine for single record update. If it is batch update then only field value is getting updated and it is not making a post call. Please help me.

Thanks and Regards,
Diwakar G

I have cretaed a batch class based on some condition lead records are deleted and scdule using scheduled method using developer cosole.
Do we need to write test  class for both implement class and schedule class?



 
Hi!! 

I have a lightning component that I am using in a flow to search for contacts. It works great on a desktop (see image below) but the search does not work in mobile. 

What am I missing? 

Any help would be greatly appreciated!
Tasia

User-added image

Here is my lightning component code:

Component
<aura:component implements="force:appHostable,lightning:availableForFlowScreens,flexipage:availableForAllPageTypes" access="global">
    <aura:attribute name="Contact" type="String" access="public" />
    <aura:attribute name="ContactLookup" type="String" access="public" />
    <aura:attribute name="ContactLookup__c" type="String" access="public" />
    <aura:attribute name="selectedRecordId" type="String" access="public" />
    
    <lightning:recordEditForm objectApiName="{!v.Contact}">
        <label class="ContactLookup">{!v.ContactLookup}</label>
        <lightning:inputField fieldName="{!v.ContactLookup__c}" onchange="{!c.handleOnChange}" />
    </lightning:recordEditForm>
</aura:component>    

Controller
({
    handleOnChange : function(component, event, helper) {
        component.set( "v.selectedRecordId", event.getParams( "fields" ).value );
    }
})

Style
.THIS label.slds-form-element__label {
    display: none;
}
.THIS .fieldLabel {
    font-size: .75rem;
}​​​​​​​

Design
<design:component>
    <design:attribute name="Contact" />
    <design:attribute name="ContactLookup" />
    <design:attribute name="ContactLookup__c" />
    <design:attribute name="selectedRecordId" />
</design:component>
 
I have created a custom object and a tab. However its not visible on the page layout and as a tab as well. 
Checked evrything below
Profiles
 Permission sets
App manager
Page layout

Nothing seems to work. Please help out
Im not able to deploy lightning web component from VS Code to Source Org. 
Please find the below screen shot for the error detils.
User-added imageThanks,
Hitesh