• Madan Khadka 2
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
I have created VF page to call LWC, referencing this code from salesforce 

Problem : The output is input field is very small for mobile device, not user friendly. I need the input fields to be bigger in size.

Here is the code :
<template>
<div class="slds-box slds-p-around_none slds-m-top_x-small slds-m-bottom_medium slds-m-horizontal_none">
    <lightning-layout vertical-align="stretch" multiple-rows="true" class="x-large">
        <lightning-layout-item size="12" small-device-size="12" padding="around-medium">
            <div class="custom-box slds-box slds-p-around_medium">
                   // Input field here
                   <lightning-input type="text" name="Name" label="Name" onchange={handleChange}></lightning-input>
            </div>
        </lightning-layout-item>
    </lightning-layout>
</div>
</template>

Any suggestions on the same ?
I have created VF page to call LWC, referencing this code from salesforce 

Problem : The output is input field is very small for mobile device, not user friendly. I need the input fields to be bigger in size.

Here is the code :
<template>
<div class="slds-box slds-p-around_none slds-m-top_x-small slds-m-bottom_medium slds-m-horizontal_none">
    <lightning-layout vertical-align="stretch" multiple-rows="true" class="x-large">
        <lightning-layout-item size="12" small-device-size="12" padding="around-medium">
            <div class="custom-box slds-box slds-p-around_medium">
                   // Input field here
                   <lightning-input type="text" name="Name" label="Name" onchange={handleChange}></lightning-input>
            </div>
        </lightning-layout-item>
    </lightning-layout>
</div>
</template>

Any suggestions on the same ?
I am facing an issue for gmail SSO functionality. Error: redirect_uri_mismatch. Please help me to resolve this error.
 
When I running batch class its not covering excute method and giving 38%
 
global class Batch implements Database.Batchable<sObject>, Schedulable  {
    public static final String STATUS_SCHEDULED = 'Scheduled';  
    public static final String STATUS_SUBMITTED = 'Submitted';

    public static final Set<String> SET_SUBMITTED_TIMECRAD_STATUS =  new Set<String>{STATUS_SUBMITTED, STATUS_APPROVED, STATUS_REJECTED};
        
    global Database.QueryLocator start(Database.BatchableContext BC) {
        String query ='SELECT Id, Name,Contact__c, Contact__r.Email ,Contact__r.Name, ';
               query += ' (SELECT Id FROM Contact__r WHERE Start_Date__c = LAST_N_DAYS:12 AND Status__c IN: SET_SUBMITTED_TIMECRAD_STATUS )';
               query += ' FROM Account WHERE Status__c =: STATUS_SCHEDULED AND Contact__c != NULL';
        return Database.getQueryLocator(query);
    }
    
    global void execute(Database.BatchableContext BC, List<Account> scope) {
		
		Map<Id,Account> contactIdWithAssigment = new Map<Id,Account>();		
		
		for(Account  assigment : scope) {
		   if(assigment.Contact__r.size() == 0) {
		   	 contactIdWithAssigment.put(assigment.Contact__c, assigment); 
		   }									        	
		}
        
        String startDate = Date.Today().addDays(-6).format();
        String endDate = Date.Today().format();
        MTX_TimecardReminder_Uitility.sendTimecardReminder('Timecard_Reminder_Template', contactIdWithAssigment, startDate, endDate);
    }
    
    global void finish(Database.BatchableContext BC) {      
  	}
  	
  	global void execute(SchedulableContext sc) {
        MTX_TimecardReminder_Batch timecardReminder = new MTX_TimecardReminder_Batch(); 
        database.executebatch(timecardReminder);
    }
}
 
@isTest
public class test_Batch_Test {
    
    @testSetup 
    static void setup() {
        List<Project__c> dem = new List<Project__c>();
        List<Account> acc = new List<Account>();
        List<Contact> con = new List<Contact>();
        
        // insert 10 records
        for (Integer i=0;i<10;i++) {
            dem.add(new Project__c(name='Project '+i, 
                Project_Stage__c ='New'));
        }
        insert dem;
        
        for (Project__c demByList : [SELECT Id from Project__c]){
			acc.add(new Account(Name = 'TestName', Status__c = 'Scheduled',
                 Project__c=demByList.id));
        }
        insert acc;
        
        for (Account accByList : [SELECT Id,Project__c from Account]){
			con.add(new Contact(AccountId = accByList.Id,
                 Status__c = 'Submitted', Start_Date__c = System.today() - 12,
                 Project__c=accByList.Project__c));
        }
        insert con;
        

        
    }
    
    static testmethod void test() {        
        
        Test.startTest();
        test_Batch trb = new test_Batch();
        Id batchId = Database.executeBatch(trb, 200);
        Test.stopTest();

    }


}

 
please advise me we are migrating our project to classic to Lightning just want to know best way to Convert notes to New Enhanced Notes lightning and Convert old attachments to New Files lightning

please advice me.
  • January 11, 2018
  • Like
  • 0
HI Experts,

Here am trying to post a message in to slack when the opportunity stage changes,for these a i follwed below steps.
I tried all the way with process builder and Apex trigger but some how am not failed to post the opportuity stages messages on slack.
Please help me out!

Step 1: Create a Webhook

User-added image

Step 2: created a apex class:--
 
public with sharing class SlackOpportunityPublisher {
     
    private static final String slackURL = 'YOUR_WEBHOOK_URL';
     
    public class Oppty {
        @InvocableVariable(label='Opportunity Name')
        public String opptyName;
        @InvocableVariable(label='Stage')
        public String stage;
    }
     
    @InvocableMethod(label='Post to Slack')
    public static void postToSlack(List<Oppty> oppties) {
        Oppty o = oppties[0]; // If bulk, only post first to avoid overloading Slack channel
        Map<String,Object> msg = new Map<String,Object>();
        msg.put('text', 'The following opportunity has changed:\n' + o.opptyName + '\nNew Stage: *' + o.stage + '*');
        msg.put('mrkdwn', true);
        String body = JSON.serialize(msg);    
        System.enqueueJob(new QueueableSlackCall(slackURL, 'POST', body));
    }
     
    public class QueueableSlackCall implements System.Queueable, Database.AllowsCallouts {
         
        private final String url;
        private final String method;
        private final String body;
         
        public QueueableSlackCall(String url, String method, String body) {
            this.url = url;
            this.method = method;
            this.body = body;
        }
         
        public void execute(System.QueueableContext ctx) {
            HttpRequest req = new HttpRequest();
            req.setEndpoint(url);
            req.setMethod(method);
            req.setBody(body);
            Http http = new Http();
            HttpResponse res = http.send(req);
        }
 
    }
    
}

Step 3:-- Created a process Builder:-- 
creiteria :-- When record is created or edited 

User-added image

Or Step 3 :-- i thought some problem with process builder and written a trigger on opportunity.
trigger opptyTrigger on Opportunity (after insert,after update) {
List<SlackOpportunityPublisher.oppty> solutions = new List<SlackOpportunityPublisher.oppty>();
    for (Opportunity sob : Trigger.new) {
        if(sob.Name != null  || sob.Name != ''){
        SlackOpportunityPublisher.oppty s = new SlackOpportunityPublisher.oppty();
        s.opptyName = sob.Name;
        s.stage = sob.StageName;
        solutions.add(s);
    }	
        }
    SlackOpportunityPublisher.postToSlack(solutions);

}
Thanks In Advance!