Netsuite itemFulfillment search where status = picked - netsuite

I'm trying to export Netsuite ItemFulfillment Records into a local database so I can import into UPS Worldship to send them. I'm able to export recently modified records, but can't figure out how to filter on the shipStatus. Can anyone help lead me in the correct direction?
What I have that exports recently modified records, but does not filter correctly on shipStatus:
require_once '/PHPToolkit/NetSuiteService.php';
$start_time = microtime(true);
$service = new NetSuiteService();
$transactionSearchBasic = new TransactionSearchBasic();
// type = itemFulfillment
$searchMultiSelectEnumField = new SearchEnumMultiSelectField();
$searchMultiSelectEnumField->operator = 'anyOf';
$searchMultiSelectEnumField->searchValue[] = '_itemFulfillment';
$transactionSearchBasic->type = $searchMultiSelectEnumField;
// lastmodified > datelastrun
$SearchDateField = new SearchDateField();
$SearchDateField->operator = "after";
$SearchDateField->searchValue = "2019-12-01T00:00:00";
$transactionSearchBasic->lastModifiedDate = $SearchDateField;
// shipStatus = picked
$SearchStringField = new SearchStringField();
$SearchStringField->operator = 'is';
$SearchStringField->searchValue = '_picked';
$transactionSearchBasic->shipStatus = $SearchStringField;
$transactionSearch = new TransactionSearch();
$transactionSearch->basic = $transactionSearchBasic;
$request = new SearchRequest();
$request->searchRecord = $transactionSearch;
$searchResponse = $service->search($request);
if (!$searchResponse->searchResult->status->isSuccess) {
echo "SEARCH ERROR";
} else {
echo "SEARCH SUCCESS, records found: " . $searchResponse->searchResult->totalRecords . PHP_EOL;
}
$end_time = microtime(true);
$execution_time = ($end_time - $start_time);
echo " Execution time of script = ".$execution_time." sec";

Not sure why _picked is not working.
Can you try using internal id of these status values.
Internal Id Text
A Picked
B Packed
C Shipped
Instead of '_picked' try using 'A'.

Related

How to set output contexts while creating a intent in dialogflow PHP?

I am trying to set output context to a particular intent via v2 create intent API.
Please check my code.
use Google\Cloud\Dialogflow\V2\SessionsClient;
use Google\Cloud\Dialogflow\V2\TextInput;
use Google\Cloud\Dialogflow\V2\QueryInput;
use Google\Cloud\Dialogflow\V2\IntentsClient;
use Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase_Part;
use Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase;
use Google\Cloud\Dialogflow\V2\Intent_Message_Text;
use Google\Cloud\Dialogflow\V2\Intent_Message;
use Google\Cloud\Dialogflow\V2\Intent;
use Google\Cloud\Dialogflow\V2\Context;
use Google\Cloud\Dialogflow\V2\ContextsClient;
private function intent_create(){
putenv('GOOGLE_APPLICATION_CREDENTIALS='.getcwd() . '/strive_stage.json');
$intentsClient = new IntentsClient();
/** Create Intent **/
$disaplayName = "Where is Goa";
$utterances = ["Goa", "Where is Goa"];
// prepare training phrases for intent
$trainingPhrases = [];
foreach ($utterances as $trainingPhrasePart) {
$part = new Intent_TrainingPhrase_Part();
$part->setText($trainingPhrasePart);
// create new training phrase for each provided part
$trainingPhrase = new Intent_TrainingPhrase();
$trainingPhrase->setParts([$part]);
$trainingPhrases[] = $trainingPhrase;
}
$messageTexts = 'Goa is in India.';
// prepare messages for intent
$text = new Intent_Message_Text();
$text->setText([$messageTexts]);
$message = new Intent_Message();
$message->setText($text);
$createIntentObject = $intentsClient->projectAgentName(env("DIALOG_FLOW_PROJECT_ID"));
// prepare intent
$intent = new Intent();
$intent->setDisplayName($disaplayName);
$intent->setTrainingPhrases($trainingPhrases);
$intent->setMessages([$message]);
$contexts = ['test'];
foreach($contexts as $con){
$contextObj = new Context();
$contextObj->setName($con);
$contextData[] = $contextObj;
$intent->setOutputContexts($contextData);
}
// $intent->getOutputContexts('test');
//dd($intent);
$response = $intentsClient->createIntent($createIntentObject, $intent);
printf('Intent created: %s' . PHP_EOL, $response->getName());
}
I am getting error message
{
"message": "com.google.apps.framework.request.BadRequestException: Resource name does not match format 'projects/{project_id}/agent/sessions/{session_id}/contexts/{context_id}' or 'projects/{project_id}/locations/{location_id}/agent/sessions/{session_id}/contexts/{context_id}'.",
"code": 3,
"status": "INVALID_ARGUMENT",
"details": []
}
I believe the issue is with the format of storing the output context. Please help me on this.
I had the same issue. The answer is to not put in the bare name, but to have a string of a certain format made
see http://googleapis.github.io/google-cloud-php/#/docs/google-cloud/v0.131.0/dialogflow/v2/intent?method=setOutputContexts
// $projectId your project id
// $sessionId can be anything, I use $sessionId = uniqid();
$uri = "projects/$projectId/agent/sessions/$sessionId/contexts/$con";
$contextObj->setName($uri);
I can see that there are any response about this topic.
I leave here my solution for the next generations
To create a output context you need to create the correct format, for this objetive you can use Context class Google\Cloud\Dialogflow\V2\Context
private function parseoOutputContexts($contexts, $project_id, $lifespan = 5)
{
$newContexts = array();
foreach ($contexts as $context) {
$newContexts[] = new Context(
[
'name' => 'projects/' . $project_id . '/agent/sessions/-/contexts/' . $context,
'lifespan_count' => $lifespan
]
);
}
return $newContexts;
}
And you can use this function to finnaly add the output context to the object Intent.
$dialogflow_intent = new Intent();
$output_contexts = ['output_context_1'. 'output_context_2'];
$output_contexts = $this->parseOutputContexts($output_contexts, '[YOUR_PROJECT_ID]');
$dialogflow_intent->setOutputContexts($output_contexts);

