• Andżela Środa
  • NEWBIE
  • 60 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 8
    Replies
Hi Everyone! :) 

On PricebookEntry object, I have a 2 lookup fields: 
- Pricebook2Id (standard field filled by Integration)
- Price_Book_2__c (custom field needed for Related list)
I want to fill the Price_Book_2__c using the value in Pricebook2Id.

I am trying to write some class, it will be my first apex class, and still I get errors...

I want to run it from Flow.

Here is code:
public class PriceBookField{
@InvocableVariable(label='Get Price Book records')
    public PriceBookEntry p;
    @InvocableMethod
    public static void populateField(List<PricebookEntry>records){
        records[0].Price_Book_2__c = records[0].Pricebook2Id;
    update records;
}
}


Can you help me?
Hi Everyone! :) 

Email-to-case doesn't work with Lightning Email Templates. I am using Flow and Email Alerts to send the emails to customers. Under Email tab on Case I can see only emails with Classic Template. The same situation with response from customer's email box. I can see only responses for Classic Templates, but not for Lightning.

Do you have any idea? :) 
Hi Experts!

We have 3 standard object in Salesforce: Account, Pricebook2 and PricebookEntry. 

Account has lookup relation to Pricebook2, and Pricebook2 has relation to PricebookEntry.

Is any possibility to create list on Account object, which will show the PricebookEntry records from right Pricebook2?

User-added image
Hi Experts! :) 

On Account object and Pricebook2 object I created 2 text fields - Customer_Price_Group__c. When both values in a Pricebook2 object record match the values of field in Account object record, respectively I would like fill the Price_Book__c field on Account record to populate with the name of Pricebook2 record.

Do you have any example of Apex trigger, that I can exercise and modify for my purpose?

Thank you! :) 
Hi everyone! :) 
 
I have a problem, that Assistant in Sales app stopped working for users with different profile than Administator. Do you know how to set up it correctly? They have permission as Standard Einstein Activity Capture or Sales Cloud Einstein.
 
What they see: 
User-added image

What I see:
User-added image
Hi everyone! :) 

I have a question regarding to automation testing: I want to write some code to make regression tests. 

Did someone try to do this? Which language will be the best? It is good idea to test it with webdriver help? 
Hi everyone! :) 

I have 2 standard object on Salesforce: Case and Asset. On Case object I created 2 custom checkbox fields: 
- In_House_Service__c
- Field_Service__c
Depends of Preferred_Service_Location__c on Asset, the right checkbox should be true on Case:
- if In-house service on Asset - the In_House_Service__c should be true on Case
- if Field Service on Asset - the Field Service__c should be true on Case

I am super newbie in Apex, I don't know how to write the right code. Maybe do you have any examples, that I can build or base on it?

I will be grateful! Thank you!
Hi everyone! :) 

Today I want to ask simple question - how to change columns in AddProduct list on Quote? :) 

I want to hide the Product Details column in this list. :) 

User-added image
Hi! :) 

Is there any way to save emails on Case record which were sent using Flow?

Now they are saved when User send the email directly from Case. I want to make automatization which will send email and save email on Case record. Thanks to that user can see what was sent to Customer. 
Hi :) I wrote one trigger which prevent User to Completed Work Order, when Service_Type__c field is empty on Work Order Line Item. I have already existing trigger on Work Order object. How to split it in one trigger?

WorkOrderTrigger: 
trigger WorkOrderTrigger on WorkOrder (after update, before delete) {

  if(Trigger.isBefore) {
        if(Trigger.isDelete) {
            WorkOrderTriggerService.countOpenWorkOrdersOfDeviceFromWoDelete(Trigger.oldMap);
        }
    }

    if(Trigger.isAfter) {
        if(Trigger.isUpdate) {
            WorkOrderTriggerService.autoUpdateNextCalibrationDate(Trigger.new, Trigger.oldMap);
            WorkOrderTriggerService.countOpenWorkOrdersOfDeviceFromWoUpdate(Trigger.new, Trigger.oldMap);
        }
    }

}



My Trigger: 
trigger ValidateWorkOrderLineItem on WorkOrder (before update) {
    Map<String, WorkOrder> mapWoToId = new Map<String,WorkOrder>();
    for(WorkOrder w : Trigger.New) {
      if(w.Status =='Completed'){
        mapWoToId.put(w.Id, w);
      }
    }
    
    List<WorkOrderLineItem> woLineItemList = [select woli.Status, woli.workOrderId from WorkOrderLineItem woli where woli.WorkOrderId IN :mapWoToId.keySet() and woli.Status != 'Completed' and woli.WOLI__c = 'Parent' and woli.Parent_WOLI__c = TRUE and woli.Service_type__c = '']; 
  
    for(WorkOrderLineItem woli : woLineItemList) {
        WorkOrder parentWO = mapWoToId.get(woli.workOrderId);
        parentWO.addError('Please fill the Service Type on each Parent Work Order Line Item');
    } 
  }


Thank you for answears!  
Hi :) I try to write Apex Trigger for Work Order object, which prevent user to Completed the Work Order if Service_Type__c field is empty. 
Can someone check my code? I get the issue that is unexpected token '<'. Thank you! 

