• Anne Toney
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Query:-
 1. We can invoke only method with @WIRE Decorator.
  2. IMperative method invoke is not passible directly

I got the  information using chatGPT


you cannot directly invoke an Apex class from an Experience Site in a Lightning Web Component (LWC). Experience Sites are designed to provide a public-facing website experience for external users and do not have direct access to Apex code.
However, you can leverage Salesforce APIs to interact with your Apex code indirectly. You can create a custom Apex REST or SOAP web service that encapsulates the functionality you want to invoke. Then, from your LWC component hosted on the Experience Site, you can make HTTP requests to that custom web service to perform the desired actions.
Here's a general outline of the steps involved:
Create a custom Apex class that exposes the desired functionality as a REST or SOAP web service.
Configure the necessary access permissions for the custom web service to be accessible from the Experience Site's guest user profile.
In your LWC component, use the standard fetch() or XMLHttpRequest API to make an HTTP request to the custom web service endpoint.
Handle the response from the web service in your LWC component and update the UI accordingly.
By following this approach, you can indirectly invoke the functionality of your Apex class from the LWC component hosted on the Experience Site.

Kindly Help Here

 

We have Validation Rule on Street Field on Account Object. Below is the Validation Rule

AND(NOT(ISNEW()),ISCHANGED(Street),OR(CONTAINS(UPPER(Street),'P.O'),CONTAINS(UPPER(Street),'P.O.'),CONTAINS(UPPER(Street),'PO BOX'),CONTAINS(UPPER(Street),'POST BOX'),CONTAINS(UPPER(Street),'POST OFFICE'),CONTAINS(UPPER(Street),'PO.'),CONTAINS(UPPER(Street),'POBOX'),CONTAINS(UPPER(Street),'PO')))

Use Case: To Restrict the User to not to enter Any Post Box Number in the Street Field. But the above validation rule is working for all other combinations - except for 'PO'.

It is getting triggered for any Street String which contains 'po' letters in it. It should basically identify the PO word in the Street String.

 

 

  • August 21, 2018
  • Like
  • 1