How can i disable line level "Make Copy" Button in Netsuite - netsuite

I am new to netsuite
I want to disable line level "Make Copy" Button when sales order is open in edit type.
i read in netsuite help but didnt get the right way to do.

If you want to hide the button table completely, then you can write a client script like below. On page load it will hide your button.
function clientPageInit(type){
if(type == 'edit'){
setFieldAndLabelVisibility("tbl_item_copy", false);
}
}
Note: You'll lose the Copy Previous button also as we're hiding the parent table i.e tbl_item_copy

I guess you cannot. Try client script on line init and check type, if type == copy, do nothing or give alert message and return.

Related

How to show a button on Customer Form only in view mode?

I created a button to redirect to an external page on the customer form on NetSuite through SuiteScript and it shows only in EDIT mode, but I want to show it only in VIEW mode. What can I do to fix it?
I tried some script lines but didn't work. The button is working properly redirecting to the external page, the problem is only about showing in the correct place, which is ONLY on VIEW mode.
You need to add context type in the user event script beforeLoad(context),
just add this line in the before load function at top.
Note- in Function if you using beforeLoad(context) then use context else use sriptContext.
if (sriptContext.type !== sriptContext.UserEventType.VIEW)
return;
It will work.
Thanks.

How to Override the Sales Order Quick Process Action Button in Acumatica

Is there a way to override the Quick Process Action Button in Acumatica.
Requirement:
After clicking on the OK Button, print pick list and the Shipment confirmation should be opened as a Combined in a single report instead of opening in the two separate tabs.
We could not able to locate the Quick Process action button.
Please help me to resolve this .
Quick Action button is made available, per order type. Review the Sales Order type screen.
Inside the standard graph SalesOrderEntry graph, you will find the method QuickProcess. It is available after you create the graph extension. Inside your extension, you may extend QuickProcess. Or override if you wish.

How to disable add/edit/delete of sublist suitescript

How can I disable editing of the sublist using Suitescript user event (before load) in netsuite?
I also need to disable the inline editing.
Thank you.
You don't really need to disable editing before load, because no one can interact with sub-lists at this point. Sub-lists are like linked to the main record which means they load as the main record object loads, so the best way to prevent them from being edited is on the DOM.. which means making a form script or client-script (form preferably).
-If you know which form is used by the record go to it, else go to the record and look for "customize form" on the upper-right menu on the blue area.
-Then click on custom code.
-Add a script for "Validate Line Function" to prevent that line from being edited.
-Use the NetSuite example as a base, to prevent the line from editing you just have to return false.
function sampleValidateLine(type)
{
if ( (nlapiGetCurrentLineItemValue('item', 'custcol_service_item') == true) &&
(!nlapiGetCurrentLineItemText('item', 'custcol_service_rep')) )
{
alert("You must choose a Service Rep for this service item.");
return false;
}
return true;
}
Ideally in NetSuite you would restrict this based on permissions. For custom records, you can disable inline editing, and you can disable child record editing. The help documentation has this to say about it:
Check the Allow Child Record Editing box to allow records of this type
to be edited directly when they display as child records in a sublist
on a parent record.
https://system.netsuite.com/app/help/helpcenter.nl?topic=CARD_-29 see item 14.
You can also use form object to achieve the same. See sample code below:-
var form = scriptContext.form;
var serviceItemColumn = form.getSublist({id: 'timeitem'}).getField({id: 'item'});
serviceItemColumn.updateDisplayType({ displayType : 'disabled' })

Inline Editing of View data used in a repeat

I have a repeat control using a view as the datasource with a custom control within the repeat. The custom control is made up of a panel with two tables. One table has computed fields with an Edit button and the other has editable fields with a Save and Cancel button. The Edit and Cancel buttons work as needed, but the Save button gives a NotesDocument.save() is null error. I have already narrowed the issue down to the error occurring on the edoc.save() line by commenting out all prior lines. I even tried to do an edoc.lock(), but got the same error.
var edoc:NotesDocument = database.getDocumentByUNID(viewScope.get('docid'));
edoc.replaceItemValue('Ext_1',viewScope.get('ext_1'));
edoc.replaceItemValue('DID',viewScope.get('did'));
edoc.replaceItemValue('Mobile',viewScope.get('mobile'));
try {
edoc.save();
} catch(e) {
print(e.toString());
}
The storage of a DocID in the viewScope and a repeat control doesn't seem right. You want to add a custom property to your custom control called DocID and then instead of
database.getDocumentByUNID(viewScope.get("docid"));
You do:
database.getDocumentByUNID(compositeData.DocID);
This was you can be sure that you get the document that was in that view for that row.
What you also might consider, instead of all the manual steps (the ones you commented out) have a panel with a DocumentDataSource and then simply bind your input fields to that one. Handover of id via custom property and "IgnoreRequestParameter = true
Then you simply do a rowDoc.save() (presuming you named the datasource rowDoc) and you don't need to recycle anything. Let us know how it goes.

Hide CRM form left hand side navigation item

I have my account entity linked to a custom entity called inspections, I only want these inspections to be created for accounts of a certain type. So when it isn't that type I want the left hand navigation to this entity to be hidden away. I've seen some code that says will hide it away, as long as you have the navID of the item.
I've had a crack at hiding it using what i thought could be the ID but it hasn't worked, so I'm wondering if anyone knows how to get this ID, or if there is another way to do this?
The code I'm using to hide the navigation is below:
var navitem = Xrm.Page.ui.navigation.items.get("nav_ts_inspection");
if (navitem != null)
{
navitem.setVisible(false);
}
Load the form
Press F12 to show IE Developer's Toolbar
From here you can use CTRL+F to search for the display name of the item you'd like to hide. This will give you a link that is generated. The Id of this element is what you need to use to show/hide the link.
As an example, you can see results of searching for 'Sub Accounts' on the Account screen for an installation I am working on at the moment. The Id can be seen and is 'navSubAct'
Changes by traversing DOM and manually hide an area is not officially supported.
Luckily if you are on CRM 2011, you can go to
Settings > Customization Or open the solution.
Select the entity > Forms. Inside the Form editor window, open the Form Properties of the entity.
Go to Display Tab and untick "Show navigation items" checkbox.
Finally do not forget to Publish your changes.
Use the relationshipname to hide folder in navigation like this:
If you have folder with the relationship name: ts_inspection
Use this for ID: navts_inspection
So otherwise the same as above, but lose the extra underscore (_) between nav and ts.
var navitem = Xrm.Page.ui.navigation.items.get("navts_inspection");
If you want to hide particular navigation section from the FORM then remove all the links from that section and publish it. That section will not be visible anymore.
If you want to just remove Navigation Pane from FORM, then go to 'Display' tab of form and mark as 'Do Not Show' and then publish it.

Resources