I am new to Acumatica.
In a FormDetail screen, I have a business process to process all the rows(Inserted, Modified, Unchanged) in the grid. I could not get the Unchanged rows. How to Solve this ?
Please Help
Thanks
Babu
In Acumatica framework grids are bound to data views. You can call the 'Select' method of the data view to get all data rows.
First locate the graph and data view you are interested in. You can use the inspect element feature and then click on the grid to get that information:
For this example, the Transactions data view is located in SOOrderEntry graph:
So we would create a graph extension for SOOrderEntry and inside the graph we can iterate on Transactions collection. Notice that we use Base to access the base graph data view from the graph extension context:
foreach (SOLine soLine in Base.Transactions.Select())
{
}
Related
I'm trying to add a non-bound (display only) field to the grid in the Approvals screen. This field's value comes from a bound user field in an APInvoice DAC extension class. My problem is that in the RowSelected event for the Approvals screen grid (which is the EPOwned DAC), I'm trying to link back to the Bills and Adjustments screen records via the RefNbr on the Approvals screen grid.
Although the Approvals grid shows it as the RefNbr, the actual field in the EPOwned DAC is a GUID. By some magic (I've pored over the source code for this screen and I cannot find where it creates an APInvoiceEntry Graph to open that screen - even though it does, somehow), it knows to link the clicked-on record in the Approvals grid to the Bills and Adjustments RefNbr / record.
My hunch is that it all has some link with the RefNoteID / NoteID in EPOwned (EPApproval ) - but I cannot find any link between the EPOwned records and the APInvoice / APRegister records.
Does anyone know how to link, through BQL, the EPOwned (EPApproval) record and the APInvoice record that is related to the Refnbr shown in the Approvals grid?
After further research, it is found that the EPOwned DAC (which contains EPApproval) is linked back to the APInvoice DAC via the following:
EPOwned.RefNoteID = APInvoice.NoteID
This will provide the necessary link to find the APInvoice.RefNbr
I have a user field which displays the ARRegister.RefNbr. This user field is contained in the APTran grid. The user actually creates an AR invoice with a custom action, and the new AR document ref nbr is saved to the APTran grid. I wish to craft the user field as a hyperlink (similar to the inventory receipt reference number, in the SO shipment order tab). Should I use a PXSelector control? What are the proper attributes? The goal is to open the AR invoice screen, when the user click on the user field.
There is a generic approach that allows you to add links to the grid cells and isn't based on selectors or anything else. To implement it you have to do the following steps:
1.Define an action in your graph that handles redirects. Something like this:
public PXAction<YourMainDAC> ViewInvoice;
[PXButton]
protected virtual void viewInvoice()
{
ARTran row = Transactions.Current;
string docType = //get Doc Type from the tran record
string refNbr = //get Ref Nbr from the tran record
ARInvoice invoice = PXSelect<ARInvoice,
Where<ARInvoice.docType, Equal<Required<ARInvoice.docType>>,
And<ARInvoice.refNbr, Equal<Required<ARInvoice.refNbr>>>>>
.Select(this, row.YourDocTypeField, row.YourRefNbrField);
// Create the instance of the destination graph
ARInvoiceEntry graph = PXGraph.CreateInstance<ARInvoiceEntry>();
graph.Document.Current = invoice;
// If the invoice is found, throw an exception to open
// a new window (tab) in the browser
if (graph.Document.Current != null)
{
throw new PXRedirectRequiredException(graph, true, "AR Invoice");
}
}
2.In the .aspx page definition add a callback command that corresponds to the new action (substitute grid with the ID of the ARTrans grid on your page):
<px:PXDataSource ID="ds" ... >
<CallbackCommands>
<px:PXDSCallbackCommand Name="ViewInvoice"
Visible="False"
DependOnGrid="grid">
</px:PXDSCallbackCommand>
</CallbackCommands>
</px:PXDataSource>
3.In the grid column where you want to add a link specify link command to point to the above PXDSCallbackCommand:
<px:PXGridColumn DataField="InvoiceNbrOrSomething"
LinkCommand="ViewInvoice">
</px:PXGridColumn>
This is a bit lengthy way of defining a link but, first, it does not impose any constraints on the field where you add a link and it also gives you full control over which graph to open and what to show there.
Note: you may also need to set SyncPosition="true" on the grid control in the aspx.
The example is adapted from the Example 3.4 in the Acumatica T200 training guide. You may want to check it out for some thorough explanations and more info.
If you have a selector linked to a standard Acumatica table such as adding a custom field that contains a selector against InventoryItem or ARInvoice you can set the AllowEdit=True on your field in the page containing your custom field. This will automatically add the hyperlink. If your field does not contain the selector it will not work unless maybe setup for segments.
We have custom tables we added to our project where we wanted hyperlinks. As long as you add the PXPrimaryGraph attribute on your DAC you should be able to do the same for a complete custom page/dac.
We started off using the LinkCommand but the AllowEdit approach keeps the code simple without the need for custom logic to support the link. More complex logic than going to the fields primary graph would require a linkcommand.
Using orchard 1.6. I've created a content type 'ImageUpload' which has 2 fields 'Image' and 'Date'. So the user can select todays date and upload an image. The uploads can be viewed from the 'Content Items' section of the dashboard but...
I would separately like to access/view the uploads from a different section(as the user wont have access to view the content items page) Iv set up a navigation menu but how can I view the records?
The content items are stored in the 'ContentItemVersionRecord' table...?
I don't fully understand your question. View the content items on the front end? Try using the projections module. You create a query that gets content of ImageUpload type and then you create a projection page that will use this query. Enable Projections feature, it comes with 1.6
Using orchard cms 1.6 I have a table in my db 'cars'. I want to display the column 'CarName' from the table, as a list on screen with all the records from the table.
carname1
carname2
carname3
When the user clicks on their link it will bring them to that page.
I know how to do this from the view e.g.
#T("Cars")
but I would like to try and create a content type which shows this list.
Content type seems to be all UI related. Im not sure how to take a table and display a column as a list on screen through the content type...any idea on how to do this?
then I can choose to show the content type as a form and the user can view it from the main menu.
thanks
It looks like you want to create a content type called Car, possibly with a CarPart and a record class CarPartRecord (perhaps refactor your Car class to CarPartRecord to follow Orchard's naming conventions). Make sure CarPartRecord derives from ContentPartRecord.
To render a list of Cars, you could use a Projection that renders a list of cars. A Projection renders content based on a Query, which you configure using the dashboard.
Alternatively, you could create a controller that leverages IContentManager to query all Car content items, and returns a view to render them in a table.
For each Car content item, use Html.ItemDisplayLink to render a link to its details page.
I have a simple maps app with multiple pins on a map view. My intention is to tap a pin, show a callout with an accessory view, push to a Detail View Controller where you can edit that pin/locations details. This all works fine, but once i pop the Detail View Controller the callout on the map view is still there, which i want, but it still has the old uneditied values. How can i refresh/update the callout view once the Detail View Controller is popped?
I am using Core Data with a simple database. I have tried using controllerdidchangecontent, Map View Controller Will Display methods etc but my main problem is identifying which object has been added/updated/deleted and which is the corresponding callout/selected pin.
Any help appreciated...
Not sure if you had find your answer but the way to do it is to extend MKAnnotation class and creating custom annotation and passing them while creating placemarks. Later you can get them from MKAnnotationView's annotation property.
See a good implementation here
http://www.slideshare.net/360conferences/getting-oriented-with-mapkit-everything-you-need-to-get-started-with-the-new-mapping-framework
The only way I could find to update the callout info was to mess directly with the subviews of the callout.
The callout view is the first subview of the annotation view.
In the following example, I update the subtitle.The title label is the 6th and the subtitle is the 7th subview of the callout:
if (myAnnotationView.subviews.count > 0)
((UILabel*)[((UIView*)[myAnnotationView.subviews objectAtIndex:0]).subviews objectAtIndex:7]).text = #"Some example";