Sequrity Filter

I defind one Global Dimension as Site and defind dimension values as different site names.
My database is Nav 4.0 SP2 SQL option.
I want to apply sequrity filter for Dimension values , but I am not getting the result.
What I have done
Object table Object ID ObjectName Read SequrityFilter
Field Filter
Tabledata 349 DimensionValue Y code onoo2
How can I apply the sequrity filter for a perticular dimension value?
And How can I apply sequrity filter for a Ge. Jnl. Batch?

Comments

  • security filter doesn't work with dimensions. You have to add code to implement it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • vyanku
    edited 2007-04-10
    I also create different batches for different sites.
    Can I apply sequrity filter on Gen.Jnl.Batch name?
  • yes you could use different batches.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Colud u please tell me how can I apply Sequrity filter for perticular batch?
    Anybody please ...............
  • Please anybody .........Help
  • Well you'll create a batch for every site.
    You'll also create a role for every site. For every role you'll insert 232 table and in the security filter you'll enter the filter for that batch.

    That's should do it. If the user gets error that they don' thave permission for the record, you have to modify the code and use SETPERMISSIONFILTER before the find('-')
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Where should I place the code of setpermissionfilter?
  • You only need to set this if the user get's error. To see where you need to put this, is first see if they get the permission error, then turn on the debugger and see where it errors out.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • I got the error then I run the debugger it shows me the codeunit from where it shows me error.
    I write code there as
    genjnlbatch.setpermissionfilter;
    
    But nothing is happend.
    What I have do more to solve this problem?
  • where did you put the code?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • I write code in
    Codunit 230 GenJnlManagement
    In checktempletname function before following code
    IF NOT genjnlbatch.find('-')

    I got error at
    GenJnlBatch.setpermissionfilter;
    GenJnlBatch.SETRANGE("Journal Template Name",CurrentJnlTemplateName);
    IF NOT GenJnlBatch.GET(CurrentJnlTemplateName,CurrentJnlBatchName) THEN BEGIN
      IF NOT GenJnlBatch.FIND('-') THEN BEGIN
        GenJnlBatch.INIT;
        GenJnlBatch."Journal Template Name" := CurrentJnlTemplateName;
        GenJnlBatch.SetupNewBatch;
        GenJnlBatch.Name := Text004;
        GenJnlBatch.Description := Text005;
        GenJnlBatch.INSERT(TRUE); [b] [I got error Here][/b]
        COMMIT;
    
  • Now why should I got the error:- U do not have permission to insert Gen.Jnoural Batch table?
    What I have to do to restrict user for perticular batch?

    Anybody got this type of problem before ?please suggest.
  • You need to set the security on the Gen. Journal Template table not
    Gen. Journal Batch.

    You need to also insert new records into the Gen. Journal Template table
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • You need to set the security on the Gen. Journal Template table not
    Gen. Journal Batch.
    Why Gen. Journal Batch. ? There is no batch name field?
    You need to also insert new records into the Gen. Journal Template table
    Which new records?
  • ara3n wrote:
    security filter doesn't work with dimensions. You have to add code to implement it.

    Hi, ara3n..

    So, do you mean that I cannot set security filter to filter dimension field? What code I must add to implement it? Could you give me some example?

    Thank you :D
    Best regards,

    Johanna
  • I suggest to try and put security filter and see if it works, and if it doesn't you'll know which form you'll need to add code to filter based on security filter.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Thank you ara3n.. :D

    I'll try it... ^^
    Best regards,

    Johanna