scough
20th April 2011, 18:05
I am working with 4GL code in constraints and I am wondering if there is a way to determine the id of the product variant that is created in the tipcf500 when you choose to "Define product options immediately".

I am attempting to map custom messages (to be read by engineering later) to the product features based on what the user enters in the product feature field. In my mapping table I need to enter the product variant ID.

I have had some thoughts on possible ways to accomplish this but they don't feel solid. For example, I thought of selecting the max id from the tipcf500 table but something about that tells me I am going to run into potential anomalies should two or more different users attempt to configure product variants at the same time.

Are there any built in functions or variables that I can call to get the newly created product variant ID?

Thanks

EdHubbard
20th April 2011, 21:50
If you are already in the configurator then the variant number imported as below is the current one.

So in the before input constraint of a feature you can enter:

!table ttipcf500
!import("tipcf500.cpva", tipcf500.cpva)

Then you can do whatever you need to with tipcf500.cpva variable either inside the constraint logic or calling a dll and do it using that.

Ed

scough
20th April 2011, 23:24
Once again Ed, thank you for your help!

It's really appreciated.

Tomas Toth
7th August 2012, 08:47
Does it normally work in the session "tipcf5120s000" when run from "tdsls4102s000" ??

I tried to see the Customer code in the order configurator, using the syntax in the constraint in before input:

input = false
!table ttipcf500
!import ("tipcf500.cuno", cuno)

but the field ends empty...
could you please advice ??

EdHubbard
7th August 2012, 11:04
It works ok for me... although we tend to use a dll for most configurator functions.

so I guess the next line of your code is something like:

[custnum] = cuno

My ideas:
1. Change !import ("tipcf500.cuno", cuno) to !import ("tipcf500.cuno", tipcf500.cuno)

and [custnum] = cuno to [custnum] = tipcf500.cuno

or
2.

add a declaration for tccom010 at the top of your before input constraint

!table ttccom010

and then:
select tccom010.cuno,
tccom010.nama,
tccom010.ccty,
tccom010.ccur,
tccom010.cbrn,
tccom010.crat
from tccom010
where tccom010._index1 = {:tipcf500.cuno}
as set with 1 rows
selectdo
endselect

you probably need to put exclamation marks in front of those lines.

[custnum] = tccom010.cuno

Tomas Toth
7th August 2012, 11:32
perfect, the 1st one was the right one...;)
thanks a lot.
I like it so much ;)

Tomas Toth
21st March 2013, 09:52
Hello again
Does anyone can advice how do I import the data about the Forw.agent from table "tdsls040" into the product feature in the Configurator ??