Core Data failing automatic lightweight migration

I'm crashing every time Core Data tries to do an automatic lightweight migration after making a new version of the model (let's call it "Model 2.6") in my app (currently using "Model 2.5").
I've been working with Core Data for a while now, and I'm well aware that any time I need model changes for a new version, I have to use "Editor --> Add Model Version", give that version a new identifier, and switch over to that using the "Current Version" popup. I'm familiar with the "The model used to open the store is incompatible with the one used to create the store" error, because I've made that mistake before. I believe I'm encountering a different problem, though getting that same error message.
After banging my head against this for most of the weekend, I'm hoping someone out there has seen this before and can offer some sage advice.
Here are my steps to trigger the issue:
Reset Simulator, nuke Derived Data, clean build and save a file
with the 2.5 format.
In Xcode, Editor --> Add Model Version...
Use that wizard to make a "Model 2.6" based on "Model 2.5"
Change the new guy's identifier to "2.6"
Do something super-simple to that new version that's totally compatible with automatic lightweight migration, like add an new entity.
Set that "Model 2.6" under the popup for Current Version
Rebuild & launch in the simulator. Crash while opening that 2.5 file I just saved.
I've managed file format updates successfully with nine different releases, and automatic lightweight migration always worked flawlessly, until now.
Differences between now and last time:
Version 2.5 of my model was the first time I set the "Tools Version" to "Automatic (Xcode 8)". All prior releases had this set to "Xcode 7.3" so this will be the first time a migration will happen from a model version already on "Automatic (Xcode 8)"
My xcdatamodeld (and therefore momd file) now lives in my shared framework instead of the host app (so I can share code/resources among extensions, tvOS, etc), though I tried undoing this change to see if it was the cause, and the error still occurs.
I'm honestly not sure. This was supposed to be a trivial hour-long task and it's turned into two days of head-scratching.
Here's the actual error logged after the call to
[_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:self.mainURL options:storeOptions error:&error]
where the storeOptions are { NSInferMappingModelAutomaticallyOption = 1; NSMigratePersistentStoresAutomaticallyOption = 1; } and for some reason there are two: one for the file .Model.sqlite.migrationdestination_41b5a6b5c6e848c462a8480cd24caef3 and another for the file Model.sqlite, presumably part of the migration process. (Code=134110 with underlying Code=134100)
2016-11-20 16:49:26.928867 Lightbow[27831:356321] [error] error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/pwr/Library/Developer/CoreSimulator/Devices/8BDBBB41-ECF6-4646-BA13-DFFD02C40A62/data/Containers/Data/Application/8AE75536-DB51-453F-AEC2-6531F6A0675A/Library/Application%20Support/Lightbow/.Model.sqlite.migrationdestination_41b5a6b5c6e848c462a8480cd24caef3 options:{
NSSQLitePragmasOption = {
"journal_mode" = "<null>";
};
} ... returned error Error Domain=NSCocoaErrorDomain Code=134100 "(null)" UserInfo={metadata={
NSPersistenceFrameworkVersion = 752;
NSStoreModelVersionHashes = {
LBAlarmTrigger = <a84c55da 7fabee63 d6f9965b 4a8408bb aaabc674 bdaff438 347e1ed4 44adb186>;
LBAliasTarget = <d1cdfcbc 1fecf252 1e5ef2e4 6faa5735 6e990645 b8a8a1a6 5db79d93 622ef7af>;
LBAppEventTrigger = <99063c81 4ffe9fec b4092be9 bda6b5cb a1cd8745 400a8a2c 6b44c3e5 abfba541>;
LBAssignment = <bf29b799 abdb6883 0831f861 bb255cf1 5300e503 971ba129 81a18a61 2955eb18>;
LBAudioReference = <0c155311 c41aff4f ebcbea65 1a6ee54a 39039c9a fdcc78e0 d5c21295 38a9069d>;
LBBundledAudioReference = <4c3a5f7b d475af0e df276979 c8ede1cb 24fd616f 7ef33a71 b7302d68 65246848>;
LBCTLightState = <a5c2a06e 72caae63 0b8af8c3 d1be96f0 177ae06e c15120d4 a360b8a0 219c5911>;
LBCollection = <f8c72dfe 0c446e24 0913fcfb f2e603bf 0b3a2d2d 742cda3d 0888d734 2fec4e42>;
LBCollectionItem = <e0a4fd81 4225db2c 5cb0c08d 643324bd 7b23d53a d98deb16 5fa23bf0 a8cdc512>;
LBFadeThroughTransition = <6a37014b c8064ad1 69422f5b d31fa09c 5d61fc01 2b5a50f7 2aadd2e6 76430357>;
LBGroup = <cee84942 402b44d9 905ddb29 84b5f86d d2514f21 e91d9e85 c56c1bd5 de32f3a8>;
LBHSBLightState = <c9926442 5ee27261 c633555a c6259ad9 616b0e23 f5593f5d c82b9f5b 377ff428>;
LBHardwareEventTrigger = <07bd5b0e f52d4701 719c29bc 3a0eed4b b6a93a6d ff596a7d 9b9f98c0 39a805ce>;
LBLight = <4cdd2589 13b20fe0 cc2fa2c6 ce23f092 d45e0bfd 2e5f1421 1be6e0ab a051b6d5>;
LBLightMaster = <95b22dc3 e73a2388 26768e66 1059d41d 40121a30 a3df95da d94649b4 2ed501e8>;
LBLightState = <5e36f926 259d7ef2 8212622c 821182b2 44ade18f 5e8d4fe5 e715f09e 4dc7156f>;
LBMediaItemReference = <28b87019 ffd085e6 944c4a0c fc822b47 68975cff a0ca1484 16888ccf ca89b407>;
LBPreset = <30fa1d52 bac80149 6fee4319 94e16614 cd0830d3 c6414bf6 d48831dc 4a4495b5>;
LBResourceIdentifier = <dedc1079 739eac97 fbc42105 4a64a53e a3ae6c17 00a48ae2 29d30369 e36a3d11>;
LBTimerTrigger = <66736edf 9f104506 e1950ac1 b57062c8 eda65031 d01392ae 51ad7d70 b3143468>;
LBTiming = <362157d7 155e430b 63149c49 5fa84a5f a26a85ee 61ed5748 2f125948 7d4bfeb0>;
LBTransition = <00c8f3a1 fd66426a d0778e83 f51fe772 ab15e7e8 981f2819 aaf10bfc 15384b22>;
LBTrigger = <42c5754c 424e6c9c fc0cf034 e40a4d9c 8fa33236 f9116baa 6c79c248 c6de45d2>;
LBXYLightState = <893ae1a2 4566602f 214572fe aa0eb10f a50e1b1f 2cb5bfff 764892ff 86a62a5b>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
"2.5"
);
NSStoreType = SQLite;
NSStoreUUID = "AD94F9C0-947C-4062-A026-253C6DA20AB6";
"_NSAutoVacuumLevel" = 2;
}, reason=The model used to open the store is incompatible with the one used to create the store} with userInfo dictionary {
metadata = {
NSPersistenceFrameworkVersion = 752;
NSStoreModelVersionHashes = {
LBAlarmTrigger = <a84c55da 7fabee63 d6f9965b 4a8408bb aaabc674 bdaff438 347e1ed4 44adb186>;
LBAliasTarget = <d1cdfcbc 1fecf252 1e5ef2e4 6faa5735 6e990645 b8a8a1a6 5db79d93 622ef7af>;
LBAppEventTrigger = <99063c81 4ffe9fec b4092be9 bda6b5cb a1cd8745 400a8a2c 6b44c3e5 abfba541>;
LBAssignment = <bf29b799 abdb6883 0831f861 bb255cf1 5300e503 971ba129 81a18a61 2955eb18>;
LBAudioReference = <0c155311 c41aff4f ebcbea65 1a6ee54a 39039c9a fdcc78e0 d5c21295 38a9069d>;
LBBundledAudioReference = <4c3a5f7b d475af0e df276979 c8ede1cb 24fd616f 7ef33a71 b7302d68 65246848>;
LBCTLightState = <a5c2a06e 72caae63 0b8af8c3 d1be96f0 177ae06e c15120d4 a360b8a0 219c5911>;
LBCollection = <f8c72dfe 0c446e24 0913fcfb f2e603bf 0b3a2d2d 742cda3d 0888d734 2fec4e42>;
LBCollectionItem = <e0a4fd81 4225db2c 5cb0c08d 643324bd 7b23d53a d98deb16 5fa23bf0 a8cdc512>;
LBFadeThroughTransition = <6a37014b c8064ad1 69422f5b d31fa09c 5d61fc01 2b5a50f7 2aadd2e6 76430357>;
LBGroup = <cee84942 402b44d9 905ddb29 84b5f86d d2514f21 e91d9e85 c56c1bd5 de32f3a8>;
LBHSBLightState = <c9926442 5ee27261 c633555a c6259ad9 616b0e23 f5593f5d c82b9f5b 377ff428>;
LBHardwareEventTrigger = <07bd5b0e f52d4701 719c29bc 3a0eed4b b6a93a6d ff596a7d 9b9f98c0 39a805ce>;
LBLight = <4cdd2589 13b20fe0 cc2fa2c6 ce23f092 d45e0bfd 2e5f1421 1be6e0ab a051b6d5>;
LBLightMaster = <95b22dc3 e73a2388 26768e66 1059d41d 40121a30 a3df95da d94649b4 2ed501e8>;
LBLightState = <5e36f926 259d7ef2 8212622c 821182b2 44ade18f 5e8d4fe5 e715f09e 4dc7156f>;
LBMediaItemReference = <28b87019 ffd085e6 944c4a0c fc822b47 68975cff a0ca1484 16888ccf ca89b407>;
LBPreset = <30fa1d52 bac80149 6fee4319 94e16614 cd0830d3 c6414bf6 d48831dc 4a4495b5>;
LBResourceIdentifier = <dedc1079 739eac97 fbc42105 4a64a53e a3ae6c17 00a48ae2 29d30369 e36a3d11>;
LBTimerTrigger = <66736edf 9f104506 e1950ac1 b57062c8 eda65031 d01392ae 51ad7d70 b3143468>;
LBTiming = <362157d7 155e430b 63149c49 5fa84a5f a26a85ee 61ed5748 2f125948 7d4bfeb0>;
LBTransition = <00c8f3a1 fd66426a d0778e83 f51fe772 ab15e7e8 981f2819 aaf10bfc 15384b22>;
LBTrigger = <42c5754c 424e6c9c fc0cf034 e40a4d9c 8fa33236 f9116baa 6c79c248 c6de45d2>;
LBXYLightState = <893ae1a2 4566602f 214572fe aa0eb10f a50e1b1f 2cb5bfff 764892ff 86a62a5b>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
"2.5"
);
NSStoreType = SQLite;
NSStoreUUID = "AD94F9C0-947C-4062-A026-253C6DA20AB6";
"_NSAutoVacuumLevel" = 2;
};
reason = "The model used to open the store is incompatible with the one used to create the store";
}
2016-11-20 16:49:27.027401 Lightbow[27831:356321] [error] error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/pwr/Library/Developer/CoreSimulator/Devices/8BDBBB41-ECF6-4646-BA13-DFFD02C40A62/data/Containers/Data/Application/8AE75536-DB51-453F-AEC2-6531F6A0675A/Library/Application%20Support/Lightbow/Model.sqlite options:{
NSInferMappingModelAutomaticallyOption = 1;
NSMigratePersistentStoresAutomaticallyOption = 1;
} ... returned error Error Domain=NSCocoaErrorDomain Code=134110 "(null)" UserInfo={NSUnderlyingError=0x6000002564a0 {Error Domain=NSCocoaErrorDomain Code=134100 "(null)" UserInfo={metadata={
NSPersistenceFrameworkVersion = 752;
NSStoreModelVersionHashes = {
LBAlarmTrigger = <a84c55da 7fabee63 d6f9965b 4a8408bb aaabc674 bdaff438 347e1ed4 44adb186>;
LBAliasTarget = <d1cdfcbc 1fecf252 1e5ef2e4 6faa5735 6e990645 b8a8a1a6 5db79d93 622ef7af>;
LBAppEventTrigger = <99063c81 4ffe9fec b4092be9 bda6b5cb a1cd8745 400a8a2c 6b44c3e5 abfba541>;
LBAssignment = <bf29b799 abdb6883 0831f861 bb255cf1 5300e503 971ba129 81a18a61 2955eb18>;
LBAudioReference = <0c155311 c41aff4f ebcbea65 1a6ee54a 39039c9a fdcc78e0 d5c21295 38a9069d>;
LBBundledAudioReference = <4c3a5f7b d475af0e df276979 c8ede1cb 24fd616f 7ef33a71 b7302d68 65246848>;
LBCTLightState = <a5c2a06e 72caae63 0b8af8c3 d1be96f0 177ae06e c15120d4 a360b8a0 219c5911>;
LBCollection = <f8c72dfe 0c446e24 0913fcfb f2e603bf 0b3a2d2d 742cda3d 0888d734 2fec4e42>;
LBCollectionItem = <e0a4fd81 4225db2c 5cb0c08d 643324bd 7b23d53a d98deb16 5fa23bf0 a8cdc512>;
LBFadeThroughTransition = <6a37014b c8064ad1 69422f5b d31fa09c 5d61fc01 2b5a50f7 2aadd2e6 76430357>;
LBGroup = <cee84942 402b44d9 905ddb29 84b5f86d d2514f21 e91d9e85 c56c1bd5 de32f3a8>;
LBHSBLightState = <c9926442 5ee27261 c633555a c6259ad9 616b0e23 f5593f5d c82b9f5b 377ff428>;
LBHardwareEventTrigger = <07bd5b0e f52d4701 719c29bc 3a0eed4b b6a93a6d ff596a7d 9b9f98c0 39a805ce>;
LBLight = <4cdd2589 13b20fe0 cc2fa2c6 ce23f092 d45e0bfd 2e5f1421 1be6e0ab a051b6d5>;
LBLightMaster = <95b22dc3 e73a2388 26768e66 1059d41d 40121a30 a3df95da d94649b4 2ed501e8>;
LBLightState = <5e36f926 259d7ef2 8212622c 821182b2 44ade18f 5e8d4fe5 e715f09e 4dc7156f>;
LBMediaItemReference = <28b87019 ffd085e6 944c4a0c fc822b47 68975cff a0ca1484 16888ccf ca89b407>;
LBPreset = <30fa1d52 bac80149 6fee4319 94e16614 cd0830d3 c6414bf6 d48831dc 4a4495b5>;
LBResourceIdentifier = <dedc1079 739eac97 fbc42105 4a64a53e a3ae6c17 00a48ae2 29d30369 e36a3d11>;
LBTimerTrigger = <66736edf 9f104506 e1950ac1 b57062c8 eda65031 d01392ae 51ad7d70 b3143468>;
LBTiming = <362157d7 155e430b 63149c49 5fa84a5f a26a85ee 61ed5748 2f125948 7d4bfeb0>;
LBTransition = <00c8f3a1 fd66426a d0778e83 f51fe772 ab15e7e8 981f2819 aaf10bfc 15384b22>;
LBTrigger = <42c5754c 424e6c9c fc0cf034 e40a4d9c 8fa33236 f9116baa 6c79c248 c6de45d2>;
LBXYLightState = <893ae1a2 4566602f 214572fe aa0eb10f a50e1b1f 2cb5bfff 764892ff 86a62a5b>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
"2.5"
);
NSStoreType = SQLite;
NSStoreUUID = "AD94F9C0-947C-4062-A026-253C6DA20AB6";
"_NSAutoVacuumLevel" = 2;
}, reason=The model used to open the store is incompatible with the one used to create the store}}, reason=Failed to open the store} with userInfo dictionary {
NSUnderlyingError = "Error Domain=NSCocoaErrorDomain Code=134100 \"(null)\" UserInfo={metadata={\n NSPersistenceFrameworkVersion = 752;\n NSStoreModelVersionHashes = {\n LBAlarmTrigger = <a84c55da 7fabee63 d6f9965b 4a8408bb aaabc674 bdaff438 347e1ed4 44adb186>;\n LBAliasTarget = <d1cdfcbc 1fecf252 1e5ef2e4 6faa5735 6e990645 b8a8a1a6 5db79d93 622ef7af>;\n LBAppEventTrigger = <99063c81 4ffe9fec b4092be9 bda6b5cb a1cd8745 400a8a2c 6b44c3e5 abfba541>;\n LBAssignment = <bf29b799 abdb6883 0831f861 bb255cf1 5300e503 971ba129 81a18a61 2955eb18>;\n LBAudioReference = <0c155311 c41aff4f ebcbea65 1a6ee54a 39039c9a fdcc78e0 d5c21295 38a9069d>;\n LBBundledAudioReference = <4c3a5f7b d475af0e df276979 c8ede1cb 24fd616f 7ef33a71 b7302d68 65246848>;\n LBCTLightState = <a5c2a06e 72caae63 0b8af8c3 d1be96f0 177ae06e c15120d4 a360b8a0 219c5911>;\n LBCollection = <f8c72dfe 0c446e24 0913fcfb f2e603bf 0b3a2d2d 742cda3d 0888d734 2fec4e42>;\n LBCollectionItem = <e0a4fd81 4225db2c 5cb0c08d 643324bd 7b23d53a d98deb16 5fa23bf0 a8cdc512>;\n LBFadeThroughTransition = <6a37014b c8064ad1 69422f5b d31fa09c 5d61fc01 2b5a50f7 2aadd2e6 76430357>;\n LBGroup = <cee84942 402b44d9 905ddb29 84b5f86d d2514f21 e91d9e85 c56c1bd5 de32f3a8>;\n LBHSBLightState = <c9926442 5ee27261 c633555a c6259ad9 616b0e23 f5593f5d c82b9f5b 377ff428>;\n LBHardwareEventTrigger = <07bd5b0e f52d4701 719c29bc 3a0eed4b b6a93a6d ff596a7d 9b9f98c0 39a805ce>;\n LBLight = <4cdd2589 13b20fe0 cc2fa2c6 ce23f092 d45e0bfd 2e5f1421 1be6e0ab a051b6d5>;\n LBLightMaster = <95b22dc3 e73a2388 26768e66 1059d41d 40121a30 a3df95da d94649b4 2ed501e8>;\n LBLightState = <5e36f926 259d7ef2 8212622c 821182b2 44ade18f 5e8d4fe5 e715f09e 4dc7156f>;\n LBMediaItemReference = <28b87019 ffd085e6 944c4a0c fc822b47 68975cff a0ca1484 16888ccf ca89b407>;\n LBPreset = <30fa1d52 bac80149 6fee4319 94e16614 cd0830d3 c6414bf6 d48831dc 4a4495b5>;\n LBResourceIdentifier = <dedc1079 739eac97 fbc42105 4a64a53e a3ae6c17 00a48ae2 29d30369 e36a3d11>;\n LBTimerTrigger = <66736edf 9f104506 e1950ac1 b57062c8 eda65031 d01392ae 51ad7d70 b3143468>;\n LBTiming = <362157d7 155e430b 63149c49 5fa84a5f a26a85ee 61ed5748 2f125948 7d4bfeb0>;\n LBTransition = <00c8f3a1 fd66426a d0778e83 f51fe772 ab15e7e8 981f2819 aaf10bfc 15384b22>;\n LBTrigger = <42c5754c 424e6c9c fc0cf034 e40a4d9c 8fa33236 f9116baa 6c79c248 c6de45d2>;\n LBXYLightState = <893ae1a2 4566602f 214572fe aa0eb10f a50e1b1f 2cb5bfff 764892ff 86a62a5b>;\n };\n NSStoreModelVersionHashesVersion = 3;\n NSStoreModelVersionIdentifiers = (\n \"2.5\"\n );\n NSStoreType = SQLite;\n NSStoreUUID = \"AD94F9C0-947C-4062-A026-253C6DA20AB6\";\n \"_NSAutoVacuumLevel\" = 2;\n}, reason=The model used to open the store is incompatible with the one used to create the store}";
reason = "Failed to open the store";
}
Am I missing something obvious when creating this new version? Any other caches or hidden files to clean out? I did notice that when creating a new Whatever.xcdatamodel, a "Discard All Changes..." in Xcode left that file around, so I'm extra careful to delete test runs and check "git status" outside Xcode.
I'm skeptical of the error message because I can switch the xcdatamodeld's "Current Version" back to 2.5, see the file open just fine, switch "Current Version" to 2.6, see it fail, and go back and forth with predictable success/failure. It's clearly able to open 2.5 documents, just somehow not when it's trying to migrate them to 2.6.

