Options

Sequrity Filter

vyankuvyanku Member Posts: 791
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

  • Options
    ara3nara3n Member Posts: 9,256
    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
  • Options
    vyankuvyanku Member Posts: 791
    edited 2007-04-10
    I also create different batches for different sites.
    Can I apply sequrity filter on Gen.Jnl.Batch name?
  • Options
    ara3nara3n Member Posts: 9,256
    yes you could use different batches.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    vyankuvyanku Member Posts: 791
    Colud u please tell me how can I apply Sequrity filter for perticular batch?
    Anybody please ...............
  • Options
    vyankuvyanku Member Posts: 791
    Please anybody .........Help
  • Options
    ara3nara3n Member Posts: 9,256
    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
  • Options
    vyankuvyanku Member Posts: 791
    Where should I place the code of setpermissionfilter?
  • Options
    ara3nara3n Member Posts: 9,256
    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
  • Options
    vyankuvyanku Member Posts: 791
    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?
  • Options
    ara3nara3n Member Posts: 9,256
    where did you put the code?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    vyankuvyanku Member Posts: 791
    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;
    
  • Options
    vyankuvyanku Member Posts: 791
    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.
  • Options
    ara3nara3n Member Posts: 9,256
    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
  • Options
    vyankuvyanku Member Posts: 791
    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?
  • Options
    johannajohanna Member Posts: 369
    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
  • Options
    ara3nara3n Member Posts: 9,256
    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
  • Options
    johannajohanna Member Posts: 369
    Thank you ara3n.. :D

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

    Johanna
Sign In or Register to comment.