Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6592 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I've been converting a file from 6 to 8 and I've run into a snag when I run a script. The script allows me to add a new product to a Line Items portal on my Invoice layout. The dialog is,

"This product description cannot be modified. Only the “Miscellaneous” product can have a custom description. Please check the Revert Field button to continue."

I’ve been told that it looks like either a “Dialog from a script” or “Custom field validation message”. But I’ve been unable to find that in either place. Here are the actual scripts for your review. The first script is the button I click on in the Line Item portal to add a new record.

“Create New Line Item Record”

If [ Get(WindowMode) = 1 ]

Perform Script [ “beep_beep_not_in_find_mode_message” ]

Exit Script [ ]

End If

#This script creates a new record in the line items file based upon the product selected from the "Add Prod" section.

Set Error Capture [ On ]

Allow User Abort [ Off ]

Enter Browse Mode

Set Field [ Inv_line_items | constant::g_temp_inv_id; Invoices::OrderNbr ]

Set Field [ Inv_line_items | constant::g_temp_prod_id; Products | g_product_category::ItemNbr ]

Set Field [ Inv_line_items | constant::g_concatenated_key; Invoices::OrderNbr & "-" & Products | g_product_category::ItemNbr ] Perform Script [ “create_new_line_item_record_from_invoices” ] Select Window [ Current Window ]

#These 3 lines put the user in the quantity field of the newly created record in the Line Items portal. So you go to a field in the line items portal, go to the last row of the portal, and then go to the quantity field.

Go to Field [ Inv_line_items | inv_id::CasesOrdered ]

Go to Portal Row [ Select; Last ]

Go to Field [ Inv_line_items | inv_id::CasesOrdered ]

Create New Line Item Record From Invoices

Go to Layout [ “line Items” (Line_Items) ]

Enter Browse Mode

#Count the number of times that the combination of this invoice ID and product ID exist in this file. If the count is greater than 0 then tell the user that this product ID already exists on this invoice, and do they really want to create another?

If [ Count(Inv_line_items | g_concatenated_key::c_concatenated_key) > 0 ] Beep

Beep

Show Custom Dialog [ Title: "Message"; Message: "This Product ID already exists on this invoice. Do you wish to add another?"; Buttons: “No”, “Yes” ]

If [ Get(LastMessageChoice) = 1 ]

Perform Script [ “halt_script” ]

Select Window [ Current Window ]

End If

End If

New Record/Request

Set Field [ Line_Items::fk_inv_id; Line_Items::g_temp_inv_id ]

Set Field [ Line_Items::fk_prod_id; Line_Items::g_temp_prod_id ]

Beep Beep Not In Find Mode Message

Beep

Beep

Show Custom Dialog [ Title: "Message"; Message: "You are currently in the Find Mode, and must be in the Browse Mode to use this button."; Buttons: “OK” ]

Halt Script

Enter Browse Mode

Commit Records/Requests

Halt Script

Do you see anything that sticks out as a problem?

Thanks for your help,

Milo

Posted

If you are seeing a "Revert" option, then the message is likely being generated by field validation.

I would start by going through the fields in the line items table to see which ones are being validated.

Posted

Hi Matt,

You were right and I found where it was this time. Ender told me earlier this is where it had to be but I was unable to find it.

Although I found it and fixed it, I still get the Revert dialog. I thought if I posted the the validation calc maybe you could tell me where to look for the problem. The field is in the Line Items table and the field name is "ProductDesc".

If(fk_prod_id = "Misc"; 1; ProductDesc = Products::ProductDescLong)

I'm new to FileMaker and someone else designed it so any help you could give me would be appreciated. Let me know if you need more information.

Milo

This topic is 6592 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.