cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Change an attribute if change other

DaniloCalzavara
1-Visitor

Change an attribute if change other

Hi.


I have an attribute called Customer_Version, that I have to change if the version of my document change.


e.g. My company has a version scheme like A, B, C, ... and my customer has a different version scheme, like 1, 2, 3, ... I want that if I revise my document and it goes to version B, the attribute Customer_Version has to change too, to version 2. And so on.


How can I do this?


Thanks

4 REPLIES 4

In Windchill 10 I noted that there is an attribute type called "calculated" maybe that's the simplest way to do what you want to do? Note I have not tried this out myself though.

Another option might be to add a listener for when the object gets stored (the PRE_STORE event, I think it's called) and in the listener event handler add code to calculate and store the customer_version. That option is also available in versions prior to 10. Search for "listener" in the customizers guide to find an example of this approach.

Calculated attribute type (new for 10) is like a Sum column in a spreadsheet - it performs a calculation on existing other attribute value(s). Can also be string functions as far as I know.

So - Primary example: Calculate difference between Date1 and Date2.

Other example that may be possible: Calculate Customer_Version based on Version (using a lookup table possibly).

Hi guys...

Thanks for reply.

I thought about use calculated attribute. But is that possible use conditional comands within it?

Like, if the version attribute value is A, Customer_Version attribute value be 1, and so on.

version customer_version

A ---> 1

B ---> 2

C ---> 3

Thanks

Danilo,

Did you find a method to do this?

I want to do similar: IF ATTR-A=1, then ATTR-B list is 1-1,1-2,1-3, but if ATTR-A=2, then ATTR-B=2-1,2-2,2-3.

Announcements


Top Tags