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

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

Recommended Posts

Posted

Hello,

This has got to be simple, and I'm embarassed to ask this; but can't figure this out.

I want to create a script to create a new portal row/record.

I've tried Go to Object ; but that seems to just go the portal field that I named. From there I tried Create New Record, but that just creates a new Record in the contextual table.

Please any help will be much appreciated.

Thank you

Posted

I believe it's best to place the current parent's ID in a variable, go to a layout of the child table, create a new record and set its foreign key field with the variable.

From where will come the rest of the data for this record - assuming you don't want to create just an empty record?

  • Like 1
Posted

Comment,

Thank you for your reply. I have considered that route; however, for my users because they are looking at populating an Estimate or Invoice, with several EstimateLines; I wanted to find a way that they are working from the actual Estimate/Invoice layout, as they will probably add several lines.

The data will be inputted following the methods (a "Select Window") described by Fenton in this post (a post which I think you might have recommended to others).

http://fmforums.com/...ment-something/

I will experiment with creating a simiar Estimate/Invoice layout but in the context of the EstimateLine table.

Or perhaps experiment with a script that will do all that work underneath...?

Thank you again. If you have any other thoughts, please let me know.

Posted

I have successfully got the script to get the various variables, back and forth between the Estimate and EstimateLine layouts, populating the fields they should be populating.

I think I'm going to go ahead with this unless anyone can warn me of something I don't know!

Posted

If I understand correctly, your script needs to:

1. Get the parent EstimateID into a variable;

2. Present the user a choice of items (in another window, if you prefer);

3. Get the selected ItemID into another variable;

4. Go to a layout of LineItems, create a new record and populate the two foreign key fields with the variables.

  • 1 year later...
Posted

I want to create a script to create a new portal row/record.

I've tried Go to Object ; but that seems to just go the portal field that I named. From there I tried Create New Record, but that just creates a new Record in the contextual table.

 

I know this thread's a bit old now, but it may help others as I know it took a while for me to get this as I wanted  :yep: 

 

That was the right start… name your portal and use :

Go To Object ["MyPortalName"]

Then…

Go To Portal Row [Last] making sure that "allow creation of records" is checked in your relationship description.

You can then :

Set Field["MyPortalField"], and the record will be created.

You only need to show one portal row, if that suits you BUT

… make sure that "Show vertical scroll bar" is checked in your portal options, or else it doesn't work properly.

 That last "gotcha" took me ages to pin down  :hmm:

  • Like 1
  • 2 years later...
Posted

Fred -- Thank you for the hint on "Show vertical scroll bar" -- solved a problem I was working on for hours!!

  • 2 years later...
Posted

In the inspector.  The first tab "positions" tab.

This topic is 2023 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.