April 9, 200916 yr Hello again. Here's the deal...I have one form, user inputs order#, date, etc. Order# is passed to another form called OrderEditForm where you need to add customers. I have a button to go to CustomerTable...here's where the problem lies. Once I get to CustomerTable, if it is a repeat customer, how do I let the user select the Customer and pass that CustomerID back to the OrderEditForm (for population of that form), or if it is a new customer, add said customer to CustomerTable? I can't figure out how to make the CustomerTable selection pass from one layout to another. Is it one of those Get() functions or what? Thanks in advance. Edited April 9, 200916 yr by Guest
April 9, 200916 yr You can always use Set Variable [] After you go to the custom layout, you can have your user choose the customer that they want which in turn should set a variable with the CustomerID. Then go back to your Order layout and set the foreign key. If its a new customer, after creating the new customer, you can script it to do the same.
April 10, 200916 yr Author Yeah, that is what I want to do...but the problem is that I don't know where or how to script it. As I said, I can't figure out the where's and how's and such of the code. Edited April 10, 200916 yr by Guest
April 10, 200916 yr Author Is there anyone who can help me with writing that bit of code. That is exactly what I want to do, but I can't figure out the specifics. Thanks
April 10, 200916 yr Well it can be as easy as the following: The button on the customer record can have a script parameter of the CustomerID. Then the script that the button is attached to can be: Go to Layout [OrderEditForm] Set Field [ fkCustomerID; Get(ScriptParameter)]
April 10, 200916 yr Author I'm sorry but I am not catching that. Please bear in mind that I am new to FM and trying to figure out how to code the buttons. Can you be a little more specific with your explaination? Thanks
April 10, 200916 yr Make the script first. Next, when you are defining your button, in the dialog where you pick the step scripts, choose 'perform script'. It will then display a 'Specify' button. When you click that button, it will allow you to choose your script that you want to assign to the button, but also it will show you a box where you can type in an additional script parameter. Hit edit and then choose the CustomerID. I would suggest doing some of the online tutorials / videos to help you along.
Create an account or sign in to comment