Hello developers,
hopes that help me about that,
want to filter all shortcut dimensions values when status released and open on Purchase Line . Example,
PurchLine1- Released PO
Global dim1 A
Global dim 2 B
Shortcut dim 3 C
Shortcut dim 4 D
Shortcut dim 5 E
PurchLine2 - Open PO
Global dim1 A
Global dim 2 B
Shortcut dim 3 C
Shortcut dim 4 D
Shortcut dim 5 E
0
Answers
1. First create table and page to setup dimension filter sets depending on PO status, for instance:
Document Type - Option (values Empty, Purchase Order etc.) - Primary Key Field;
Document Status - Option (values Open, Released etc.) - Primary Key Field;
Dim Code - Code[20];
Dim Value - Code[20].
So here you will setup array of dim values user can select from depending on document status.
Create here or somewhere else function which will apply this setup filters to the dimension value record.
We will use it later, lets call this function ApplyDocStatusSetupDimValueFilters
2. override standard "user changes dimension values" routine on the page (PO in our example).
chain of objects we use to edit dimensions on Purchase Line:
Page Purchase Line Subform -> Action:Dimensions
-> table Purchase Line -> function ShowDimensions
-> codeunit DimensionManagement -> function EditDimensionSet
-> Page "Edit Dimension Set Entries" -> setfilters and RUNMODAL
-> table Dimension Set Entry -> lookup trigger on the field "Dimension Value Code"
you have to override lookup trigger on the last step of the chain.
create function something like LookupDimValuesDependOnPOstatus
and put it inside OnLookup trigger. Here you should use function ApplyDocStatusSetupDimValueFilters from step 1.
Be sure it will work as normal for all other documents.
3. override OnLookup triggers for all shortcuts in Purchase Line table.
There are still some things to solve (how to send a correct Document status to the ApplyDocStatusSetupDimValueFilters function), but i think you got the idea.
Dont forget to test thoroughly, dimensions one of the main reason they want to have ERP
But its not page filter.
I want to filter records in c/al matching all dimensions. Is there any standard solution? Sorry my foor experience
thats why you have to create function ApplyDocStatusSetupDimValueFilters,
of course its C/AL