PLM 360 IdeaStation
Share your wish list directly with the Autodesk PLM 360 Development Team
New Idea
6 Kudos
DonovanJr

Scripting Access BOM & Sourcing Tab

Status: Duplicate
by Active Contributor DonovanJr on ‎12-03-2012 11:37 AM

We need access via the Server Side Sripting to both the BOM Tab & Sourcing Tab.

 

I believe there are several support threads as well as Ideastation references to this functionality but I felt we needed a clear Idea Post for this functionality.

 

Similar to the new object record item.workflowitems recently added we need to have information contained in the BOM & Sourcing tabs for use in scripting.

 

An example would be having an assembly shown on an Sakes Quote Grid and a workflow that would explode the BOM children of that assembly into the grid of an RFQ and access the default supplier to create a master RFQ for cloning quoting purposes.

 

Ideally this would be read/write access for back feed updating of costing etc.

 

Status: Duplicate

 

BOM Final implementation:

RELATED and QUANTITY are required, others are optional:
item.boms.addBOM({ RELATED: part1, QUANTITY: 1.2, CUSTOM_FIELDS: { FIELD: 'value' }, ITEM_NUMBER: 10, QUOTE: part1.sourcing[0].quote[1] })

First two arguments are required, others are optional:
item.boms.addBOM(part2, 2.3, { FIELD: 'value' }, 11, part2.sourcing[1].quote[2])

var bom = bom;

Can assign:
bom.item.ANY_CUSTOM_FIELD
bom.qty
bom.quantity - Synonym for bom.qty
bom.quote
bom.ANY_CUSTOM_FIELD

Can read:
bom.id
bom.item
bom.item.ANY_CUSTOM_FIELD
bom.itemNumber
bom.descriptor
bom.qty
bom.quantity - Synonym for bom.qty
bom.quote - See Sourcing Tab support for fields which can be read
bom.ANY_CUSTOM_FIELD

bom.remove()

NOTE: You can assign to quote, for example:
bom.quote = target.sourcing[0].quote[1];

However, you cannot change the quote through the BOM:
bom.quote.min = 10;
is not guaranteed to persist changes to the quote. To ensure that changes are persisted, change the quote via the sourcing:
target.sourcing[0].quote[1].min = 10;


Sourcing/Quote implementation:

SOURCING:

Everything but SUPPLIER is optional:
item.sourcing.addSourcing({ SUPPLIER: supplier1, SUPPLIER_PART_NUM: 'ABC-123', MANUFACTURER: 'Manufacturer Name', MANUFACTURER_PART_NUM: 'MAN-123', COMMENT: 'Comment', CUSTOM_FIELDS: { FIELD: 'value' } })

Everything but first argument is optional:
item.sourcing.addSourcing(supplier2, 'XYZ-789', 'Other Manufacturer', 'OTH-789', 'Comment', { FIELD: 'value' })

Can assign:
item.sourcing[0].supplier
item.sourcing[0].supplierPartNumber
item.sourcing[0].manufacturer
item.sourcing[0].manufacturerPartNumber
item.sourcing[0].comment
item.sourcing[0].ANY_CUSTOM_FIELD

Can read:
item.sourcing[0].supplier
item.sourcing[0].supplierPartNumber
item.sourcing[0].manufacturer
item.sourcing[0].manufacturerPartNumber
item.sourcing[0].comment
item.sourcing[0].quote
item.sourcing[0].quote.id to get quote ID
item.sourcing[0].ANY_CUSTOM_FIELD

item.sourcing[0].remove()

QUOTES:

Args are: min, max, leadTime, leadTimeType, unitCost, comment
leadTimeType can be 1, 7, 30, 365, 'Days', 'Weeks', 'Months', or 'Years':
item.sourcing[0].addQuote(100, 200, 12, 'Days', 12.34, 'Comment')

Can assign:
item.sourcing[0].quote[1].min
item.sourcing[0].quote[1].max
item.sourcing[0].quote[1].leadTime
item.sourcing[0].quote[1].leadTimeType - Can be values listed above
item.sourcing[0].quote[1].unitCost
item.sourcing[0].quote[1].comment
item.sourcing[0].quote[1].default - true or false

Can read:
item.sourcing[0].quote[1].id
item.sourcing[0].quote[1].min
item.sourcing[0].quote[1].max
item.sourcing[0].quote[1].leadTime
item.sourcing[0].quote[1].leadTimeType - Will give values above
item.sourcing[0].quote[1].unitCost
item.sourcing[0].quote[1].comment
item.sourcing[0].quote[1].default - true or false

item.sourcing[0].quote[1].remove()

 

1 Kudo

Hi,

 

because of lack abilities in REST API it would be nice to execute script through REST API.

 

Algorithm:

1. Administrator creates actions script.

2. User logins to PLM360 with REST API.

3. Code of integration tool sends command to PLM360. For example, "ExecuteScript". Additionally can be defined ItemID, WorkspaceID, etc as arguments of function.

 

Currently, the workaround I will use is execution of script on create or update events of item.

 

Best regards, Vladimir

