Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 2773 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Greetings All

 

I am looking to add a line into the following code into the 'prepare payload for client' section to select only records that match the following criteria

  • I have a variable set called: $additional_settings
  • The field that needs to match with $additional_settings is called _kf_uuid_companys

the code that i have already is as follows, i need to add a line into this code to pick records where the field _kf_uuid_companys matches $additional Settings.

Any help would be greatly appreciated:

 

"SELECT "

& $dyn_sql & ", '"

& $$record_delimiter & "'"

& " FROM \\"" & $sync_table & "\\""

& " WHERE " &

 

 

 

// Exclude records flagged for sync exclusion.

"( COALESCE ( BS_Exclude, 0 ) = 0 ) " &

 

 

 

 

// If the client is merging new/updated data with data already on the device...

// Only include records that have been added/updated since the last pull...

// And only include data that they did not just push (i.e. no "round tripping!")...

 

If ( ( $$sync_method = "Merge" )

and

( $last_pull_utc > 0 ) ;

 

"AND ( BS_UTC_Time > " & $last_pull_utc & " ) " &

 

"AND ( COALESCE ( BS_Device_ID, 'X' ) <> '" & $client_persistent_id & "') "; "" )

Posted

Hey, try adding this line (including the quotation marks) at the end of your SQL statement: "AND ( \"_kf_uuid_companys\" = ? )" Please note the \" around the field name--You'll need these since your field starts with _. Then include $additional_settings as the argument in your ExecuteSQL calculation like so (See attached image).

Alternatively you can embed the variable right in the SQL text: "AND ( \"_kf_uuid_companys\" = '" & $additional_settings & "' )"  

5907833beeb8e_ScreenShot2017-05-01at11_49_01AM.png.51a0f0f9c433f3a5f1a8c5071534791d.png

 

P.S. This doesn't matter at all, but I believe it's spelled companies. ;)

 

This topic is 2773 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.