This row was already applied and cannot be modified - apache-kudu

When i run my code in the test environment to test my new code about kudu insert,it reports to me:
This row was already applied and cannot be modified.
I have already tried to debug my code and to see what is the problem in my code , but it is useless
if((map.get(list.get(i))) instanceof Double){
row.addDouble(list.get(i), (Double) map.get(list.get(i)));
//System.out.println("Double type insert succeed : " + list.get(i) + " : " + map.get(list.get(i)));
continue;
}
I want to know what's wrong in my code because in my previous code i can run correct but know it cannot

In the source code ,The class was that PartialRow has a private propertiy:frozen, It's default value was false,but in my code,when i debug in it,i found that value was true,I think this is the reason that cause the program reports to my : This row was alredy applied and cannot be modified ! asking for help .please

Without full stacktrace and the rest of code I can only guess why this is happening.
My guess is because the Insert object on which this row object is created has already inserted to Kudu (using KuduSession.apply) and then you tried to update it using row.addDouble.
If you are unsure about why please see this example of how to insert into Kudu.
KuduSession.apply method is invoked on Insert object on which PartialRow object is created, this will insert the data from all the PartialRow objects created from the Insert object. This can be done only once on one Insert object. After that you create a new Insert object using KuduTable.newInsert()
In your case you should probably create new object of Insert using KuduTable.newInsert() and create a row object on this.

Related

Netsuite Invalid API usage. You must use getValue to return the value set with setValue

So I have an odd issue, When I create a new transaction and save, this error in the title gets thrown. But when I edit this transaction after it was created, the getText does not throw this error. Is there something I'm doing wrong or something special needed to getText on a create new record? Here is my code. This is for the afterSubmit method on my User Event Script for Vendor Bill screen. I just noticed getValue does work on create, does not produce this error, just don't understand why? Is this the correct way to get the value on create? To use getValue and getText cannot be used on create? Only for edit?
if (scriptContext.type == scriptContext.UserEventType.CREATE ||
scriptContext.type == scriptContext.UserEventType.EDIT) {
// get bill to index
var Bill = scriptContext.newRecord;
// fails on this call below on create but works on edit
var refno = Bill.getText({ fieldId: 'tranid' });
}
This behavior is described in the API documentation here.
In dynamic mode, you can use getText() without limitation but, in standard mode, limitations exist. In standard mode, you can use this method only in the following cases:
You can use getText() on any field where the script has already used setText().
If you are loading or copying a record, you can use getText on any field except those where the script has already changed the value by using setValue().
Apparently the newRecord object falls under the second criteria. At this point, the object only has values set. tranid will have a value with the transaction's internal ID, but it won't have the transaction name stored. To get the text, you will have to use record.load() to get the full record, or use search.lookupFields() to get just the transaction name.

#DbLookup formula in dialog list: Server error: Entry not found in index

As usual, I am trying to populate my Dialog List field by using #-formula in it:
server:="WPRServer/Un";
dbPath:="Region/Users.nsf";
viewName:="Search_users";
#DbLookup("":"NoCache"; server:dbPath; viewName; "myKey"; 2)
But every time I am getting the error in my field:
Server error: Entry not found in index
I have tryed to use this formula to this field with another database on other server with different key names, but I am getting this error on this field again.
I have updated the views with CTRL + SHIFT + F9.
Tryed to update the current db design.
Recompiled LS and all views.
This is very strange, because I am using the similar formulas in other databases and everything is working fine every time.
Can you please give some small advise what is the way to fix this issue or maybe I am doing something incorrect? Thank you.
Update 17.09.2018:
1. The view Search_users is sorted.
2. I am using Windows server, and tryed to add **\** slashes and It helped to solve this issue, now I am getting this error:
This database is currently in use by another person or process, and cannot be accessed at this time. In order to share a Notes database, it must be accessed via a Domino Server by all users of the database.
I have tryed to reset all current accesses to this database with Domino Administrator tool, nothing helped - still getting this error in my Dialog List.
3. #DbColumn formula works fine with this view.
4. Also, already tryed to compact the database, no changes.
This may show you what the issue is:
server:="WPRServer/Un";
dbPath:="Region/Users.nsf";
viewName:="Search_users";
searchkey := "myKey";
rslt := #DbLookup("":"NoCache"; server:dbPath; viewName; searchkey; 2);
#If(#IsError(rslt); #Text(rslt) + " for:[" + searchkey + "]"; rslt);
Anticipation and handling error conditions.

