Newbies Hrcap Posted May 1, 2017 Newbies Posted May 1, 2017 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 & "') "; "" )
Joshua Willing Halpern Posted May 1, 2017 Posted May 1, 2017 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 & "' )" P.S. This doesn't matter at all, but I believe it's spelled companies.
Recommended Posts
This topic is 3032 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 accountSign in
Already have an account? Sign in here.
Sign In Now