Jump to content

2 Portals 1 destination (LineItem.fp5)


Leb i Sol

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

Recommended Posts

Hello People!

Here is antoher Q that has been more than bothering me....so if anyone can help/advise it will be great and perhaps you extend mylife for a few days grin.gif

I have 2 portals that lead to LineItem file but I am getting 'duplicats' generated in the 1st if data entered into portal2 is associated with it. Now, this does make sense since they booth lead into same file....my question is:

Is there a way arround this and way of recording " 1->many " entries?

I am also attaching a screenshot for better understanding of the problem!

Thank you all!

2portals.jpg

Link to comment
Share on other sites

Hi Ugo!

Yes I do have the realtionship set to "allow" and is:

ITEMS_LINEITEMS WS_ID =::WS_ID

"is it that the 2 portals are not using the same "line" in the line item ? "

how would I "make sure" that they are?wouldn't the relationship take care of this?

thanx_

Link to comment
Share on other sites

follow up:

Also, if u notice 1st portal has "Activity" field that that accept 'many' entries but unfortunately I can not join these portals into 1 and use check boxes for Porduct/Materials since there are many of them....drop-list with multiple selections doesn't work either....

thank you!

Link to comment
Share on other sites

Hi,

Working with Checkbox in a portal is a tough setting.

How do I make sure ? Use a line Id (auto entered serial) in the Line Item and drop it in the portal.

Now, if really you need the 2 portals, you should look for a way to "fix" the row you're browsing, and set only one portal to create related records.

If you want your checkboxes to create one related record per checkbox checked, just forget about the checkbox stuff and enter a new portal row for each choice.

Link to comment
Share on other sites

Hello hello!

"How do I make sure ? Use a line Id (auto entered serial) in the Line Item and drop it in the portal."

-it is one line_ID

"Now, if really you need the 2 portals, you should look for a way to "fix" the row you're browsing, and set only one portal to create related records."

- I don't really care 1 or 2....2 was a nicer design...but I don't mind using 1 portal it is just that I am back to the same problem which is how to enter multiple selections for the Products/Materials Used by 1 Worker (record)! confused.gif

I don't know this sounds as a strange approach but I really need this to function otherwise Report:"How many products used by a worker?" will never be possible....

Thank you for the help!

Link to comment
Share on other sites

Hi Leb, (and hi Ugo)

Why do you have the activities of a worker and the products that the worker uses in 1 lineitemsfile?

The layout that you posted looks like a project card to me, and makes me expect that you would have at least a projects-file, a workersfile, an activity-logging-file and a materials-used-file.

Then each portal would point to a different file. An how much materials a certain worker used could be detemined (for example) from the workers file.

Hope this helps,

Regards,

Ernst.

Link to comment
Share on other sites

Hello Ernest!

Ur abs. right I do have: Items(projects per Item they work on), Workers,Materials(products used) and LineItem.

The reason I used 1 lineitem file is for 'simplicity' and also faster reporting.

But I am opend to suggestions smile.gif , I didn't want to use Workers file to add what materials they used since it would beat the purpose of trying to normalise and minimize database.

Workers file will then grow beyond controll since ativities happen daily...and they might use 5-10 product per Item they work on...and they might work on many items in a day...soooo..that is kind of why I am at this point. I am doing this all wrong?

thanx_

Link to comment
Share on other sites

Hi Zila,

So you have many workers working on many items with many materials and you want to keep track of who worked on product 1 and what machine or devices they used for it.

Is there anyway a product could be associated with the machines. Then entering the Product would auto-fill the machines to be used.

If not, I think the whole stuff could be scripted rather than having a portal set to "Allow creation of related records". Now it's up to you to use another key to group the machines within the line item file to a product.

It surely depends upon the specific need of the reporting.

Link to comment
Share on other sites

Hey Ugo!

I have figured it out...easy and dirty way out laugh.gif

I created antoher LineItemCont.fp5 file and used lookups and all, so now I can "bottom portal" connect to mentioned file and only enter the materials aspect of it.

so LineItemCont.fp5 grabbs WS_ID, Item_ID,Worker_ID,Workers Name, Prod_ID, Product Name, Qty Used. Works great...I just didn't want to have another LineItem file but when I thought about Ernest suggestion and your comnbined I figured that it might even be better to have 2 LineItems ...for the reson I mentioned before....(size etc.)

So, now, the challenge will be running a "Hierarchical Rports" and creating a sub-summaries

eg.

Item_ID(7)------------------------------

........Worker_ID(1)

,,,,,,,,,,,,,,,,,,,,,Prod_ID(344)

,,,,,,,,,,,,,,,,,,,,,Prod_ID(223)

,,,,,,,,,,,,,,,,,,,,,Prod_ID(11)

........Worker_ID(2)

,,,,,,,,,,,,,,,,,,,,,Prod_ID(334)

,,,,,,,,,,,,,,,,,,,,,Prod_ID(221)

,,,,,,,,,,,,,,,,,,,,,Prod_ID(25)

------------------------------------

"I can see the light laugh.gif , I just hope I don't go blind"

Thank you all!

Link to comment
Share on other sites

Followup:

Ugo>

"Is there anyway a product could be associated with the machines. Then entering the Product would auto-fill the machines to be used."

this would begreat but I don't have that associations sice some materials are combined together and then used on the product...any combo can happen. eg.

Mixed :

-Yello & Blue Paint today but due to "items damage" this mix of clors might be changed for the very same Item but in a worse shape.

The "Items" in this case are antiques (furniture) that make this use of materials eunique depending on each case.....so....

