I have a custom DAC field bound to a checkbox, but when I update the value of the field within code:
SOOrderExtension orderExt = PXCache<SOOrder>.GetExtension<SOOrderExtension>(row);
orderExt.UsrSignatureRequired = true;
the checkbox check is not updated on the UI. First I tried adding this line in the FieldUpdated event because this has worked for me before:
Base.Document.Update(row);
That didn’t work. Then I tried a suggestion I found on StackOverflow that forces a save and cache refresh, but my row (SOOrder) can’t save yet due to some validation rules, so that didn’t work. I think I need some kind of callback to the client to tell the UI to update itself, but usually this happens through events of bound fields. Suggestions?
Using v6.10.1219
A colleague suggested I use cache.SetValueExt<>() instead:
cache.SetValueExt<SOOrderExtension.usrSignatureRequired>(row, true);
and now it’s updating the checkbox check for me. SetValueExt must perform the callback on its own somehow. I guess I need to remember to use each of these methods in the appropriate situation.
Related
I have a custom page with a form and a grid. When a row from a grid is deleted, I want to update some other rows. I am therefore handling the rowdeleted event. I confirmed (through debugging) that the event is firing correctly and that the data is being updated correctly.
The only issue I have is that the screen still shows the old values. My delete row correctly disappears but the other rows do not get updated.
For each row that I change, I am calling the Update method of the Data View. However, this still does not refresh the user interface.
Interesting, if I save, all my changes get correctly updated to the database. Which confirms that this is a UI isssue.
Is there any additional step that I need to perform to refresh the user interface? Or should I just avoid doing updates in Row Deleted event?
To guarantee constant optimal performance level, in the end of a roundtrip grids in Acumatica only update currently selected record. This behavior is by default. In case you insert/update/delete other records in the same grid within an event handler or an action delegate, it's always necessary to call View.RequestRefresh() to force the grid to update its entire content instead of only the selected record.
I managed to solve the issue by calling View.RequestRefresh(). However, I am not sure whether this is a standard practice. But I did find it used in several places in the Acumatica code
How can I change a field on a form when it is initially created, but not when it is later edited? I'm currently using a Client script and coding for this with the pageInit function, but I need to allow my users to manually change the field after it is initially created without the script overriding their changes.
Let me know if more details are needed for what I am exactly trying to accomplish.
As I mentioned in a comment above, I figured this out. Using the type parameter of the pageInit function, I can make events fire on page edit or page creation like this:
function pageInit(type){if(type == 'create'){//do stuff}else{//do other stuff}}
I have a PXSelector which shows a list of payors. I added the AllowEdit=true parameter in order to be able to add a new one. However, I need to be able to send a patientID that would be retrieved from a field on the first form to the window in order for the customized form to work. Would I be able to override the function that calls the page and if so, what would it be called?
this may not be an exact answer for your question, but i think this might help you.
"You can use PXContext.Session.SetString(key, value); to set string value in the session. And PXContext.Session[key] to retrieve value."
I have set the required property to #IsDocBeingSaved but then there is no option to enter s validation message. How do you make a control required under specific conditions and still have a message when it is required
You need to edit the source. Or: check it as required, enter the message, then switch to the computation. The message doesn't get deleted
Actually what I ended up doing is creating a under the validators properties I created a validateRequired and added code to the loaded and disableValidators to make it only active during saving. Works well, just not real obvious. I have used some validators before but not often. Need to keep remembering to go there.
I have a fairly straightforward and common use case. A panel, in which resides a repeat control. The repeat control gets its content from a view lookup by key. Below that repeat control is another panel. This panel has a data binding to a new notesdocument. The panel has a couple of fields on it for the new document and a submit button.
It all works, however after submit (presumably in the "postSaveDocument()" event) I want to call back up to the repeat control and have it re-perform its lookup and refresh its content.
I'm looking to understand syntactically, how I can reference the repeat control and its properties and methods from elsewhere on the document -- and secondarily (though I can look this up once I get the first part figured out) what the refresh() method would be for that that repeat control.
Ideally, I think its something like: xp:page.repeatcontrolname.refresh() -- though I know that isn't right.
I'm sure once I see an example, it will apply to a myriad of other things.
Update :
I discovered that the repeated elements were actually refreshing but I wasn't seeing a new entry added to the list. The reason, ultimately, turned out to be that to add another entry to the repeat list I needed a new "control" -- but I'd checked that box (on the repeat control) that said "Create Controls at Page Creation". It was preventing my XPage from creating another entry for the new document to display!
This article explains the syntax for doing what you describe:
http://avatar.red-pill.mobi/tim/blog.nsf/d6plinks/TTRY-84B6VP
I have a feeling that this one captures the actual use case.
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Create_and_display_responses
The key setting that people tend to miss is "ignoreRequestParams".
Andrew,
The 'XSP.PartialRefreshGet' call was broken in Domino release 8.5.3 which results in the '_c9 is undefined' error.
Have a look at the article posted by Tommy Valand:
http://dontpanic82.blogspot.com.au/2012/03/patch-for-bug-in-xsppartialrefreshget.html
Basically to work around the problem a second argument is required to be passed to the call, for example:
XSP.partialRefreshGet("#{id:ExistingDevicesList}", "")