NetTalk Central

Author Topic: browse in form problem in insert  (Read 3315 times)

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
browse in form problem in insert
« on: September 29, 2010, 09:01:39 AM »
I have a browse of invoices in the customer update form. These show as expected. I used conditional filter on the browse when it is a child of CustomerUpdate.
The problem is adding an invoice for the customer. The Invoice form does not prime the inv:cusId from the customer record.
I checked the session queue values and when the form opens, all the values for the customer record are cleared!

This happens in the sample browse in form example when adding an invoice to a customer as well.

I don't understand why or how the session values for the customerrecord are being cleared. every other record remains unchanged.

I thnk I can work around it with some hidden fields in the browse or form, but if anyone knows a better (more correct template) way, I could use some help.

Thanks,
chris
Real programmers use copy con newapp.exe

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: browse in form problem in insert
« Reply #1 on: September 29, 2010, 03:23:41 PM »
Hi Chris,

I might not be understanding your problem but here I go...

When I do what you mention, I get the Session Value of the primary key on Customer File and do a fetch based on this value in the pre-insert embed. I then have the customer record in buffer and can prime what ever values I need from the file rather than the Session Q.

Kev

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: browse in form problem in insert
« Reply #2 on: October 01, 2010, 12:37:21 AM »
>> The problem is adding an invoice for the customer. The Invoice form does not prime the inv:cusId from the customer record.

um - no it doesn't do this automatically. The UpdateInvoice form has no idea you are calling it from the UpdateCustomer form (via the BrowseInvoice browse) and so doesn't prime it.

To prime the field, go to the Priming tab and set
Inv:CusId to
p_web.GetSessionValue('Cus:CusId')

If that doesn't work - have a look and see if Customer is a child table in the InvoiceBrowse procedure - perhaps it is getting overridden there.

Cheers
Bruce


Cheers
Bruce

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: browse in form problem in insert
« Reply #3 on: October 03, 2010, 06:11:19 AM »
Thanks Bruce and Kevin.

I was interrupting the customer entry to add the order in the order browse control while creating a new customer. At the Order entry, the customer record didn't exist yet.
So I now hide the Order browse during an insert and jump to the order entry when the save button is clicked.
In the order, do what Kevin does and grab the customer rec in the pre-insert.

chris
Real programmers use copy con newapp.exe