PropicSignifi / Query.apex

A dynamic SOQL and SOSL query builder on Salesforce.com platform
https://propicsignifi.github.io/query-apex/
MIT License
150 stars 68 forks source link

Add more condition methods to SOSL QuerySearch #50

Open HenryRLee opened 4 years ago

HenryRLee commented 4 years ago

An example of how it is done can be referred to #49.

Basically, the returning clause can be further constrained by more condition methods. These include:

addConditionIn
addConditionNotIn
addConditionLt
addConditionLe
addConditionGt
addConditionGe
addConditionIncludes
addConditionExcludes

Example usage:

new QuerySearch().find('ABC').returning('Account').addConditionLt('CreatedDate', Date.today())
sksonalkothari commented 4 years ago

I would like to contribute to this. I am new to open source development.

HenryRLee commented 4 years ago

@sksonalkothari Sure! Give it a go. Feel free to ask us any question.

sksonalkothari commented 4 years ago

Hi @HenryRLee, I have not done Salesforce apex development before, but it looks similar to JAVA, which is why the code is easy to understand. Please help me with the setup. I have Visual Studio code, I have installed the Salesforce extensions pack. I have looked into many getting started blogs, But still I cannot get how to build, run and debug the code, and also how to test the test cases.

Although I have made the necessary changes in QuerySearch.cls file. Should I write some test cases related to these changes? How to test the same?

HenryRLee commented 4 years ago

Hi @sksonalkothari. To get started, you'd probably want to have a Salesforce org, which is something like a virtual machine. You may sign up a new org from here (https://developer.salesforce.com/docs/atlas.en-us.externalidentityImplGuide.meta/externalidentityImplGuide/external_identity_create_developer_org.htm).

After that, you need to build the code to your own org. Since you have Visual Studio Code and Salesforce extensions installed, I suppose you can take a look at this tutorial (https://trailhead.salesforce.com/en/content/learn/projects/quickstart-vscode-salesforce/use-vscode-for-salesforce). Focus on the "Authenticate to Your Playground" and "Deploy" sessions.

To run Apex unit tests, this page may be useful (https://salesforce.stackexchange.com/questions/271570/running-unit-test-class-from-vscode). Also, you can run Apex unit tests from developer consoles (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_unit_tests_running.htm).

Sometimes, you don't have to write a unit test code to test your functions, the developer console also allows you to run a piece of Apex code in the Anonymous Window (https://help.salesforce.com/articleView?id=code_dev_console_execute_anonymous.htm&type=5).

sksonalkothari commented 4 years ago

Hi @HenryRLee , Thanks for the resources. They were really helpful. By implementing the steps given in the above blogs, I was able to signup a new org , I was able to create new project and also authenticate the org. But my only concern was "How to work with git cloned project". After trying few things, I copied all the classes files of git cloned project into my newly created project and then I worked on them. After which, I could deploy the code and also test the project. Please let me know, if I am doing correct.

HenryRLee commented 4 years ago

Hi @sksonalkothari, git development is very flexible, and the way you are doing is perfectly fine. After you finished, you can copy the class files back to the original path, commit the changes, and create a pull request for code review.

I also found a guide that may be helpful for you, to understand how to commit your changes and submit for the code review: https://github.com/firstcontributions/first-contributions

sksonalkothari commented 4 years ago

Thanks @HenryRLee, I have created the pull request.