• Aivaras Geraltauskas
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 4
    Replies
Hi,

I have just created a global action using a lightning component which calls a flow. This works fine on the web but I cannot see it when i am on the field service mobile app. There is only 1 publisher layout in our org and every profile is assigned to that publisher layout. 

I have tried adding some of the default global actions to the publisher layout also but i cannot see any global actions at all so I am guessing the issue is with global actions in general instead of the new global actions which I have just created. 

If anyone has any idea what the issue is or how this could be solved it would be greatly appreciated. 

Regards,
Aivaras.
Hi,

I am currently working on a flow which has 2 file uploads (1 at the start and 1 at the end). For the first file upload, i want the files to be called "Pre" and the files in the second file upload to be called "Post".

I have tried to do it by storing the conent doc ids in the output values on the file upload but this feature does not work on the field service app and throws an error. 

I have also tried to do it by using the contentdocument link object and exporting all uploads on the linkedentityid and updating the titles that way but this only worked when the flow was run from the pc. This time when the flow was run on the mobile phone there was no error but it simply did not update the file names as it should have. 

Would anyone know any workarounds for this? Any help would be appreciated.

Thanks,
Aivaras.
Hi,

Recently, I have noticed that records that are created by the system are not following the sharing rules that are defined in our org. We have sharing rules which give users access based on record type. For some reason, records created by the system (with a record type) can not be edited by users who are assigned to that record type. Would anyone know how to solve this issue?

Regards,
Aivaras.
Hi,

The latest update on the field service mobile app has hidden some features that were there before. One of them was when you go into a location, you could see a list of work orders for that location. Now, it is just blank as you can see in the image below. Would anyone know if it is possible to bring the list of work orders back? 

Kind Regards,
Aivaras.User-added image
Hi,

I have a flow which has multiple checkboxes. The results from these checkboxes are stored in a text template and this text template is then assigned to a custom field (Rich Text Area). I then call this field in a visualforce page. This returns results in this format:
         Checkbox 1: False
         Checkbox 2: True

I need it to return:
         Checkbox 1: Complete
         Checkbox 2: Incomplete

Is there a way to change this? I have tried different things on the visualforce page but I am not very experienced with html/css, etc. Any ideas would be greatly appreciated.

Kind Regards,
Aivaras.


 
Hi,

I have a small issue with a record choice set on the field service app. I have created a flow and i am currently testing this flow. I have noticed that with my admin account, the record choice set works fine but when I switch to an engineer account, the record choice does not work properly and instead basically ends the flow. Would anyone have any idea what the issue is here? I have tried giving the engineer account view all modify all rights on the related records but still the same. 

P.S. I know that it says record choice sets are not meant to work on mobile flows but I have another record choice set in this flow which works fine on both accounts. 

Thanks,
Aivaras.
Hi, Would anyone know what the issue is here. I am getting an error: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call. Error is in expression '{!multiInvoice}' in component <apex:commandButton> in page womultiinvoice: Class.woMultiInvoice.multiInvoice: line 138, column 1

The apex code is below:

public class woMultiInvoice {
    private ApexPages.StandardSetController standardSetController;
    public list<workOrder> woListSelected{get; set;}
    public string PONumber{get;set;}
    
    public woMultiInvoice(ApexPages.StandardSetController standardSetController){
        this.standardSetController = standardSetController;
        List<workOrder> selectedListViewRecords = (List<workOrder>) standardSetController.getSelected();
        woListSelected = [select id, locationId, AccountId, WorkOrderNumber, Contract__c, AgreedLabourRate__c, PartsQtyCustomerCharge__c, CustomerReport__c,
                          FirstHourCharge__c, FirstHourRate__c, GeneralLabour__c, HoursCustomerQty__c, TotalLabourPrice__c, Description, Make__c, Model__c, SerialNo__c,
                          (select id, WorkOrderId, Invoice__c, QuantityConsumed, UnitPrice, Product2.Name, Description, TotalPrice__c
                          from ProductsConsumed where invoice__c=null)
                          from WorkOrder where id in:selectedListViewRecords];
    }
    
