Jump to content

Calculation, portals & ipad layout


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

Recommended Posts

Hello,

I've encountered a problem that I need assistance resolving. Background info: using FM starter invoice solution both on the desktop FM and FM Go for the ipad.

I have the invoice details set up so that whatever is entered into the "item" field on the first line item of the portal is copied over to another field ("summary") by means of a script (go to portal row (first), set field). The issue arises when an invoice is created on the invoice detail on the Ipad- this layout only shows the most recent line item entered on the display no matter how many line items have been entered i.e. if I enter a "1" into the "item" field on the first row of the portal line - the  "summary" field where the data is copied to also reflects a "1". When another line item is created and for illustrative purposes, a "2" is entered the "item" field, the "summary" field now displays a "2" as well... not my desire- still wish this field to reflect the original "1". What needs to be done to my simple script to accommodate this desired effect? I'm potentially thinking some sort of an if statement combined with "a get active portal row" might somehow work (or make use of a list function?). Any guidance would be appreciated.

TIA.

Jack

cc: Lee/mods, if required, feel free to move this post to a more appropriate location

Link to comment
Share on other sites

13 minutes ago, skingjack2 said:

What needs to be done to my simple script to accommodate this desired effect?

Well, you probably want the script to check if the target field is empty, and proceed only if it is. Hard to be sure with so little detail - we don't even know in which table the target field is.

However, I would seriously question the need for this entire exercise. It should never be necessary to duplicate data. What is the real purpose you are trying to achieve here? Surely there must be a better way.

Link to comment
Share on other sites

Hello Comment,

This an interim measure that I am hoping to implement quickly until i can migrate some more tables etc. from my original file into a new version (iphone/Ipad compatible). Once I recreate the other tables from the original file into the new version, a calculation will replace this temporary script & generate the required information that would go into the "summary" field. FYI, the target field "summary" is in the same table and on the same layout (invoice details).

Thanks for pointing out the idea to check to see if the target field is empty- trying something along the lines per the attachment below but no success yet. Still experimenting. Would a case function
 potentially work as well?

Jack

 

P.S.  info in the summary field is unique and never duplicated;

Screen Shot 2015-12-10 at 8.00.01 PM.png

Link to comment
Share on other sites

1 hour ago, skingjack2 said:

This an interim measure

I still don't see the purpose of this measure - and this makes it difficult for me to suggest how to make it work, since I am not sure what it's supposed to accomplish.

If you want it to work only when the first child record is created, then you should only need:

If [ IsEmpty ( Invoices::Summary ) ]
 Set Field [ Invoices::Summary ; Invoice Data::Item ]
End If

Or perhaps - to make it work when the first child is created or modified:

If [ Get(ActivePortalRowNumber) = 1 ]
 Set Field [ Invoices::Summary ; Invoice Data::Item ]
End If

But everything I know screams "wrong" at this. You should not need this. If you do, you're doing something wrong - and you should fix that instead.

  • Like 1
Link to comment
Share on other sites

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