Status: Future Consideration
Hi Vladimir, We appreciate you submitting this request. We will add this to our future enhancement list. Thank you, Trung
4 Kudos
dkeeley

Item validation scripts

Status: Comments Requested
by Mentor on ‎04-13-2013 04:53 AM

Hi Guys,

 

It would be great if we could run validation scripts on items when they are being created or edited.

 

Thanks,

 

David.

Status: Comments Requested
Great idea!
1 Kudo

It could be very handy if condition and validation scripts could take a argument.

 

It could cut down on the number of scripts needed.

 

For example:

A GenAccept script could be reused on both an Accept and Reject action if it could take a bool argument.

 

GenAccept(true)

GenAccept(false)  (negate output)

 

Allowing it to take an integer would make it even more flexible.

Status: Comments Requested

Hello plmadmin,

 

I’m not sure I fully understand this request to have condition and validation scripts accept arguments.  Condition and Validation scripts currently get predefined parameters such as dmsID, userID, transID, and customTransID.  In addition, Library scripts can be imported into a Condition or Validation script that allows reuse functions (which include parameters) across many scripts.

 

In your example of GenAccept(true/false) for a Validation script, a Library script could be created to return an empty list or a list that could contain a canned error message:

 

Library Script:  GenAccept

 

function genAccept(hasValidationError){

                var messages = [];
                if(hasValidationError === true){
                                messages.push(Canned error message here');
                }
                return(messages);
}

 

Validation Script:  testMyValues     Import:  GenAccept

returnValue(genAccept( item.SOMEFIELD === null ));

 

In this case, the generic function (genAccept()) can be used to provide a canned message as the returnValue for one or many validation upon the condition that results in true/false.  This behavior is standard in PLM 360’s scripting engine. 

 

Is this helpful, or have I missed the point of the enhancement you’re requesting?

 

Thanks,

 

-Jared  

5 Kudos
ForrestJudd

Script Version Control

Status: Comments Requested
by Active Contributor ForrestJudd on ‎11-16-2012 08:25 AM

I'd love to see more robust script management.  Ideally I'd like to see the ability to officially version or rev scripts.  In addition to the Save button, you could add a button for Version.  This would store the script in its current state with the appropriate verison number.  

 

In addition, I'd like to review previous versions of the script and have the option of making a previous version the current version.

Status: Comments Requested
YES, YES, and YES!!! I love this idea!
2 Kudos
keith.tyler

Debug mode

Status: Implemented
by keith.tyler on ‎06-27-2013 11:17 AM

It would be beneficial to have a debugging mode for scripting (including stepping through low level scripts for which code is not available).

Status: Implemented
Debugger was added to the May 2014 release! See Advanced Debugging in the Help at: ;http://help.autodesk.com/view/PLM/ENU/?guid=GUID-764824AA-A429-4995-ACC0-64EEFB033507
4 Kudos

Adding Project Management items in the Project Management tab is tedious at times. Being able to add project items through scripting would allow an automated procedure involving less time consumption and tedious routine work.

Status: Implemented
1 Kudo

Hi,

 

It would be great to have an admin permission that allows users to edit fields that are set as 'non editable' in the field definition. It is very time consuming when testing to have to navigate to the workspace manager and change the field properties. It would also be a useful feature to have as an administrator to make changes and corrections easily.

 

David.

Status: Future Consideration
Hi dkeeley, We will take your suggestion and request into consideration and add to our future enhancement list. thank you, Trung
2 Kudos
cruzj

Scriptable field controls (permissions)

Status: Solution Provided
by cruzj on ‎06-04-2013 04:07 PM
Based on a value or status of a field, the ability to take an action based on changes to a field value.

Example, moving to the next step in the workflow. In the process to create a product name, the Person A asks Person B to create a name and get it approved by Legal.
If Person B approves a product name, we would like the workflow to  automatically advance to the next stage based on the "approved" status so that there are less clicks for the user and less chance of forgetting to advance the workflow on the Workflow Actions tab.
 
Status: Solution Provided
Hi cruzj, Currently you can write actions script to move the transition of the workflow based on the input of the fields in the Item Details Tab or completion of Workflow Transition. Depending on the number of fields you want to automate, it can range from simple to highly complex. You will need to activate the action script in the behavior for both upon creation and on edit to have the scripts running with every updates in the field. If workflow, you will need to add the action script to the action script section of the transition. item.performWorkflowTransition(Transition #, "Comments"); // This is the command line for workflow transition.
2 Kudos
cruzj

Form validations - client-side

Status: Solution Provided
by cruzj on ‎06-03-2013 04:23 PM

Form validations on the client side can save the user's time by pointing out errors in the form as they are entered or auto-populating values based on other values in another field.

 

An example is on a  pricing form where there some data relationships that should not be broken and internal logic would be enabled based on values the user selects. If a user selects value 1 from picklist A, then picklist B would show a different set of values than if the user selected value 2.

Submit Your Ideas

Share and shape product ideas.

New Idea
You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
IdeaStation Guidelines
Review guidelines and best practices
before posting a new idea


PLM 360 Survey