Troy M
20th February 2006, 17:08
I need to use the APIs to create new records in "Business Partners by Project" (tppdm6501m000).
Problem: when clicking on the "New" button in tppdm6501m000, the sub-session that opens up (tppdm6101s000) reads the project code from the main session and doesn't allow the user to browse for it.
Therefore, I need to pre-set the project code in tppdm6501m000 before opening session tppdm6101s000.
To do this, I assume I'll need to
1. create a "New Group" in tppdm6501m000
2. set the project code with:
stpapi.put.field( "tppdm6501m000", "tppdm740.cprj", cprj )
3. sync the sub-session:
returnVal = stpapi.synchronize.dialog("tppdm6501m000", "add", error)
4. then add the values to the sub-session and save:
stpapi.put.field( "tppdm6101s000", "tppdm740.ofbp", ofbp )
stpapi.put.field( "tppdm6101s000", "tppdm740.ccur", ccur )
...
returnVal = stpapi.insert( "tppdm6101s000", do.update, error)
...
returnVal = stpapi.save( "tppdm6100s000", error )
Steps 2, 3 and 4 work fine when adding records to a project that already has records in the session.
Can anyone help me with step 1 please? How do you use the APIs to call standard commands?
Problem: when clicking on the "New" button in tppdm6501m000, the sub-session that opens up (tppdm6101s000) reads the project code from the main session and doesn't allow the user to browse for it.
Therefore, I need to pre-set the project code in tppdm6501m000 before opening session tppdm6101s000.
To do this, I assume I'll need to
1. create a "New Group" in tppdm6501m000
2. set the project code with:
stpapi.put.field( "tppdm6501m000", "tppdm740.cprj", cprj )
3. sync the sub-session:
returnVal = stpapi.synchronize.dialog("tppdm6501m000", "add", error)
4. then add the values to the sub-session and save:
stpapi.put.field( "tppdm6101s000", "tppdm740.ofbp", ofbp )
stpapi.put.field( "tppdm6101s000", "tppdm740.ccur", ccur )
...
returnVal = stpapi.insert( "tppdm6101s000", do.update, error)
...
returnVal = stpapi.save( "tppdm6100s000", error )
Steps 2, 3 and 4 work fine when adding records to a project that already has records in the session.
Can anyone help me with step 1 please? How do you use the APIs to call standard commands?