    public PageReference multiInvoice(){
        
        //place the woListSelected back into the VF page for the Invoicer to review the records
        
        
        //system.debug(selectedListViewRecords);
        list<workOrder> woList;
        set<id> AccountIdSet = new set<id>();
        map<Account, list<workOrder>> invoiceMap = new map <Account, list<workOrder>>();
        
        for(workOrder wo: woListSelected){
            AccountIdSet.add(wo.AccountId);
        }
        system.debug('Number of Contracts in Set: '+AccountIdSet.size());
        
        for(Account acc: [select id from Account where id in:AccountIdSet]){
            woList = new list<WorkOrder>();
            for(workOrder wo: woListSelected){
                if( wo.AccountId ==acc.id)woList.add(wo);
            }
            invoiceMap.put(acc, woList);
        }
        
        
        list<workOrder> woToInvoice = new list<workOrder>();
        list<ProductConsumed> partsList = new list<ProductConsumed>();
        list<timeSheetEntry> labourList = new list<timeSheetEntry>();
        list<InvoiceLineItem__c> invItmList = new list<InvoiceLineItem__c>();
        invoice__c inv = new invoice__c();
        
        for(Account acc:invoiceMap.keyset()){
            woToInvoice = invoiceMap.get(acc);
            partsList = [select id, WorkOrderId, Invoice__c, QuantityConsumed, UnitPrice, Product2.Name, Description, TotalPrice__c
                         from ProductConsumed where invoice__c=null and workOrderId in:woToInvoice];
            
            labourList = [select id, WorkOrderId, Invoice__c, TotalTime__c, NormalTime__c, Overtime__c, OverTimeCharge__c, FirstHour__c, StandardTimeCharge__c
                          from timeSheetEntry where invoice__c=null and workOrderId in:woToInvoice];
            
            inv = new invoice__c(Type__c ='Service Invoice', Cust_Order_No__c = PONumber, Customer_Account_Name__c = acc.id, VAT_Code__c='G',
                                 Invoice_To__c = acc.id);
            insert inv;
            system.debug(inv);
            
            list<InvoiceLineItem__c>partLinesList = new list<InvoiceLineItem__c>();
            list<InvoiceLineItem__c>LabourLinesList = new list<InvoiceLineItem__c>();
            
            for(WorkOrder wo: woToInvoice){
                inv.Contract__c = wo.Contract__c;
                system.debug(wo.ProductsConsumed);
                if(!partsList.isEmpty()){
                    
                    InvoiceLineItem__c invItmParts;
                    for(ProductConsumed pc : partsList){
                        if(pc.WorkOrderId == wo.id){
                            invItmParts = new InvoiceLineItem__c(Name = wo.WorkOrderNumber+' - Parts', Invoice__c = inv.id);
                            invItmParts.Description__c = pc.Product2.Name+' - '+pc.Description;
                            invItmParts.Price__c = pc.UnitPrice;
                            invItmParts.Quantity__c = pc.QuantityConsumed;
                            pc.Invoice__c = inv.id;
                            partLinesList.add(invItmParts);
                            //update wo.ProductsConsumed; 
                        }
                    }
                }
                system.debug(wo.TimeSheetEntries);
                if(!labourList.isEmpty()){
                    InvoiceLineItem__c invItmLabour;
                    for(TimesheetEntry tse: labourList){
                        if(tse.WorkOrderId == wo.id){
                            if(tse.FirstHour__c >0){
                                invItmLabour = new InvoiceLineItem__c(Name = wo.WorkOrderNumber+' - Labour', Invoice__c = inv.id);
                                invItmLabour.Description__c = 'Labour - First Hour';
                                invItmLabour.Quantity__c = tse.FirstHour__c;
                                invItmLabour.Price__c = wo.FirstHourRate__c;
                                LabourLinesList.add(invItmLabour);                 
                            }
                            if(tse.StandardTimeCharge__c >0){
                                invItmLabour = new InvoiceLineItem__c(Name = wo.WorkOrderNumber+' - Labour', Invoice__c = inv.id);
                                invItmLabour.Description__c = 'Labour';
                                invItmLabour.Quantity__c = tse.StandardTimeCharge__c;
                                invItmLabour.Price__c = wo.AgreedLabourRate__c;
                                LabourLinesList.add(invItmLabour);
                            }
                            if(tse.OverTimeCharge__c >0){
                                invItmLabour = new InvoiceLineItem__c(Name = wo.WorkOrderNumber+' - Labour', Invoice__c = inv.id);
                                invItmLabour.Description__c = 'Labour - OOH';
                                invItmLabour.Quantity__c = tse.OverTimeCharge__c;
                                invItmLabour.Price__c = wo.OOHRate__c;
                                LabourLinesList.add(invItmLabour);
                            }
                            tse.Invoice__c =  inv.id;
                        }
                        //update wo.TimeSheetEntries;
                    }
                    
                }
                
                wo.InvoiceStatus__c = 'Invoiced';
                wo.Invoice__c = inv.id;

                
            }
            insert partLinesList;
            insert LabourLinesList;
            update partsList;
            update labourList;
            
            map<id, ServiceAppointment> SAMap = new map<id,ServiceAppointment>([select id, ParentRecordId from ServiceAppointment where ParentRecordId in:woToInvoice]);
            list<ServiceReport> sReportList = [select id, ParentId, CONTENTVERSIONDOCUMENTID, CONTENTVERSIONDOCUMENT.ContentDocumentId from ServiceReport where ParentId in:SAMap.keySet()];
            list<contentDocumentLink> cdlList = new list<contentDocumentLink>();
            for(serviceReport sr: SReportList){
                ServiceAppointment sa = SAMap.get(sr.ParentId);
                contentDocumentLink cdl = new contentDocumentLink();
                cdl.LinkedEntityId = inv.id;
                cdl.ContentDocumentId = sr.CONTENTVERSIONDOCUMENT.ContentDocumentId;
                cdlList.add(cdl);                
                
            }
            insert cdlList;
            
        }

        update woListSelected;
        update inv;
        system.debug(inv.id);
        
        PageReference reloadPage = new PageReference ('/lightning/r/Invoice__c/'+inv.id+'/view');
        system.debug(reloadPage);
        reloadPage.setRedirect(true);
        return reloadPage;
    
    }

 
Hi,  I am working on 2 triggers on 2 related objects. Basically, when some fields in object A are updated, the same fields in object B should be updated as object A is parent of object B. This should also work the other way around so when object B is updated, object A should also be updated. I have 2 triggers on each object and they both work when only one is active but not when both are active. I get the error SELF_REFERENCE_FROM_TRIGGER when both are active while updating either object. 

If anyone has any idea how to work around this I would really appreciate your help.

(P.S, I know that this can be done using process builder but I need to do this on the triggers for several reasons.).
Hi,

I am currently working on creating a flow and in this flow I have lots of checkboxes which I am storing in one text template. This text template is then used to update a field of an object. When this flow is executed, the field that is updated is updated with the pain text version of the text template even tough I have edited my text template using rich view.

I would just need something like "System 1 checked: True" in the field that I am trying to populate. Would anyone have any ideas?

Thanks,
Aivaras.
I am working on developing a process flow and i am having issues with updating records. Basically, the flow has a decision which branches out to 5 different outcomes. I have noticed that when I debug the flow, the records are updated fine for the outcome which I have selected but the rest of the records give an error 

The error message is: 
Error Occurred: The flow tried to update these records: null. This error occurred: INVALID_TYPE_ON_FIELD_IN_RECORD: Complete - Follow up Needed: value not of required type

I am guessing that the issue is that checkboxes cannot be saved as "null" and need to be set as false instead. How can I change the default values for the checkboxes to be false rather than null. 

Any feedback would be really appreciated.

 
Hi,

I have just created a global action using a lightning component which calls a flow. This works fine on the web but I cannot see it when i am on the field service mobile app. There is only 1 publisher layout in our org and every profile is assigned to that publisher layout. 

I have tried adding some of the default global actions to the publisher layout also but i cannot see any global actions at all so I am guessing the issue is with global actions in general instead of the new global actions which I have just created. 

If anyone has any idea what the issue is or how this could be solved it would be greatly appreciated. 

Regards,
Aivaras.
Hi,

The latest update on the field service mobile app has hidden some features that were there before. One of them was when you go into a location, you could see a list of work orders for that location. Now, it is just blank as you can see in the image below. Would anyone know if it is possible to bring the list of work orders back? 

Kind Regards,
Aivaras.User-added image
I am working on developing a process flow and i am having issues with updating records. Basically, the flow has a decision which branches out to 5 different outcomes. I have noticed that when I debug the flow, the records are updated fine for the outcome which I have selected but the rest of the records give an error 

The error message is: 
Error Occurred: The flow tried to update these records: null. This error occurred: INVALID_TYPE_ON_FIELD_IN_RECORD: Complete - Follow up Needed: value not of required type

I am guessing that the issue is that checkboxes cannot be saved as "null" and need to be set as false instead. How can I change the default values for the checkboxes to be false rather than null. 

Any feedback would be really appreciated.