trigger ValidateWorkOrderLineItem on WorkOrder (before update) {
  Map<String, WorkOrder> mapWoToId = new Map<String,WorkOrder>();
  for(WorkOrder w : Trigger.New) {
    if(w.Status =='Completed'){
      mapWoToId.put(w.Id, w);
    }
  }
  
  List<WorkOrderLineItem> woLineItemList = [select woli.Status, woli.workOrderId
                        from WorkOrderLineItem woli 
                        where woli.WorkOrderId IN :mapWoToId.keySet() and woli.Status != 'Completed' and woli.WOLI__c == 'Parent' and woli.Parent_WOLI__c == TRUE and woli.Service_type__c == '']; 

  for(WorkOrderLineItem woli : woLineItemList) {
      WorkOrder parentWO = mapWoToId.get(woli.workOrderId);
      parentWO.addError('Please fill the Service Type on each Parent Work Order Line Item');
  } 
}
Hi :) 
Case: I need to create flow for automatic emails sending for Periodic Case Calibration reminders. Each mail will be send after 14 days using different templates depends on company. 

How to start with it? It is possible to create autolaunched flow for it and then use the process builder? 

Or maybe do you have any better ideas? :) 

Should be something like below: 
User-added image
Hello! :) 

I have a problem regarding to Text/Image Field on Service Report Template. In Service Report Template the text is wrote in German, but when I generate service report on Work Order - whole report is in German, but this one field shows in English. Second Text/Image Field doesn't show it... Anyone know how to check it? Or where to look and find the issue?

From Service Report Template builder:
User-added image

From generated service report on Work Order:
User-added image
 
Hi Everyone!

I have question - how to create Report for History Tracking field (list) on Standard object in Salesforce (Work Orders)? 

I checked the report types, and there is anything regarding to Work Orders and History Tracking..
Hello everyone! :) 

I know that can be a stupid question, but how to create history list based on status path on Work Order records?
I want to know who and when change the record status.
User-added image
 
Hi Everyone! :) 

On PricebookEntry object, I have a 2 lookup fields: 
- Pricebook2Id (standard field filled by Integration)
- Price_Book_2__c (custom field needed for Related list)
I want to fill the Price_Book_2__c using the value in Pricebook2Id.

I am trying to write some class, it will be my first apex class, and still I get errors...

I want to run it from Flow.

Here is code:
public class PriceBookField{
@InvocableVariable(label='Get Price Book records')
    public PriceBookEntry p;
    @InvocableMethod
    public static void populateField(List<PricebookEntry>records){
        records[0].Price_Book_2__c = records[0].Pricebook2Id;
    update records;
}
}


Can you help me?
Hi Everyone! :) 

Email-to-case doesn't work with Lightning Email Templates. I am using Flow and Email Alerts to send the emails to customers. Under Email tab on Case I can see only emails with Classic Template. The same situation with response from customer's email box. I can see only responses for Classic Templates, but not for Lightning.

Do you have any idea? :) 
Hi Experts!

We have 3 standard object in Salesforce: Account, Pricebook2 and PricebookEntry. 

Account has lookup relation to Pricebook2, and Pricebook2 has relation to PricebookEntry.

Is any possibility to create list on Account object, which will show the PricebookEntry records from right Pricebook2?

User-added image
Hi everyone! :) 
 
I have a problem, that Assistant in Sales app stopped working for users with different profile than Administator. Do you know how to set up it correctly? They have permission as Standard Einstein Activity Capture or Sales Cloud Einstein.
 
What they see: 
User-added image

What I see:
User-added image
Hi everyone! :) 

I have 2 standard object on Salesforce: Case and Asset. On Case object I created 2 custom checkbox fields: 
- In_House_Service__c
- Field_Service__c
Depends of Preferred_Service_Location__c on Asset, the right checkbox should be true on Case:
- if In-house service on Asset - the In_House_Service__c should be true on Case
- if Field Service on Asset - the Field Service__c should be true on Case

I am super newbie in Apex, I don't know how to write the right code. Maybe do you have any examples, that I can build or base on it?

I will be grateful! Thank you!
Hi :) I try to write Apex Trigger for Work Order object, which prevent user to Completed the Work Order if Service_Type__c field is empty. 
Can someone check my code? I get the issue that is unexpected token '<'. Thank you! 

trigger ValidateWorkOrderLineItem on WorkOrder (before update) {
  Map<String, WorkOrder> mapWoToId = new Map<String,WorkOrder>();
  for(WorkOrder w : Trigger.New) {
    if(w.Status =='Completed'){
      mapWoToId.put(w.Id, w);
    }
  }
  
  List<WorkOrderLineItem> woLineItemList = [select woli.Status, woli.workOrderId
                        from WorkOrderLineItem woli 
                        where woli.WorkOrderId IN :mapWoToId.keySet() and woli.Status != 'Completed' and woli.WOLI__c == 'Parent' and woli.Parent_WOLI__c == TRUE and woli.Service_type__c == '']; 

  for(WorkOrderLineItem woli : woLineItemList) {
      WorkOrder parentWO = mapWoToId.get(woli.workOrderId);
      parentWO.addError('Please fill the Service Type on each Parent Work Order Line Item');
  } 
}
Hello everyone! :) 

I know that can be a stupid question, but how to create history list based on status path on Work Order records?
I want to know who and when change the record status.
User-added image