Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
Using build_base_query within Extension for Symitar Core

Could anyone provide further examples of how to use the build_base_query within an extension for the Symitar Core? Any help would be much appreciated. To my knowledge the rest of the information has default parameters, so I just need to pass the repgen name and proceedure, correct?

snippet.png

Votes Newest

Answers


Hi Khalil,

It sounds like you have a good grasp of what to do, already. You are correct, you do need the repgen name and the procedure. In order to do good testing in dev, you probably also want to build and pass a mock string to the function as well so that you can handle a complete flow, even in development. If your repgen takes other parameters, you can pass those as well. Here is an example of a what a more complete call might look like:

mock_str = """RSRG~2f5342b6-c5f7-4160-s49d-8431k9c7d8f1~K0~JRGLINE=DATAFILENAME=CORE.OVERDRFT.STAT.xxxxxxxxxx~JRGDATATYPE=9
<OVRDRFTCHANGE>
    <ID>01</ID>
    <SUCCESS>TRUE</SUCCESS>
    <STATUS>EXTENDED</STATUS>
</OVRDRFTCHANGE>"""

status_str = "EXT"

# Set up input values for UPDTESTA query to core
rg_params = {
		'RGUSERNUM1': "01",
		'RGUSERCHR1': status_str,
		'RGUSERCHR2': self.online_user.first_name,
		'RGUSERCHR3': self.online_user.last_name
}

# Generate UPDATESTATUS query to the core
query = await self.core.build_base_query(
		"CORE.OVERDRFT.STAT",
		"UPDTESTA",
		member_number=self.online_user.user_primary_cif,
		rg_params=rg_params,
		mock_response_string=mock_response
)

# Call UPDTESTA query
status_change_resp = await query.execute()

# Do something more relevant than this with response based on your use case
self.log(f"Core response: {status_change_resp.raw}")

Definitely also check out the docs and source for the function (which it sounds like you may already have!):

Function doc

Source

I hope that helps,
Dan

1

Thank you so much! This was a massive help to me and my team!

— Khalil Aqqad   4 years ago
1

You are very welcome. I am glad it was able to help!

— Dan Collins   4 years ago
143 Views
1 Answer
4 years ago
4 years ago
Tags