Microsoft Dynamics AX development

Scenario:
I have a user that is associated to a custom role (TradeSalesClerk + other permissions/duties).

I’ve added the following permissions to the role:

  • SalesQuotationGenerate
  • SalesQuotationTableDetailsMaintain

but in the form of the customers (CustTableListPage + CustTable) the user does not see the button for the creation of a sales quotation (see picture below).

untitled

Solution:
In the permission “SalesQuotationTableDetailsMaintain”, the entry point “SalesCreateQuotation” has AccessLevel = read.
I’ve changed the AccessLevel to “Create”, and it resolves the problem!

The problem was caused due to the fact that the menu item SalesCreateQuotation used in the CustTableListPage form was defined as entry point in privilege SalesQuotationTableDetailsMaintain with entry mode “Read”, but on the CustTableListPage form the button had the property “OpenMode” set to “New”.

In this case the security framework “hides” the button as the user has only defined the “View” permission although “Create” is required to invoke the Button.

 

When I start the invent recalculation (Inventory and warehouse management > Periodic > Closing and adjustment), I receive the following error:

You can’t have unallocated cost on a planning formula.

Scenario:

    1. Create a production order and started it
      In this moment the system creates the transaction on the production order header
      untitledand the corresponding records in the InventTransOriginAssemplyComponent table.
    2. Create the Picking List and the Route Card and posted them with positive quantity and the flag “End”, on the lines, set to true.
    3. Create the Report as Finished with quantity 0 and the flag “Report as finished” on the line set to true (set to true the field “Accepr error” on the journal header) and post the journal
      In this moment the system deletes the transaction on the production order header and the corresponding records in the InventTransOriginAssemplyComponent table.
    4. Recreate a new Report as Finished with positive quantity and the flag “Report as finished” on the line set to true – save the journal
      In this moment the system recreates the transaction on the production order header WITHOUT the corresponding records in the InventTransOriginAssemplyComponent table.

Solution: Resolved with hotfix KB 2935085.

To add a new datasource to the form InventOnHandItem, you have to follow these steps.

In my case I’ve added the (InventTable).GTIN to the form.

Add the table (in the example I’ve used the InventTable) to the form’s datasource

Aufnahme1

Modify the method modifyQuery in the class InventDimCtrl_Frm_OnHand:

  • add the new datasource to the method declaration and add a new variable for the new QueryBuildDataSource:

Aufnahme4

  • add the following code at the end of the method

 

Aufnahme2

  • it is important that the field you want to add to the InventOnHandItem is the “group by field”.

This is the result:

Aufnahme7

PurchFormLetter  purchFormLetter
ProductReceiptId productReceiptId;
PurchLine        purchLine;
PurchTable       purchTable = PurchTable::find('123456');
PurchQty         purchQty = 20;

while select purchLine
where purchLine.PurchId == purchTable.PurchId
&& purchLine.IsDeleted == NoYes::No
{
purchLine.PurchReceiveNow = purchQty;
purchLine.setInventReceiveNow();
purchLine.update();
}

purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);
purchFormLetter.update(purchTable, productReceiptId, purchFormLetter.transDate(), PurchUpdate::ReceiveNow);
purchTable.reread();

PurchFormLetter purchFormLetter
PurchTable purchTable = PurchTable::find('123456');
PackingSlipId packingSlipId = 'PS_01';

purchFormLetter = PurchFormLetter::construct(DocumentStatus::PurchaseOrder);
purchFormLetter.update(purchTable, packingSlipId);
purchTable.reread();

To keep table groups on the same page, the table group should look like this:

Aufnahme1

Then, select the group row and set the properties “KeepTogheter” to True.

Aufnahme2

Deploy the report.

 

Align image logo to the right

1) In the DP class find the width of the image:

Image img = new Image();
CompanyInfo companyInfo = CompanyInfo::find();
CompnayImage companyImage = CompnayImage::findByRecord(comapnyInfo);

img.setData(companyImage.Image);

salesPackingSlipHeaderTmp.LogoWidth = img.Width();

2) Add the image to the report:

2

3) Set the parameters to take the image from the dataset:

3

4) In Visual Studio set the Size property (of the image) to “Original size” (Right click on the image > Properies > Size)

5) Add the following expression in the “padding left” expression:

=CSTR(211-First(Fields!LogoWidth.value, “DataSetName”)) + “pt”

Where 211 is the maximum size (in pixel) of the image.

5
6) Deploy the report

Tag Cloud

Follow

Get every new post delivered to your Inbox.