Hi,
I have a problem in one of my solutions, that I cannot figure out. Therefor, some basic questions, to see if I’m approaching the issue correctly:
1 - If you have three forms based on the same table and one of these forms has an OnRecordSelection event, should that event only be triggered when a record is selected through that specific form?
2- same scenario as 1, but now in scripting: Should a search done like the code below trigger the OnRecordselection event, if the form receipt is based on the table receipt, but is NOT the form with the OnRecordSelection event?
forms.receipts.controller.find();
forms.receipts.receiptid = globals.ID1_ID;
forms.receipts.controller.search( true , false );
3 -The form I’m on is based on the table Customer, which has a relation to the ReceiptInvoice table and I’m showing the content of the related foundset of the ReceiptInvoice table in a portal. In the portal there is a button on each row (=record) triggering a method. Part of the method is the code below:
customer_to_receipt_invoice.status = ‘Reversed’
//point 1
if ( customer_to_receipt_invoice.r_i_type == ‘Receipt to Invoice’ )
{
forms.receipts.controller.find();
forms.receipts.receiptid = customer_to_receipt_invoice.id1;
forms.receipts.controller.search( true , false );
//point 2
forms.receipts.amountleft = forms.receipts.amountleft + customer_to_receipt_invoice.amount;
Now, if I output the PK ID of the ReceiptInvoice record on which I clicked the button in the portal at Point 1, I get the correct ID back, according to the logic I created. But if I request the PK ID of (to me still the same record) at point 2, I either get a completely different ID or some sort of Java message…
I would think my Find & Search on the forms.receipts should not affect the “customer_to_receipt_invoice”-relation. But judging from what happens, it does… Or am I doing something wrong???
Paul