Here's what I'm working with...
$FindInvoiceRecord = $FMInvoices->newFindCommand('Data Entry (XGA)');
$FindInvoiceRecord->addFindCriterion('InvoiceNumber', $InvoiceNumber);
$FindInvoiceRecord->setScript('wa_CommitRecord');
$FindInvoiceRecordResult = $FindInvoiceRecord->execute();
$FoundRecords = $FindInvoiceRecordResult->getRecords();
$FMInvoiceRecordID = $FoundRecords[0]->getField('zRecordID');
$OriginalInvoiceNotes = $FoundRecords[0]->getField('InternalNotes');
This works fine and loads my data as expected from the FileMaker record. Then I'm trying to update the record...
$InvoiceUpdateData = array('InternalNotes' => $NewInvoiceNotes);
$InvoiceUpdateRecord = $FoundRecords[0]->newEditCommand('Data Entry (XGA)', $FMInvoiceRecordID, $InvoiceUpdateData);
$InvoiceUpdateRecordResult = $InvoiceUpdateRecord->execute();
But this is telling me that newEditCommand() method is not found..?? Any information on what I'm doing wrong here would be greatly appreciated. Thanks!
The newEditCommand is a method in the record object, not the result object.
Try this:
$InvoiceUpdateRecord = $FMInvoices->newEditCommand('Data Entry (XGA)', $FMInvoiceRecordID, $InvoiceUpdateData);
Related
The following code is giving the above error, and I cannot figure out why:
var x = _sqlConn.Connection().QueryResults<Results>("MyDb.dbo.get_records", new { id = theId });
int retVal = x.Outputs.Return_Value;
if (retVal == 0) // ...meaning result set was also returned...fine to this point.
{
var list = x.Outputs.Set1; // exception thrown here with above error
var temp = list.FirstOrDefault();
I have been using other features of Insight.Database for a number of years, but have not had to retrieve a SQL RETURN value at the same time as a recordset. The SQL itself works correctly in SSMS, returning a result set and the RETURN value of 0, as expected. This is happening in VS2019, .NET 4 and .NET 4.5.2; Insight.Database 5.2.7 and 5.2.8.
I got this code from the following page:
https://github.com/jonwagner/Insight.Database/wiki/Specifying-Result-Structures
where it shows this:
var results = connection.QueryResults<Beer, Glass>("GetAllBeersAndAllGlasses");
IList<Beer> beers = results.Set1;
which I combined with the following code from here:
https://github.com/jonwagner/Insight.Database/wiki/Output-Parameters
var results = connection.QueryResults<Results>("MyProc", inputParameters);
var p = results.Outputs.p;
That part works. It's accessing .Set1 that is failing, and I am not sure how to track down why.
I do not have experience with the FastExpando class, but Jon promised magic, and I want to believe. Thanks for any help.
I haven’t tried results+dynamic objects in a while…
I think it is because you are doing:
QueryResults<Results> and Results is an Insight type
You probably want:
QueryResults<MyType>
And then you get back a Results<MyType>
Which contains the return val and Set1
If not, post a ticket over on github and we will help you out.
I know there are similar questions out there, but this one is a little different (I think).
I used the MATLAB Compiler to convert a .m to an Excel add-in. When I run the add-in on my machine, it works just fine. When I send it to a colleague, they get the "ActiveX component can't create object" error. They have added the add-in no problem.
Is there something going on here that's easily fixed?
MATLAB code:
function mess = createAndRouteOrderWithStyle()
c = startbbrg();
[num,text] = exportToM();
s = emsx('//blp/emapisvc_beta');
order.EMSX_ORDER_TYPE = text(1);
order.EMSX_SIDE = text(2);
order.EMSX_TICKER = text(3);
order.EMSX_AMOUNT = int32(num(1));
%order.EMSX_LIMIT_PRICE = num(2);
order.EMSX_BROKER = text(4);
order.EMSX_HAND_INSTRUCTION = text(5);
order.EMSX_TIF = text(6);
events = createOrderAndRoute(s,order);
mess = events.ERROR_MESSAGE;
close(s);
end
Excel VBA code:
Sub GO()
Cells(10,10).Formula = "=createAndRouteOrderWithStyle()"
End Sub
I am trying to write a simple Java program that reads from JBossMQ's jms_messages table using JDBC. I am using JBoss 4.0.4.GA.
I can get the as far as getting a SpyMessage, but how can I get the actual message content (which is an Object in the particular case I'm looking at).
I have a result set "rs" from this statement:
SELECT messageid, messageblob FROM jms_messages WHERE DESTINATION LIKE 'TOPIC.MyTopic%' limit 3"
and then I do this (based on JBoss code):
long messageid = rs.getLong(1);
SpyMessage message = null;
byte[] st = rs.getBytes(2);
ByteArrayInputStream baip = new ByteArrayInputStream(st);
ObjectInputStream ois = new ObjectInputStream(baip);
message = SpyMessage.readMessage(ois);
message.header.messageId = messageid;
String jmstype = message.getJMSType();
String jms_message_id = message.getJMSMessageID();
System.out.println("jmstype=" +jmstype);
System.out.println("jms_message_id=" +jms_message_id);
String propertyName;
Enumeration e = message.getPropertyNames();
while (e.hasMoreElements())
{
propertyName = (String)e.nextElement();
System.out.println("property name = " +propertyName);
}
but I get no properties printed and I don't know how to get my actual object from the SpyMessage (actually a SpyObjectMessage). I'd be grateful for any pointers.
I've tried asking this question on the JBoss forum without reply, so I'm hoping for better luck here.
Thanks.
Sorry - the answer was so obvious I'm not really sure what I was thinking when I posted the question - simply:
Object objMessage = ((SpyObjectMessage)message).getObject();
so all I actually want to do is something like
plugin.tx_felogin_pi1.redirectPageLogin = page:id
where the page:id is the PID of the current page. replacing 'page:id' with a number works as expected BUT I do need the PID instead of a fixed number. any hints are welcome
redirectPageLogin has to be a single int value:
$redirect_url[] = $this->pi_getPageLink(intval($this->conf['redirectPageLogin']));
Alternative: use as $redirMethod: getpost or referer
I think that'll fit four you.
Try
plugin.tx_felogin_pi1.redirectPageLogin = TSFE:id
or
plugin.tx_felogin_pi1.redirectPageLogin = {TSFE:id}
or
plugin.tx_felogin_pi1.redirectPageLogin.cObject = TEXT
plugin.tx_felogin_pi1.redirectPageLogin.cObject.insertData = 1
plugin.tx_felogin_pi1.redirectPageLogin.cObject.value = {TSFE:id}
I have place model & entry model that entry is parent
everything is fine but how can I delete the result row $categoryPlacements
in place model:
$entryModel = new Model_EntryModel();
$entryRow = $entryModel->find ( $entryId )->current ();
$categoryPlacements = $entryRow->findDependentRowset($this);
in this case i want to delete the $categoryPlacements result in place model
I can use categoryPlacements->toarray() and then delete but is another easy way?
Foering Keys at the database could solve this issue.
$categoryPlacements = $entryRow->findDependentRowset($this);
foreach ($categoryPlacements as $placement){
$where = $db->getAdapter()->quoteInto('id = ?',$placement->id);
$db->delete($where);
}
Sorry if this is not what you need, regard´s.