script score function not working but addDecayFunction is working of FunctionScore query

I am using Elastica and going to use \Elastica\Query\FunctionScore(); function score --> script_score. Here addDecayFunction() woking fine but addScriptScoreFunction() not work and not through any exception.
DecyFunction is commented because it is working
Here is code
$scriptString = "doc['geo_location'].distanceInMiles('42.946697', '-76.113623')";
$script = new \Elastica\Script($scriptString);
$query = new \Elastica\Query\FunctionScore();
$query->addScriptScoreFunction($script);
// $locationOrigin = "32.804654, -117.242594";
// $locationScale = '2mi';
// $query->addDecayFunction(\Elastica\Query\FunctionScore::DECAY_GAUSS, 'geo_location', $locationOrigin, $locationScale);
$resultSet = $type->search($query);
$results = $resultSet->getResults();
$totalResults = $resultSet->getTotalHits();
if ( $totalResults > 0 ) {
echo "<b>Total Results Found are:</b> " . $totalResults . "<br>";
foreach ( $results as $result ) {
echo $result->getScore();
$data = $result->getData();
var_dump($data);
}
}
maybe you forget to enable scripts?
script.disable_dynamic: false

Derived column was not map to output column? How can i do?

Package is successfully generated. but derived column showing the error bellow-
Validation error. This is a programmed DataFlowTask Derived Column [2]: Attempt to parse the expression "Empid" failed and returned error code 0xC00470A2. The expression cannot be parsed. It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error. MyProgrammedDataflowTaskWithDerivedColumn.dtsx
bellow is my code-
// Create an application
Application app = new Application();
// Create a package
Package pkg = new Package();
//Setting some properties
pkg.Name = #"MyProgrammedDataflowTaskWithDerivedColumn";
//Adding a connection to the database AdventureWorksLT2008R2
ConnectionManager ConnMgrAdvent = pkg.Connections.Add("OLEDB");
ConnMgrAdvent.ConnectionString = "Data Source=412-1682;Initial Catalog=Empdb;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;";
ConnMgrAdvent.Name = #"AdventureWorks2008R2";
ConnMgrAdvent.Description = #"SSIS Connection Manager for OLEDB Source";
//Adding a connection to the database Import_DB
ConnectionManager ConnMgrImport_DB = pkg.Connections.Add("OLEDB");
ConnMgrImport_DB.ConnectionString = "Data Source=412-1682;Initial Catalog=stgEmpdb;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;";
ConnMgrImport_DB.Name = #"Import_DB";
ConnMgrImport_DB.Description = #"SSIS Connection Manager for OLEDB Source";
//Adding the dataflow task to the package
Executable exe = pkg.Executables.Add("STOCK:PipelineTask");
TaskHost TKHSQLHost = (TaskHost)exe;
TKHSQLHost.Name = "This is a programmed DataFlowTask";
MainPipe dataFlowTask = (MainPipe)TKHSQLHost.InnerObject;
// Create the source component.
IDTSComponentMetaData100 source =
dataFlowTask.ComponentMetaDataCollection.New();
source.ComponentClassID = "DTSAdapter.OleDbSource.3";
CManagedComponentWrapper srcDesignTime = source.Instantiate();
srcDesignTime.ProvideComponentProperties();
// Assign the connection manager.
if (source.RuntimeConnectionCollection.Count > 0)
{
source.RuntimeConnectionCollection[0].ConnectionManager =DtsConvert.GetExtendedInterface(ConnMgrAdvent);
source.RuntimeConnectionCollection[0].ConnectionManagerID =
pkg.Connections["AdventureWorks2008R2"].ID;
}
// Set the custom properties of the source.
srcDesignTime.SetComponentProperty("AccessMode", 0);
srcDesignTime.SetComponentProperty("OpenRowset", "[dbo].[emp1]");
// Connect to the data source, and then update the metadata for the source.
srcDesignTime.AcquireConnections(null);
srcDesignTime.ReinitializeMetaData();
srcDesignTime.ReleaseConnections();
// Create the destination component.
IDTSComponentMetaData100 destination =
dataFlowTask.ComponentMetaDataCollection.New();
destination.ComponentClassID = "DTSAdapter.OleDbDestination.3";
CManagedComponentWrapper destDesignTime = destination.Instantiate();
destDesignTime.ProvideComponentProperties();
// Assign the connection manager.
destination.RuntimeConnectionCollection[0].ConnectionManager =
DtsConvert.GetExtendedInterface(ConnMgrImport_DB);
if (destination.RuntimeConnectionCollection.Count > 0)
{
destination.RuntimeConnectionCollection[0].ConnectionManager =
DtsConvert.GetExtendedInterface(ConnMgrImport_DB);
destination.RuntimeConnectionCollection[0].ConnectionManagerID =
pkg.Connections["Import_DB"].ID;
}
// Set the custom properties of the destination
destDesignTime.SetComponentProperty("AccessMode", 0);
destDesignTime.SetComponentProperty("OpenRowset", "[dbo].[emp1]");
// Connect to the data source, and then update the metadata for the source.
destDesignTime.AcquireConnections(null);
destDesignTime.ReinitializeMetaData();
destDesignTime.ReleaseConnections();
//Derived Column
IDTSComponentMetaData100 derived =
dataFlowTask.ComponentMetaDataCollection.New();
derived.Name = "Derived Column Component";
derived.ComponentClassID = "DTSTransform.DerivedColumn.3";
CManagedComponentWrapper DesignDerivedColumns = derived.Instantiate();
DesignDerivedColumns.ProvideComponentProperties(); //design time
derived.InputCollection[0].ExternalMetadataColumnCollection.IsUsed = false;
derived.InputCollection[0].HasSideEffects = false;
//update the metadata for the derived columns
DesignDerivedColumns.AcquireConnections(null);
DesignDerivedColumns.ReinitializeMetaData();
DesignDerivedColumns.ReleaseConnections();
//Create the path from source to derived columns
IDTSPath100 SourceToDerivedPath = dataFlowTask.PathCollection.New();
SourceToDerivedPath.AttachPathAndPropagateNotifications(source.OutputCollection[0],derived.InputCollection[0]);
//Create the path from derived to desitination
IDTSPath100 DerivedToDestinationPath = dataFlowTask.PathCollection.New();
DerivedToDestinationPath.AttachPathAndPropagateNotifications(derived.OutputCollection[0], destination.InputCollection[0]);
// derivedColumns.SetUsageType(dInput.ID, vdInput, vColumn.LineageID, DTSUsageType.UT_READONLY);
//Give me an output column
IDTSInput100 dInput;
IDTSVirtualInput100 vdInput;
//Get this components default input and virtual input
dInput = derived.InputCollection[0];
vdInput = dInput.GetVirtualInput();
IDTSOutputColumn100 myCol = derived.OutputCollection[0].OutputColumnCollection.New();
myCol.Name = "RowKey";
myCol.SetDataTypeProperties(Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType.DT_I4, 0, 0, 0, 0);
myCol.ExternalMetadataColumnID = 0;
myCol.ErrorRowDisposition = DTSRowDisposition.RD_FailComponent;
myCol.TruncationRowDisposition = DTSRowDisposition.RD_FailComponent;
IDTSCustomProperty100 myProp = myCol.CustomPropertyCollection.New();
myProp.Name = "Expression";
myProp.Value = "Empid";// + vColumn.LineageID;
myProp = myCol.CustomPropertyCollection.New();
myProp.Name = "FriendlyExpression";
myProp.Value = "Empid";
//Create the input columns for the transformation component
IDTSInput100 input = derived.InputCollection[0];
IDTSVirtualInput100 derivedInputVirtual = input.GetVirtualInput();
input.ErrorRowDisposition = DTSRowDisposition.RD_NotUsed;
input.ErrorOrTruncationOperation = "";
DesignDerivedColumns.ReleaseConnections();
// Get the destination's default input and virtual input.
IDTSInput100 destinationinput = destination.InputCollection[0];
int destinationInputID = input.ID;
IDTSVirtualInput100 vdestinationinput = destinationinput.GetVirtualInput();
//Iterate through the virtual input column collection.
foreach (IDTSVirtualInputColumn100 vColumn in vdestinationinput.VirtualInputColumnCollection)
{
IDTSInputColumn100 vCol = destDesignTime.SetUsageType(destinationinput.ID, vdestinationinput, vColumn.LineageID, DTSUsageType.UT_READWRITE);
destDesignTime.MapInputColumn(destinationinput.ID, vCol.ID, destinationinput.ExternalMetadataColumnCollection[vColumn.Name].ID);
}
app.SaveToXml(String.Format(#"D:\{0}.dtsx", pkg.Name), pkg, null);
solved this by adding bellow code to validate derived column component :-
IDTSInput100 DerivedColumnInput = derived.InputCollection[0];
IDTSVirtualInput100 DerivedColumnVirtualInput = DerivedColumnInput.GetVirtualInput();
IDTSVirtualInputColumnCollection100 DerivedColumnVirtualInputColumns = DerivedColumnVirtualInput.VirtualInputColumnCollection;
foreach (IDTSVirtualInputColumn100 virtualInputColumnDT in DerivedColumnVirtualInputColumns)
{
// Select column, and retain new input column
if (virtualInputColumnDT.Name=="Empid")
{
designDerivedColumns.SetUsageType(DerivedColumnInput.ID, DerivedColumnVirtualInput, virtualInputColumnDT.LineageID, DTSUsageType.UT_READONLY);
}
}

PHP variables not showing up. GETid not working properly

I have all the login scripts and profiles set up. I have a data table where all the profile information is stored called plus_signup but I can't seem to get this GET[id] thing to work. Am I missing something? Here's what I have.
When I view the page with the code I have now, there are blank areas where PHP is supposed to fill in the variables.
session_start();
include "include/z_db.php";
if ($_GET['id']){
$id = $_GET['id'];
} else if (isset($_SESSION['id'])) {
$id = $_SESSION['id'];
}
else {
print "important data to render this page is missing";
exit();
$sql = mysql_query("SELECT * FROM plus_signup WHERE id='$userid'");
while($row = mysql_fetch_array($sql)){
$userid = $row["userid"];
$name = $row["name"];
$location = $row["location"];
$sex = $row["sex"];
$aboutme = $row["aboutme"];
}
$check_pic = "users/$id/image01.jpg";
$default_pic = "users/0/image01.jpg";
if (file_exists($check_pic)){
$user_pic = "<img src=\"$check_pic\" width=\"175px\"/>";
} else {
$user_pic = "<img src=\"$default_pic\"/>";
}}
I know it's a little late and that you may have already figured out the answer to this question, but I was having the same issue and just figured it out.
Your SQL query is calling on a variable that has not been defined.
session_start();
include "include/z_db.php";
if ($_GET['id']){
$id = $_GET['id'];
} else if (isset($_SESSION['id'])) {
$id = $_SESSION['id'];
}
else {
print "important data to render this page is missing";
exit();
$sql = mysql_query("SELECT * FROM plus_signup WHERE id='$userid'");
while($row = mysql_fetch_array($sql)){
$userid = $row["userid"];
$name = $row["name"];
$location = $row["location"];
$sex = $row["sex"];
$aboutme = $row["aboutme"];
}
$check_pic = "users/$id/image01.jpg";
$default_pic = "users/0/image01.jpg";
if (file_exists($check_pic)){
$user_pic = "<img src=\"$check_pic\" width=\"175px\"/>";
} else {
$user_pic = "<img src=\"$default_pic\"/>";
}}
You are getting the 'id' from the url and storing it as $id. When you call your query, you are having it search for where ID = $userid when you really should be having it search for ID = $id.
Make sure that your variables are the same throughout!
^Hope that helps some people avoid an hour or two of frustration when trying to figure out why their function isn't working!

Resources