raviraj - Saturday, February 5, 2011 9:11 AM:
Hello All
I have a Items of Part in it i have define sequence for part number. when i export all data for parts , xml writes it well in package , but when i Import it its Part Number Property (having data source Sequence Number) changes...
what i have to do...
i have a solution while Importing i can replace its data source (sequence) by string but it is not a proper Solution will anybody help
Thanking You
Raviraj
Brian - Sunday, February 6, 2011 7:12 AM:
Hi Raviraj,
<Item type="Part" action="add" serverEvents="0" >
This should turn off the server events, which should include the call for the sequence to update. Not sure as I haven't tested it.
If that doesn't work then you will have to go into the "Part" Item type and not specify Sequence when you are doing imports then change it back for normal part number creation. If this happens a lot then you will want to write a Server Method to update the Part Number for you (in the onBeforeAdd/onBeforeUpdate methods) to create the sequence for you. Then when you do the imports you can either check if it is an import by adding an attribute/property to the AML or by turning the Server Events off as above.
See how you go.
Cheers,
Brian.
raviraj - Monday, February 7, 2011 3:19 AM:
Thank You Pye
It Works Successfully but there is new Problem again, i f i Import parts its Created date and Modified Date Changes
also it Sets the Default Modified by "Innovator Admin" and Life cycle state to its "Preliminary" state of life cycle
and we cant change the datasource of "Created by" and "Modified By" because these are system Properties
so what to do in these cases...?
Thanking You
Raviraj
Brian - Sunday, February 13, 2011 6:42 AM:
Hi Raviraj,
Are you updating (editing) these parts or are you adding them to a new database?
You can't change the created_on or created_by_id under normal circumstances.
If you really need the dates to be earlier than the day you "add" the items by uploading you may need to write an "onAdd" method to replace the default Innovator behaviour. This is not something that I would recommend since you don't know exactly what goes on when Innovator adds a new Part Record and you could end up breaking something without realising it.
You might (if it is really important) try changing the data Directly in the SQL Server Database but again this is not a recommended path unless you know what you are doing.
If you are editing properties of the Parts and want to update them then you need to be doing an "edit" not "add" through something like the Nash script.
Hope this helps.
Brian.
raviraj - Wednesday, February 16, 2011 2:57 AM:
Thank you Brian for Your reply
i got that we cant change created_on and modified_on dates but we can Update it directly in database... but will it affect anyway.....?
and I m transferring my whole data from one database to new database but now i want that data with its History too. Because in PLM History matters... anyway i need it for that. which Itemtypes (or any other realated data) do i have to Import it with data .....?
Help
Thanking You.
Raviraj.
SamsAn - Thursday, February 17, 2011 2:50 PM:
Hi.
You can change created_on and modified_on through direct SQL queries only. However, it's pretty easy to automate without onAdd special behavior. So,
1. In input pattern AML of BatchLoader tool setup "fake" properties like
"<fake_created_on>@Value</fake_created_on>", "<fake_modified_on>@Value</fake_modified_on>"
2. Develop new C# server-side method and assign it in OnBeforeAdd server event for the appropriate ItemType(s). The method should read the faked properties and store them in the session.
3. Develop new C# server-side method and assign it in OnAfterAdd server
event for the appropriate ItemType(s). The method should read the faked properties from the session, generate update statement and then execute direct updates like myinnovator.applySQL(updateStatement).
Innovator History is stored in History Container and History ItemTypes.
SamsAn.