I want to increase the column length of a standard Acumatica field from nvchar(1000) to nvarchar(max), but not sure about how to do this. I tried to use the column length increase but it does not allow entering MAX. I tried the below, but it resulted in ntext rather than nvarchar(max).
<Column TableName="SMEmail" ColumnName="MailBcc" ColumnType="string" AllowNull="True" DecimalPrecision="0" DecimalLength="0" IsUnicode="True" />
ntext, text, and image data types will be removed in a future version of SQL Server, therefore it's best not to use these.
The other option I am thinking is to use a DDL script to Alter the column, but I would have preferred to do it using standard Acumatica functionality instead. Is there a way to do it without executing an Alter script?
The Customization Project Editor tool engine won't allow you to set 'MAX'.
The maximum value allowed in the Customization Project Editor tool engine is '4000'.
So you could use this '4000' value instead.
Related
Also posted on super users:
I'm a spotfire novice trying to create a parameterized info link. Ultimate goal is to create a default template that may be customized to return specific rows in a very large table. I've not been able to cobble together enough information from online searches to get me from point A to Z.
Spotfire version is 7.11 on an Oracle 11.2 SE DB.
Currently I've got a date/time prompt in the info link that will be global to all users. What I need is to be able to further filter to 1 of 2 columns (one is real, the other a string) in order to minimize loading times. There are 17 other on-demand tables that are related to the main one. Limiting the initial query will greatly speed up performance.
In information designer for the information link, if I edit the SQL in the WHERE and explicitly define the value or string for the column, I get the rows I want. When I try to define it using an input parameter (?ParamName), I either get nothing when I reload or get asked to input a parameter "for testing".
Q1: In the document properties for the analysis, I've been adding in properties that I assume is supposed to get picked up by the query.
- What part do scripts play in passing this variable to the SQL?
- Do I just need to define a value for a property name or include a IronPython script? - If script is required, can I just define the parameter to pass?
Q2: In the info link SQL, what is the correct syntax for defining the parameter variable depending on the type (real v string)? If I use a string, I need to include LIKE in order to pick up the desired rows. If I use a real, is it possible to define it as a list of values?
Thanks in advance.
Though not exactly clear from your description, I think you should be able to accomplish your goals using the "Load on demand" dialog that is accessed either when you add your data table to your analysis, or subsequently using the Data Table Properties>Type of Data>Settings dialog.
Spotfire uses this dialog to dynamically modify your SQL. Thus, you do not need to explicitly include the LIKE statement in your SQL. Spotfire will add it in based on what you define in the On-Demand settings. For example, you could have an Input Field where you type a constraint that will be stored as a Document Property and then refer to that Document Property in your On-Demand settings to control the table loading.
Like I know, I can use SearchRestrictions to restrict get operations. But what about insert_update? For instance, I want to remove an opportunity to insert Products with CHECK approvalStatus.
Search restrictions don't work like that. They restrict queries that are made against the database. How? The condition you add to a search restriction is added to the where clause of the select statement of the query. An INSERT query does not have a where clause. At least not those, that are generated when using impex.
Also impex is not the right tool for your purpose. Impex should only be used to import flawless data. It is just a simpler way of inserting data into a database, just like an insert statement in sql. You don't want data in an impex file that needs further checks.
Just filter those lines, that have undesired values. Then you can import the rest.
The entry for that screen is not needed. All the records are automatically generated. or probably by using DAC only.
The Graph/DAC logic is preferred as you get all of the framework freebies such as field defaulting and calculated formula fields.
You can however get around this using PXDatabase.Insert or PXDatabase.Update PXDatabase.Delete
I use these for upgrade processes or bulk delete of processing records. These calls do not require a graph to execute but ignore all DAC attributes which may or may not default values, calculate values, etc.
If you search on PXDatabase in the Acumatica code browser you can find examples. Here is one from EmployeeMaint.Location_RowPersisted:
PXDatabase.Update<Location>(
new PXDataFieldAssign("VAPAccountLocationID", _KeyToAbort),
new PXDataFieldRestrict("LocationID", _KeyToAbort),
PXDataFieldRestrict.OperationSwitchAllowed);
PXDataFieldAssign is setting column values.
PXDataFieldRestrict is your where condition.
It is best to find multiple examples of PXDatabase in Acumatica and confirm your query results using a tool such as SQL profiler to make sure its executing the correct statement you intend to run.
You can't use DAC without Graph. All BQL queries require PXGraph instance. The only way to save data without using BQL is using ODBC or any other ORM to connect strictly to database and do your changes. But it is not recommended way as in case of doing it in that way you will ignore all the Business Logic.
Is it possible to remove records from an itemtype using Flexible search service? As far as i know, Flexible search is only used for SELECT Operations.
Please suggest ways to remove records from an itemtype using a cron job? Thanks, Appreciate a lot.
Flexible search queries are not made to manipulate data (source), if you want to delete data you could :
Use the Model Service
Run an impex file with the remove header (source)
You can simply use sql query as well to remove the data.
Go to HAC -> Console -> Flexible Search
Switch the tab to SQL Query
Execute SQL delete query (DELETE FROM table_name)
Make sure you run query in commit mode otherwise Hybris will rollback the changes.
You can create a Groovy script to delete all the records in a table using the modelService as mentioned aboved.
Other option if you want to delete massively records from a table is to run an impex with the batchmode setted to true. ej:
REMOVE StockLevel[batchmode=true];itemtype(code)[unique = true]
;StockLevel
Where the itemtype is the parameter that will be use to delete the table, you can change that parameter for the one that fills your needs of course.
here's a really quick question...
Is there a type of Sitecore Editor control that I can use in the Template Builder to enable the product owners to add a free collection of strings in the CMS Editor?
I know that I can add a simple data object that has a single string field, add a number of these data objects and then add a Multilist to the Editor with that group of data objects as the Source, but that would mean that the product owners would have to add all of their strings as these data objects and then select them from the Multilist.
I'm trying to make it simpler for them, but I can't seem to find a Sitecore Editor control that enables them to enter a collection of strings directly in the Editor... is there one?
The short answer is no, there is no way to do this in Sitecore.
All hope is not lost, however. You can always create your own field type for something like this, but doing so does require a significant level of effort.