Specify columns in empty IQueryable in WCF Data Service?

I have a DataService with the following queryable:
public IQueryable<MyData> MyDataList => myDataList.AsQueryable();
I connect to this data service in Excel 2016. Everything works, but when the list is empty I get the following error message.
The query did not run or the Data Model could not be accessed.
Here's the error message we got:
An Evaluate statement cannot return a table without columns
It seems the client (Excel) needs an object to successfully determine the columns. Why? Is it possible to tell the client about the columns without the need for an object?
Can't you check the resulted query first to see if it contains anything and return the actual data or a default one?
var defaultList = new List<MyData>();
public IQueryable<MyData> MyDataList = (myDataList.Any())?myDataList.AsQueryable():defaultList.AsQueryable();

Access document when I have the UID

I have a combobox on my form that loads client names from a view using the format "name | UID" - this displays the client name on the form but saves the UID in the field.
I now want to use the UID to lookup the name for the client and save it in a field on the XPage that is not visible using the following code:
// ignore when UID is null
if (getComponent("parentUID").getValue() == null)
return false;
var UID:string = getComponent("parentUID").getValue();
var doc:NotesDocument = database.getDocumentByUNID(UID);
// now set your fields
document1.setValue("nachname", doc.getItemValueString ("nachname"));
document1.setValue("vorname", doc.getItemValueString ("vorname"));
I do this in a simple action attached to a button. The next simple action is a Save.
The code crashes with the following error:
Error while executing JavaScript action expression
Script interpreter error, line=8, col=42: [TypeError] Exception occurred calling method NotesDatabase.getDocumentByUNID(java.lang.String) null
I have copied the parentUID to a field on the document and I am getting the correct UID and the document exists in the database?
Any ideas?
PS: I am adding this to an existing application and the current document is not a response document - cannot change that unfortunately :o(
OK, I have found my problem - XPages returned the UID but it included a leading space. When I concatenated the values I did the following: "name | UID" i.e. I added a leading and trailing space to the pipe symbol to make the code legible - this was causing the problems.
It looks like you are missing the get.Value() in your getComponent line
Try getComponent("parentUID").getValue() == null
My guess is that this is causing the code to run when the UID is null. This means that the code is running when it really is null, and your effort to check for that isn't working.
Thanks for checking that.
Can you put in a print() statement and ensure that you have a value in the var UID.
Another thing, please capitalize the word "String" since java classes are capitalized.

sharepoint - add custom column to list via object model

I'm having trouble figuring out how to add a custom column type to a list with the object model.
SPFieldCollection.Add() has a parameter SPFieldType, but that must be one of the enumerated values in the Microsoft.SharePoint.SPFieldType enumeration, thus it cannot be used to create columns of a custom type.
I next attempted using SPFieldCollection.CreateNewField() but when I call SPField.Update() on the returned value I get an exception: "ArgumentException was unhandled. Value does not fall within the expected range.".
I see a reference to SPFieldCollection.AddFieldAsXml() here: How do I add custom column to existing WSS list template but there's hardly any info and I'm not sure that's the right track to take.
UPDATE: I found a post on AddFieldAsXml: http://weblogs.asp.net/bsimser/archive/2005/07/21/420147.aspx and it turns out it's very easy and worked well for me. Posting anyway in hopes it will help someone else.
SPFieldCollection.AddFieldAsXml() is the way to go as far as I can tell. See here for an example: http://weblogs.asp.net/bsimser/archive/2005/07/21/420147.aspx
Try with:
SPField newField = null;
newField= web.Fields.CreateNewField("MyFieldTypeName", fieldName);
web.Fields.Add(newField);
newField = web.Fields[fieldName];
// set some properties
newField.ShowInDisplayForm = false;
newField.ShowInViewForms = true;
newField.Update();

Resources