Requirement :
- create a dynamic query that accepts multiple params (from input fields in Step)
- each param is added in the WHERE clause and seperated by an AND statement
- if param is blank then it is excluded from the WHERE clause
e.g. select id, name, stagename, LeadSource, Amount, Type, IsWon from
Opportunity where StageName =: param1 and LeadSource =: param2 and
Amount >: param3
Is this type of requirement possible to implement with standard Vlocity Dataraptors or do we need to invoke Apex?
Any tips/suggestions would be appreciated. Thanks.
Best Answer
After some trial and error I could not find any means to implement my requirement with standard Vlocity Dataraptors, hence I opted for below custom solution (with Apex)
Step #1 :
Create a Step element which will take 5 opportunity params, namely - StageName, LeadSource, Type, IsWon and Amount
Step #2 :
Create a Remote Action element which takes the above parameters in its Extra Payload
Step #3 :
Create the following Apex Class -
Step #4 :
Go to Remote Properties inside the Remote Action and add the Remote Class and Method names, respectively.
Step #5 :
Create another Step and add a custom LWC inside it.
Step #6 :
HTML -
JS -