Anay, it seemed that another LineItem was the fastes and the easier solution without disrupting other files or increasing their size and make duplicate records.

so far so good....

Link to comment
Share on other sites

Well, I didn't really recommanded the second line items.

When it comes to list parts from products into a single line item file (which is very close to what you're performing), you would rather assign a new ID (Universal) and link the parts to the Main ID.

You would have to deal with a second ID in the Line Item :

- The foreign ID (your Item_IId) for your classic relationship to view the related Items

- The Universal ID to see the related Items and the relevant Products asociated.

This way, you still have one single line item, and you can make any subsummary either by the Foreign Key or the Universal ID.

But this kind of setting is necessarily scripted...

Link to comment
Share on other sites

ok sounds like we are going "deeper in for one more level" when it comes to IDs.

....so Universal ID would have to bee added to Materials/Products file as well as related? so I would have woudble relationship (that standard WS_ID =::WS_ID)

AND Universal_ID=::Universal_ID....right?

"But this kind of setting is necessarily scripted..."

ur starting to scare me smile.gif.... u mean reports need to be scripted or the relationship

thank you !!!

Link to comment
Share on other sites

In fact,

Supposing you have Item 1 entered in the Portal and pushed to the line ite by your current portal setting through a classic Item_Id::Item_Id relationship.

Supposing now that you want Product 5, 8, 11, and 12 to be entered also in the line item.

You would script these entries.

The script would :

1. go to the related record in your line item using the Item_Id::Item_Id

relationship

2. populate a new "ItemLink_Id" with the value of your Item_Id field within the same line

3. create as many record in the line item as the number of Product_Ids to be entered

4. Populate each "ItemLink" for those new records with the value of the FIRST "Item_Id".

The Item_Id is entered once, so there is only one relationship from the portal to the Item_Id

But the "Item_Id Link" is entered for all related records of this "Item_Id", creating a relationship from the Item_Id to the "ItemLink", and therefore linking the Products_Ids selected in the portal (and entered by script) to be related to the Item_Id.

When it comes to a report, your subsummary part would use the "ItemLink" field.

Is that clear ?

Link to comment
Share on other sites

"Is that clear ? "

No SIR smile.gif

"2. populate a new "ItemLink_Id" with the value of your Item_Id field within the same line"

so I would have duplicates ? Item_ID = abc-1234 and = ItemLink_ID :?

3. create as many records in the line item as the number of Product_Ids to be entered

using the same LineID?-this is auto-serial can't make "as many records as Product_IDs entered!?

thank you!

Link to comment
Share on other sites

Sorry for that Zilla,

Have you tried your second line item to see if it can work ?

Now for my suggestion, let say that this setting isn't intuitive and need some experimentation before you can make it work.

The challenge here is to hold 2 separate keys in a same line item.

- the Main one that is the "natural" key for a relationship to the Main(s) file(s) would be your Item_Id, entered through a portal as you are currently doing.

- the Second one, the "ItemLink" would be used to enter, identify and list each machine. In order to group the machines (and workers) by the Item_Id, the "ItemLink" field would be populated by the exact value of the selected Item_Id.

Your Line Item may look like :

Line_Id : 1

Item_Id : Item502

Item description : XVIIIth Century Silk Chair

Worker_Id : Work210

Worker_Name : Zilla

Machine_Id :

Item_Link : Item502

Line_Id : 2

Item_Id :

Item description :

Worker_Id : Work210

Worker_Name : Zilla

Machine_Id : Machine#1

Item_Link : Item502

Line_Id : 3

Item_Id :

Item description :

Worker_Id : Work210

Worker_Name : Zilla

Machine_Id : Machine#7

Item_Link : Item502

Line_Id : 4

Item_Id :

Item description :

Worker_Id : Work210

Worker_Name : Zilla

Machine_Id : Machine#5

Item_Link : Item502

As you can see from the example, while the "ItemLink" field would be populated for each Item and its components, the Item_Id field will only be populated once for the first record (Item) entered through the portal.

Using a combination of these Ids, you'd be able to have either :

- a list of workers in your portal in Main File using the Item_Id::Item_Id

- a list of workers and machines using the Item_Id::ItemLink relationship.

As all fields are now in the line item, you can create your sub-summary report as you wish, using the "ItemLink" instead of the "Item_Id"

Of course, the tough part would be the script setting. Basically, if you keep your actual design, you'll need a script that would loop inside the value list and extract each Machine_Id, one at a time. There are some good examples and demos for this on the Forum

The script would though be triggered from the portal row.

Link to comment
Share on other sites

Hi Ugo!

Thank you for this post...I t tried to use 2nd LineItem file and it does work but , as you know, I had some trouble with creating reports prior to this issue. I have not tried 2dn LineItem with 'working' summary but as far as creating records is conecered the concept works. The down side was having to deal with another file....

I will let you know how it goes with this post in mind.

Thank you for all the great help!

Link to comment
Share on other sites

Update:

2nd LineItem file and it does work but sub-sub-summary does not summarise by ItemID...it simply pulls it from related (new lineitem_2 file) and grabbs only -related- one record. To fake this "loop" portal can be used but when it comes to reporting,as u know, dynamics of portal are not predictable (how many rows visible..how many printable etc.)

So I guess we are back to the scripting idea.....since I am not good with scripts this will be postponed until next week.

Thanx_

Link to comment
Share on other sites

...hmm...I was just wondering...

do problems go away if they are ignored?

...I have been trying really hard "the ignoring part" but no luck yet

anyone that can help? ):-x-:

Link to comment
Share on other sites

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