I am trying to save child workorder specification values and it's not working as intended. Here is what I have been trying to achieve.
I am retrieving list of parent and child workorder together so that flat structure s maintained and filtering the parent workorders to be displayed on My Assigned Workorder view
e.g. Below are the workorders assigned to a particular user for a particular site.
parent WO - 1000 has child wos - 1001, 1002, 1003
parent WO - 2000 has child wos - 2001, 2002
Assigned Workorders View shows only 1000 and 2000 workorder.
Once you select a workorder then it shows workorder details and the list of Child WO.
There is a tab on the workorder detial screen same as Attachment or Tasks or WorkLogs
So the flow is select a parent WO -> Opens Workorder Details view -> Click on Child WOs tab -> displays the list of child WOs
e.g. select 1000 -> click on Child WO tab -> displays 1001, 1002, 1003
Select a child WO and it displays it's specification attributes one by one
Enter a value for specification attributes and then go back (takes you to Child WO list screen -> go back (takes you to workorder details screen) -> go back (takes you to My Assigned WOrkorders view)
Here comes the problem. Select parent WO and then Child WO, all the child workorder specifications are lost.
In js file, I am retrieving the workorder and the workorderSpec resource
initialize: function (eventContext) {
var workOrder = eventContext.application.getResource('workOrder').getCurrentRecord();
var identifier = workOrder.get('identifier');
var workorderSpecs = eventContext.application.getResource("workOrder.workOrderSpec");
}
Surprisingly this code works fine for the first time. But the second time
eventContext.application.getResource("workOrder.workOrderSpec"); returns null even though var workOrder is holding the correct workorder information.
Let me know if you have confusion around the scenario.
Any help is much appreciated.
I made a similar thing. In the object structure I've added a new view on workorder (WOCHILDREN) and I've changed the workorderspec relationship to include all the specs from the WorkOrder and the specs under children. You should be aware that after downloading the specs to your mobile, this relationship is lost (all the specs still reference the original work order).
I then used the eventContext.ui.viewHistory to determine where I was in the app. Then decide if I need the workorderResource currentRecord or the wochildrenResource current record. And get the identifier from that record.
Now you need to use that identifier (workorderid) to filter the list of workorderspecs.
var specs = eventContext.application.getResource('workOrder.workOrderSpec');
specs.filter("refobjectid = $1", workorderid);
The problem with this approach is that filtering a resource changes the state of that set. Which means that any unsaved changes are lost. Therefor I added an extra check to see of a set was filtered and dirty (ie. changed) and if so save the set.
Related
I imported a TFS query to excel to add a bunch of tasks. That part worked well. Now I just need to attach them all to their appropriate user stories (parent). I tried a bunch of different options in "column options", but none of them let me choose the task's parent. Is this even possible through excel?
You can achieve that by adding parent/child linked backlog items and tasks, please see Bulk add or modify work items with Excel for details.
In you case, you have bulk added the tasks to project,you need to link parent user stories by following below steps:
Select any task and link it to its' parent story (to generate the tree level title in query).
Create a Tree of Work items query like this:
Open Excel,New list > Select the created query above > OK
Edit the query in excel, move the Tasks title from Title1 to
Title2 accordingly based on their appropriate user stories.
Click Publish, check the Parent link in backlog.
I am new to Acumatica. Can someone guide me on how the below functionality can be achieved. I am trying something similar like sitemap functionality in Acumatica, where Parent node is mapped to multiple child nodes and it needs to be updated.
In Stock Items screen added a customized column to capture the hierarchical parent item. If there is any change all the Stock Items which is mapped to hierarchical parent Item should also be updated. It can be more than 1 record where it has to be updated.
Here is an example where I need to update multiple hierarchical parent item when there is change.
InventoryCD: PEN, PENCIL, PAPER
parent item: Stationery
can someone guide me on this ?
Well it looks like I need to suite script this.
I want to populate a field in my child record from the form that is creating the record.
When the user clicks to add a new child record, I want to pass some info to the creation of that child record from the current parent that initialized the create child.
How is this done?
MORE INFO:
I originally looked at Sourcing and filtering, but that was dependent on the parent record being the same. Let's say I have a note record. Meanwhile I have other entities which can have a note created and linked to it.
Something like adding the set name to a note:
Set
-->> Books --> Note (set name = books.set.name )
-->> Authors --> Note (set name= authors.set.name)
So unless I can use some eval technique, I would think I should start my dive into suite script.
The workaround I found was to use window.opener in a client script:
function rulePageInit(){
var wo = window.opener.nlapiGetFieldValue ('custrecord_configurator');
You can script this, but you do not necessarily have to. NetSuite's primary mechanism for doing this is Sourcing.
On the definition of each custom field that you want to populate from the parent, you just need to set up the Sourcing and Filtering tab appropriately to pull data from the parent record. I believe you will set the Source List to be the field that links to the parent, and then you will set the Source From to be the field on the parent that you are copying data from.
If you only want the field to be sourced once at the time of creation, then you can check the Store Value checkbox on the field definition. This will set the field once and then divorce it from the parent record so that you can change the two fields independently.
If you want the field to dynamically pull from the parent every time you view the record, then you should uncheck Store Value. Be aware that unchecking this means the field will no longer be scriptable or searchable.
See the NetSuite Help page titled Setting Sourcing Criteria for more details about the relevant settings.
2013 On-Premise
Hello,
I have a parent record and a subgrid that can create a related record. When I create this related record several of the parent fields are mapped over to save the user double entry & mistakes.BTW the related record is being created via a quick create form.
Everything works great....at first.
If the parent record changes and the changes are saved. Then a new related record created the mapped fields DO NOT reflect the updated parent?
Further this behavior exist if there are NO related records or several.
Is my relationship not properly defined...i.e. needing cascading?...I thought that was just for cascading deletes???
Any input greatly appreciated
#Dave
My apologies...perhaps I have not been clear or I am not understanding you.
....If you need the previously mapped fields to change when the parent record values change....
This is where I am wondering if I am not being clear or understanding. This is happening on the "create" not existing records.
So I thought perhaps incorrectly if I changed the parent record and then went to create a new related record it would get the new mapping?? BOLD just so text isn't lost between picts.
The mapping functionality is only applied when the child record is created. Cascading only applies to events like deleting, sharing, unsharing, assigning, and re-parenting the parent record. Mapping is not involved in cascading at all. - http://msdn.microsoft.com/en-us/library/gg309412.aspx
If you need the previously mapped fields to change when the parent record values change, this would best be addressed with a plugin. You may also consider making the child's mapped fields read only so user's don't think they can enter information in the child record's fields that get populated from the parent.
Basically i want to creeate a block diaplay view,which displays a list of all the users thata have posted some nodes on the drupal website.
Oddly enough thinking about this right now it could be a little tricky. You have two possible solutions off the top of my head.
1 - Create a new view of item type Node. Your row style will obviously be set to Fields. Under which Fields to pull select the User group and then tick off the User: Name checkbox. Set your Items to display setting to 0 for unlimited results.
Under the preview you should get a ton of results looking something like:
Name: John Doe
Name: Mary Jane
Name: John Doe
Name: Anonymous
What you're seeing is the authors of all the nodes posted in your system. There will be duplication because a user in your system could be the author of multiple nodes. Unfortunately you can't just tick off the Distinct: Yes option because this only applies to nodes and not the users.
How to deal with the duplicate user name results tho? Custom theme your view by creating a custom template under Theme: information. Inside the template write some PHP code which intercepts the row results from the View query before it renders and only render distinct user names from the results. You'd have to write the logic though to determine whether a user name has already been added.
As simple as creating a new custom array, adding each row result (user name) to array but first checking to see whether it already exists in your custom array - if it does then toss it and move on to the next user name. At the end you'll have an array filled with distinct user names who have posted on your site.
voila! It works. It's not elegant but it definitely will work if built this way.
2 - Alternatively maybe you can get this module working to accomplish the same thing in a less complicated manner: http://drupal.org/project/views_customfield but I have never used it so I cannot comment on it.
Good luck. Hope that helps.
My solution was to:
Create a view of people
Add a UID field (and any other fields you want)
Create a theme.tpl.php file for the Row Style
Do a DB call on each loop through the row to search for nodes created by the supplied UID.
Here is what I have in my semanticviews-view-fields-VIEWNAME.tpl.php
<?php
//Query the Drupal DB for nodes associated to the supplied UID
$existing_nid = db_query("SELECT nid FROM {node} WHERE (type = :ctype) AND uid = :uid", array("ctype" => "CONTENT_TYPE", "uid" => $fields['uid']->content))->fetchField();
//If the supplied UID created content of the supplied type, then show their name
if ($existing_nid != FALSE) {
echo "Name:" . $fields['name']->content;
}
?>
This way only UID's that have content associated to it in the DB will be printed out, and those that don't, won't.
Hope that helps!