Josh Ormond Posted December 5, 2008 Posted December 5, 2008 Here are two sample files for you to play with. The first one has the Options and Prices linked only to the Product (no relation between the Options and Prices). The second one has the Options related to the prices (which could be usefull if you need to correlate the prices with specific options). Create_Records_in_Portal_tables.zip
plh212 Posted December 8, 2008 Author Posted December 8, 2008 Thank you! Yes it does work beautifully... meaning the way I had intended to have mine working But, hopefully it will help me understand what I was doing wrong. I noticed something quite intriguing. When you delete the two layouts that have been created automatically when adding the portals you can no longer enter data in the options and price portals ! How are these two layouts related to the product layout you created? I can understand the effects of deleting fields and/or tables, but layout !!
Josh Ormond Posted December 8, 2008 Posted December 8, 2008 That is because the script uses the "Go to Layout" script step. Delete the layout, it doesn't know where to go. You can choose to have the layouts not show in the drop-down list of available layouts. Under Layouts / Layout Setup, un-check the option "Include in Layout Menu".
plh212 Posted December 15, 2008 Author Posted December 15, 2008 That is because the script uses the "Go to Layout" script step. Delete the layout, it doesn't know where to go. Indeed. Make sense! I brought them back and follow your advice for not listing them in the layout list. Thank you. I managed to wreck your example! I need to be able to enter the productID (unique, int(6)) and have added a Pause/Resume (indefinitely) to be able to fill the field and then resume the rest of the script by clicking onto "Continue" when my ProductID satisfy our requirement. Somehow after clicking onto Continue it does not copy the variable to the "ProductID" fields in the other tables and then just close the record without being able to enter the options or prices. Should I split my script after the pause to start a new script or am I wrongly using this Pause/Resume?
Josh Ormond Posted December 15, 2008 Posted December 15, 2008 Not sure why it wouldn't work. Did you use sample 1 or 2? I tried it, here is the script I used. It is updated for the script in sample 2: New Record/Request Pause/Resume Script [ Indefinitely ] Set Variable [ $ProductID; Value:Product::ProductID ] Commit Records/Requests [ Skip data entry validation ] Go to Layout [ “Option” (Option) ] New Record/Request Set Field [ Option::ProductID; $ProductID ] Set Variable [ $OptionID; Value:Option::OptionID ] Commit Records/Requests[ Skip data entry validation ] Go to Layout [ “Price” (Price) ] New Record/Request Set Field [ Price::OptionID; $OptionID ] Commit Records/Requests [ Skip data entry validation ] Go to Layout [ original layout ]
plh212 Posted December 15, 2008 Author Posted December 15, 2008 (edited) Maybe I changed something else that I don't see... but I haven't been able to make it work. I had set my Pause/Resume after the first "Set Variable". I don't know why this is not working. I am adding the sample files. 1228499706-Create_Records_in_Portal_tables-1_Folder.zip Edited December 15, 2008 by Guest
Josh Ormond Posted December 16, 2008 Posted December 16, 2008 Maybe I changed something else that I don't see... but I haven't been able to make it work. I had set my Pause/Resume after the first "Set Variable". If you pause the script to enter your product #, after it sets the variable, the script doesn't have the data to put into the field when you get to the Set Field step. Think of it as when filling out a paper form. You ask your spouse to remember a number for you (the variable), let's say a phone number 867-5309. When you come to the phone field, you ask "hey honey, what was that phone number?" That is the Set Field step. Move your pause script step before the Set Variable, like above in my example. Let me know where that gets you.
plh212 Posted December 26, 2008 Author Posted December 26, 2008 If you pause the script to enter your product #, after it sets the variable, the script doesn't have the data to put into the field when you get to the Set Field step. Yes. It does work if Ipause before. I am not sure i understand the complete logic behind it since I saw it as a pause and not a stop but it does definitely work doing it your way. You win :
Josh Ormond Posted December 28, 2008 Posted December 28, 2008 I am not sure i understand the complete logic behind it since I saw it as a pause and not a stop but it does definitely work doing it your way. If you want to know, the "Pause" tells the script to hold on a second, while you give it some more info. In this case, "hold on, this is the product id I want you to use in the rest of the script". Make sense? I am not always good at explain things so they make sense. Guess my brain views things differently (they'll probably lock me up some day ) You win Well, if your db is working the way you want, we all win. Right?!
Recommended Posts
This topic is 5811 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 accountSign in
Already have an account? Sign in here.
Sign In Now