• jesszi12 joe
  • NEWBIE
  • -1 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
I have created a custom flow and used the subflow but I am getting the flowing error (Error element Get_Slots (FlowActionCall).
An Apex error occurred: FSL.Exceptions.GeneralException: Script-thrown exception)
When i view the debug log it appears everything is working, so i'm not sure what i am doing wrong. I am using the flow scheduler from this site below. https://unofficialsf.com/flow-scheduler-enable-self-service-scheduling-for-field-service/  


User-added image
Here is how I have the subflow setup
User-added image
  • August 01, 2022
  • Like
  • 0
Requirement: When a Billing Address is modified, get the new Postal Code. Then check which Contacts on the Account are outside that Postal Code. If 1 or more Contacts are outside of the Postal Code, mark Out_of_Zip as TRUE.

I wrote this trigger on account object:

 trigger Q2 on Account (after update) {
    List<id> aid=new list<id>();
    List<Contact> c=new List<Contact>();
    
    List<id> aidd=new list<id>();
    List<account> az=new list<account>();
    List<account> acfinal=new List<account>();
    
    for(Account a1:trigger.new){
        aid.add(a1.id);
    }
    c=[select id,MailingPostalCode,Accountid from contact where accountid in :aid];
    for(Account aa:Trigger.new){
        for(contact con:c){
            if(con.Accountid==aa.id && con.MailingPostalCode!=aa.BillingPostalCode){
                aidd.add(aa.id);
            }
        }
    }
    az=[select id, Out_of_Zip__c from account where id in :aid];
    for(account al:az){
        al.Out_of_Zip__c=true;
        acfinal.add(al);
    }
    update acfinal;
}

When I am changin the postal code on the account object, It's giving the below error:

Q2: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 0012v00003EsSb5AAF; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Q2: maximum trigger depth exceeded Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate Account trigger event AfterUpdate: [] Trigger.Q2: line 27, column 1

Kindly let me know why is this happening? I am a beginner to coding.
  • April 11, 2021
  • Like
  • 1
Hello guys,

I am currently working on the development of a Lightning Web Components, first time developing for Salesforce. I've already searched everywhere but I couldn't find a working solution in order to make requests to my company's server.

I've already added our server to the list of security trusted sites and I am having problems running the following:
fetch('https://example.com', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    data: { ... }
}).then(function(res) {
    console.log(res);
}).catch(e => console.log(e));
This is the error I get:
Access to fetch at 'https://example.com' from origin 'https://origin-dev-ed.lightning.force.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Our API is returning the required 'Access-Control-Allow-Origin' header and we shouldn't be seeing such error. Or am I missing something?
Parte 1 - Digito Verificador 1 ( aos brasileiros: dá jóinha, please!)
IF( LEN(CPF_ou_CNPJ__c)= 14 , OR(AND(MOD((
( VALUE( MID( CPF_ou_CNPJ__c , 1, 1 ) ) * 6 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 2, 1 ) ) * 5 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 3, 1 ) ) * 4 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 4, 1 ) ) * 3 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 5, 1 ) ) * 2 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 6, 1 ) ) * 9 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 7, 1 ) ) * 8 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 8, 1 ) ) * 7 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 9, 1 ) ) * 6 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 10, 1 ) ) * 5 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 11, 1 ) ) * 4 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 12, 1 ) ) * 3 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 13, 1 ) ) * 2 )
), 11
) <= 1
, VALUE( MID( CPF_ou_CNPJ__c , 14, 1 ) ) != 0
)
, AND(MOD((
( VALUE( MID( CPF_ou_CNPJ__c , 1, 1 ) ) * 6 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 2, 1 ) ) * 5 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 3, 1 ) ) * 4 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 4, 1 ) ) * 3 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 5, 1 ) ) * 2 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 6, 1 ) ) * 9 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 7, 1 ) ) * 8 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 8, 1 ) ) * 7 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 9, 1 ) ) * 6 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 10, 1 ) ) * 5 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 11, 1 ) ) * 4 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 12, 1 ) ) * 3 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 13, 1 ) ) * 2 ))
, 11 ) > 1
, ( 11 - MOD((
( VALUE( MID( CPF_ou_CNPJ__c , 1, 1 ) ) * 6 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 2, 1 ) ) * 5 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 3, 1 ) ) * 4 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 4, 1 ) ) * 3 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 5, 1 ) ) * 2 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 6, 1 ) ) * 9 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 7, 1 ) ) * 8 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 8, 1 ) ) * 7 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 9, 1 ) ) * 6 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 10, 1 ) ) * 5 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 11, 1 ) ) * 4 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 12, 1 ) ) * 3 ) +
( VALUE( MID( CPF_ou_CNPJ__c , 13, 1 ) ) * 2 )
)
, 11
) ) != VALUE( MID( CPF_ou_CNPJ__c , 14, 1 ))
)), false)

Hi,

 

Is it possible to update a Staticresource record using the apex controller ?

 

Regards,